Omron NX Series User Manual page 216

Io-link system
Hide thumbs Also See for NX Series:
Table of Contents

Advertisement

9 Example of Operations for IO-Link Systems
*2. "E002_" is attached to the names of device variables that are automatically generated. The asterisk indi-
cates where the port number of the IO-Link Master Unit is input.
Example:
Process Data Communicating
Slave Table
_EC_PDSlavTbl[2]
Communications Error
_EC_CommErrTbl[1]
Programming for Photoelectric Sensors
A programming example for 9-5 Allocating Variables to the I/O Ports on page 9-7 is given below.
• Reading the Detected Light Level
The detected light level is read as a BYTE array device variable and converted to USINT.
Light_Received
*1. Light_Received is an USINT internal variable.
• Reading Bit Status
The Bit Test (TestABit) instruction is used to read sensor output 2.
SensorOutput2
*1. SensorOutput2 is a BOOL internal variable.
Additional Information
The following information applies when you use the IO-Link Master Simple Settings to generate
I/O ports and then automatically generate variable names.
• To read the detected light level, an USINT device variable N1_Port1_Detection_Level is
used. At this time, no internal variable definitions and type conversion program are required.
• To read sensor output 2, a BOOL device variable N1_Port1_Control_Output_2 is used. At this
time, no internal variable definitions and bit test program are required.
Refer to 8-2-4 IO-Link Master Simple Settings on page 8-15 for details on the IO-Link Master
Simple Settings.
Programming for Color Mark Sensors
A programming example for 9-5 Allocating Variables to the I/O Ports on page 9-7 is given below.
• Reading the R Detected Light Level
The Pack Word (PackWORD) instruction is used when reading the detected light level to join two
byte variables into one WORD variable.
9-12
Input Data Enabled Flag
E002_Port1_IN_Data_Enable
Input Data Invalid
Slave Table
_EC_InDataInvalid[1]
*1
:= BYTE_TO_USINT( LineA_Sensor[0] );
*1
:= TestABit( LineA_Sensor[1], 1 );
Programming to process input data
NX/GX-series IO-Link System User's Manual (W570)

Advertisement

Table of Contents
loading

This manual is also suitable for:

Gx seriesNx-ilm400Gx-ilm08c

Table of Contents