Function Descriptions
• Arguments and Return Values
Variable name
Storage_location
Number_of_characters
SCU_unit_number
Serial_port
Internal_logic_port
• Example
Serial
Communications
Unit (SCU)
CPU Unit
Unit No.: 0
Message → Value to read
Serial
port 2
Variables
BOOL
P_DoRecvData
INT
iProcess
STRING Message
BOOL
P_RXDU_Recv
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 *)
(* Receive data when P_DoRecvData is ON and iProcess is 0 *)
IF (P_DoRecvData = TRUE) AND (iProcess = 0) THEN
iProcess := 1;
P_DoRecvData := FALSE;
END_IF;
(* Execute receive processing according to process number *)
CASE iProcess OF
1:
(* Reception function executed if Communications Enabled Flag and Reception Completed
Flag are ON. *);
IF (P_ComInstEnable = TRUE) AND (P_RXDU_Recv = TRUE) THEN
END_IF;
2:
(* Reception has been completed if Communications Port Enable Flag is ON *)
IF P_ComInstEnable = TRUE THEN
END_IF;
END_CASE;
Data type
STRING
INT, UINT, WORD
INT, UINT, WORD
INT, UINT, WORD
INT, UINT, WORD
Barcode reader
(* Variable to control receive function *)
(* Process number *)
(* Variable to store received message *)
(* Status of Serial Communications Unit *) AT 1519.06 Unit No. 0
Use serial port 2
RXD_SCU(Message, 16, 0, 2, 7);
iProcess := 2;
iProcess := 0;
Description
Specifies the storage location for the received text
string.
Specifies the number of characters to receive.
0 to 255
Specifies the number of the Serial Communica-
tions 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
199
Need help?
Do you have a question about the CX-PROGRAMMER V8.1 and is the answer not in the manual?
Questions and answers