Omron WS02-CXPC1-V9 - V9 Operation Manual page 221

Table of Contents

Advertisement

Function Descriptions
• Arguments and Return Values
Variable name
Send_string
SCU_unit_number
Serial_port
Internal_logic_port
• Example
Serial
Communications
Unit (SCU)
CPU Unit
Unit No. : 0
Get Scene Number
Get Scene Number
Command: @READ
command: @READ
Serial
port 2
Variables
BOOL
P_DoSendData
INT
iProcess
STRING Message
BOOL
P_TXDU_Exe
BOOL
P_ComInstEnable
(* 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;
Data type
STRING
INT, UINT, WORD
INT, UINT, WORD
INT, UINT, WORD
Barcode reader
(* Variable to control send function *)
(* Process number *)
(* Send message *)
(* TXDU Execution Flag *) AT 1519.05 Unit number 0,
Use serial port 2.
(* Communications Port Enable Flag*) AT A202.07 Use port 7.
Description
Specifies the text string to send.
Specifies the number of the Serial Communi-
cations Unit.
1: Serial port 1
2: Serial port 2
0 to 7: Internal logic port number specified
16#F: Automatic internal logic port allocation
Appendix C
195

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cx-programmer 9Sysmac ws02-cxpc1-v9

Table of Contents