Omron CX-PROGRAMMER V8.1 Operation Manual page 222

Function blocks/ structured text
Table of Contents

Advertisement

Function Descriptions
• Example
CPU Unit
Message → Value to read
RS-232C
port
Variables
BOOL
P_DoRecvData
STRING
Message
BOOL
P_EndRecvCPUPort
(* Receive data when P_DoRecvData is ON and reception has been completed*)
IF (P_DoRecvData = TRUE) AND (P_EndRecvCPUPort = TRUE) THEN
(* Get 16 characters *)
RXD_CPU(Message, 16);
P_DoRecvData := FALSE;
END_IF;
Related Auxiliary
Area Flag
RS-232C Port
Reception Com-
pleted Flag
RS-232C Port
Reception Overflow
Flag
RS-232C Port
Reception Counter
For further information and precautions on related Auxiliary Area flags, refer to the section on RXD Serial Com-
munications Instruction in the CS/CJ-series Instruction Reference Manual.
RXD_SCB: Receive String via Serial Port on Serial Communications Board
• Function
Receives a text string from a serial port on a Serial Communications Board (SCB).
• Application
RXD_SCB (Storage_location, Number_of_characters, Serial_port)
• Conditions
The serial communications mode of the serial port must be set to no-protocol communications.
• Arguments and Return Values
Variable name
Storage_location
Number_of_characters
Serial_port
Barcode reader
(* Variable to control receive function *)
(* Variable to store received message *)
(* Reception Completed Flag *) AT A392.06
Address
A392.06
A392.07
A393
Data type
STRING
INT, UINT, WORD
INT, UINT, WORD
Description
ON when reception has been completed in no-protocol mode.
ON when a data overflow occurred during reception in no-pro-
tocol mode.
Contains the number of characters received in no-protocol
mode.
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 port.
1: Serial port 1
2: Serial port 2
Appendix C
197

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac ws02-cxpc1-v8Sysmac cx-programmer 8.1

Table of Contents