Nj-Series Instructions Reference Manual (W502 - Omron NJ501-1500 Reference Manual

Machine automation controller nj-series
Hide thumbs Also See for NJ501-1500:
Table of Contents

Advertisement

2 Instruction Descriptions
Sample Programming
This sample uses CIP class 3 messages to write a variable, read a variable, and send a message. The
Controllers are connected to an EtherNet/IP network. The IP address of the remote node is
192.168.250.2.
The following procedure is used.
1
The CIPOpen instruction is used to open a class 3 connection. The timeout time is 2 s.
2
The CIPWrite instruction is used to write the value of a variable at a remote node. The variable
name at the remote node is WritingDat and the contents of the WriteDat is written to it. Writing-
Dat must be defined as a global variable at the remote node and the Network Publish attribute
must be set.
3
The CIPRead instruction is used to read the value of a variable at a remote node. The value of
the variable OriginalDat at the other node is read and the read value is stored in the ReadDat
variable. OriginalDat must be defined as a global variable at the remote node and the Network
Publish attribute must be set.
4
The CIPSend instruction is used to send an explicit message to a remote node. The contents of
the message is to read identity information (product name). The class ID, instance ID, attribute
ID, and service code are as follows: The response data is stored in the ResDat variable.
Item
Class ID
Instance ID
Attribute ID
Service code
5
The CIPClose instruction is used to close the class 3 connection.
Built-in EtherNet/IP port
2-686
Value
1
1
7
16#0E
Value of variable written.
WriteDat
Value of variable read.
ReadDat
Message sent to read identity
information (product name).
ResDat
Response
IP address: 192.168.250.2
Built-in EtherNet/IP port
Variable name: Writing-
Dat, global variable with a
Network Publish attribute
Variable name: OriginalDat,
global variable with a
Network Publish attribute

NJ-series Instructions Reference Manual (W502)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1400

Table of Contents