195
Function Descriptions Appendix C
• Arguments and Return Values
•Example
Variable name Data type Description
Send_string STRING Specifies the text string to send.
SCU_unit_number INT, UINT, WORD Specifies the number of the Serial Communi-
cations Unit.
Serial_port INT, UINT, WORD 1: Serial port 1
2: Serial port 2
Internal_logic_port INT, UINT, WORD 0 to 7: Internal logic port number specified
16#F: Automatic internal logic port allocation
CPU Unit
Barcode reader
Get Scene Number
Command: @READ
Serial
Communications
Unit (SCU)
Unit No. : 0
Serial
port 2
Get Scene Number
command: @READ
Variables
BOOL P_DoSendData (* Variable to control send function *)
INT iProcess (* Process number *)
STRING Message (* Send message *)
BOOL P_TXDU_Exe (* TXDU Execution Flag *) AT 1519.05 Unit number 0,
Use serial port 2.
BOOL P_ComInstEnable (* Communications Port Enable Flag*) AT A202.07 Use port 7.
(* Use the following: Unit number: 0, Serial port number: 2, Logical port number: 7 *)
(* Send data when P_DoSendData is ON and iProcess is 0 *)
IF (P_DoSendData = TRUE) AND (iProcess = 0) THEN
iProcess := 1;
P_DoSendData := FALSE;
END_IF;
(* Execute send processing according to process number *)
CASE iProcess OF
1: (* Create send text data *)
Message := '@READ';
iProcess := 2;
2: (* Execute send function if Communications Port Enable Flag and TXDU Execution Flag are ON *)
IF (P_ComInstEnable = TRUE) AND (P_TXDU_Exe = FALSE) THEN
TXD_SCU(Message, 0, 2, 7);
iProcess := 3;
END_IF;
3: (* Sending has been completed if Communications Port Enable Flag is ON *)
IF P_ComInstEnable = TRUE THEN
iProcess := 0;
END_IF;
END_CASE;