32
10 Programming Using IO-Link
<Variables and instructions used in the sample program>
Variables are generated automatically by the procedure in 8.2.2 Setting Device Variables.
Variable
table
Name Data type Description Remarks
External
variables
(global
variables)
N5_Node_location_
information
_sNXUNIT_ID
Device variable
Node location information
is stored.
This is generated at
execution of Create
Device Variable in 8.2.2
Setting Device
Variables.
SLC_Error_Code
ARRAY[0..255] OF
BYTE
Stores the error codes of
the safety light curtain that
are acquired in the
sample pro
ram.
This is generated in
Steps 27 and 28 of
10.2.2 Programming.
Internal
variables
DevicePort _sDEVICE_PORT
This object stores the
information that specifies
the device to acquire
service data from.
This is generated in
Step 8 of 10.2.2
Programming.
DeviceType _eDEVICE_TYPE
Stores the target unit type
to read data from.
This is set in step 9 of
10.2.2 Programming.
NxUnit _sNXUINT_ID
Stores the node location
of the target Master Unit
to be read.
This is set in step 12 of
10.2.2 Programming.
PortNo USINT
Stores the port No. of the
Master Unit to which the
target to be read is
connected.
This is set in step 12 of
10.2.2 Programming.
DeviceObject _sIOLOBJ_ACCESS
This object stores the
information that specifies
which service data to
read.
This is generated in
Step 18 of 10.2.2
Programming.
Index UINT This stores the index.
This is generated in
Step 19 of 10.2.2
Programming.
Subindex USINT Stores the sub-index.
This is generated in
Step 22 of 10.2.2
Programming.
start BOOL
This is executed once by
the False state changing
to True in the sample
program.
This is generated in
Step 5 of 10.2.2
Programming.
10.2.2 Programming
1
Make sure that the IO-Link Master Unit is in the offline mode. If the IO-Link Master Unit is
online, set it to the offline mode.
2
Select Programming in the
Multiview Explorer.
3
Open POUs - Programs - Program0 - Section0.
When Section0 is already used for another program, right-click Program0 and click Add -
Section.