Hôm nay chúng tôi có thể giúp gì cho bạn?

Setting up a Write_Var command to have a M340 PLC write data directly to a supported TCP/IP device.

Follow the below procedure :

  1. Create an Ethernet I/O network — In your Unity Pro project, add a new Ethernet network, configure it for your application, and validate the changes.
  2. Link the network to the CPU's Ethernet port — In the hardware configuration, assign the network you just created to the CPU's built-in Ethernet port.
  3. Enable array entry in project settings — Go to Tools > Project Settings and check the data-type options that allow arrays to be entered directly, instead of having to declare them as variables first.project option
  4. Add an ADDM block — Set its IN parameter to the target device's IP address as a quoted string, in the form 'TCP_IP{x.x.x.x}' — quotation marks required on both sides since it's a character string.
  5. Add and wire a WRITE_VAR block — Connect the ADDM block's output to a WRITE_VAR (or READ_VAR) block to complete the data exchange with the target device.


Below an example with the NetLink id "Ethernet_1" and IP address of the device 192.168.40.11.
Next configure the remaining parameters of the Write_Var block where:

OBJ = String declaring the type of object to Write (%MW or %M)
NUM = The starting register address in the Slave device to were the data will be sent
NB = The # of registers to write
GEST = Array of length 4 where the Management Exchange table for the Write_Var is located
EMIS = Array of length NB where the Write data is stored in the M340.
Note: The Array's are of type INT if declared as variables.

WRITE_VAR , example


Finally build, download, and run the program

Schneider Electric Việt Nam

Tìm hiểu thêm
Phạm vi:
Tìm hiểu thêm
Phạm vi:
  • Tài liệu về Sản phẩm
  • Tải xuống phần mềm
  • Công cụ chọn Sản phẩm
  • Thay thế và thay đổi sản phẩm
  • Trung tâm Hỗ trợ
  • Tìm Văn phòng của chúng tôi
  • Nhận báo giá
  • Tìm Nhà Phân phối
  • Cộng đồng Schneider Electric
  • Cơ hội nghề nghiệp
  • Hồ sơ doanh nghiệp
  • Báo cáo hành vi sai trái
  • Khả năng truy cập
  • Phòng tin tức
  • Nhà đầu tư
  • EcoStruxure
  • Tìm việc
  • Blog
  • Chính sách bảo mật
  • Thông báo về Cookie
  • Điều khoản sử dụng
  • Change your cookie settings