43
10 Programming Using IO-Link
<Variables and instructions used in the sample program>
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_Receiver_
Level
ARRAY[0..255] OF
BYTE
Stores the amount of
incident light of each
individual axis of the
receiver that was acquired
in the sample pro
ram.
This is generated in
Step 28 of 10.3.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 Pro
rammin
.
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 This 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
pro
ram.
This is generated in
Step 5 of 10.2.2
Programming.
10.3.2 Programming
A sample program for reading the amount of incident light can be created by copying the sample
program created in 10.2.2 Programming and changing the following points.
Step 18 Change Enter Variable at In as follows.
Specify the index No. where the amount
of incident light level of the safety light
curtain is stored.
In:
UINT#10#71
Step 28 Change the new global variable to create as follows:
Create the variable for reading the amount of incident light level of the safety light curtain.
Variable name: SLC_Receiver_Level
Data type: ARRAY[0..255] OF BYTE