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;
Summary of Contents for CX-PROGRAMMER V8.1
Page 3: ...iv...
Page 5: ...vi...
Page 7: ......
Page 15: ...xvi...
Page 19: ...xx...
Page 25: ...xxvi Application Precautions 4...
Page 26: ...Part 1 Function Blocks...
Page 27: ......
Page 153: ...128 Procedures Section 3 2...
Page 154: ...Part 2 Structured Text ST...
Page 155: ......
Page 159: ...134 CX Programmer Specifications Section 4 2...
Page 205: ...180 Procedures Section 6 1...
Page 207: ...182 System defined external variables supported in function blocks Appendix A...
Page 229: ...204 Revision History...
Page 230: ......