25
10 Programming Using IO-Link
10. Programming Using IO-Link
This section describes how to create a program in Sysmac Studio and the procedure for acquiring
each of the process data and service data of the safety light curtain.
10.1.1 Reading the Power Supply Voltage of the Receiver
The values of the power supply voltage of the receiver are read from the process data that is
shared between the safety light curtain and the IO-Link Master Unit by cyclic communications.
The power supply voltage of the receiver is each split into the following two 1-byte parts before
being stored.
Device variable Stored information
Nx_Portx_Power_supply_high Power supply voltage of receiver (upper 8 bits)
Nx_Portx_Power_supply_low Power supply voltage of receiver (lower 8 bits)
x: Depends on the system configuration.
<Sample programming 1>
<Variables used in the sample program>
Variable
table
Name Data type Description Remarks
External
variables
(global
variables)
N5_Port1_IN_Data_Enable BOOL
Device variable
Becomes True when
the process data of
port1 is enabled.
This is generated at
execution of
Create
Device Variable
in
8.2.2
Setting Device
Variables.
N5_Port1_Power_supply_high
BYTE
Device variable
The power supply
voltage supplied to the
receiver are stored to
the upper 8 bits and
lower 8 bits,
respectively.
This is generated at
execution of
Create
Device Variable
in
8.2.2
Setting Device
Variables.
N5_Port1_Power_supply_low
SLC_Power_Supply WORD
Stores the power
supply voltage of the
receiver that was
acquired in the sample
program.
This is generated in
Steps 9 to 11 of
10.1.2
Programming.
10.1 Sample Program for Acquiring Process Data
(1) Executes the program when
the process input data is
enabled on the controller.
(N5_Port1_IN_Data_Enable
ON)
(2) Stores the power supply
voltage of the receiver that
are split and stored into two
1-byte parts to a 2-byte
variable
(SLC_Power_Supply).