![Omron SYSMAC CX-Programmer 9 Operation Manual Download Page 221](http://html1.mh-extra.com/html/omron/sysmac-cx-programmer-9/sysmac-cx-programmer-9_operation-manual_744241221.webp)
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 SYSMAC CX-Programmer 9
Page 2: ......
Page 4: ...iv ...
Page 6: ...vi ...
Page 8: ......
Page 16: ...xvi ...
Page 20: ...xx ...
Page 26: ...xxvi Application Precautions 4 ...
Page 27: ...Part 1 Function Blocks ...
Page 28: ......
Page 154: ...128 Procedures Section 3 2 ...
Page 155: ...Part 2 Structured Text ST ...
Page 156: ......
Page 160: ...134 CX Programmer Specifications Section 4 2 ...
Page 206: ...180 Procedures Section 6 1 ...
Page 208: ...182 System defined external variables supported in function blocks Appendix A ...
Page 230: ...204 Revision History ...
Page 231: ......