199
Function Descriptions
Appendix C
• Arguments and Return Values
• Example
Variable name
Data type
Description
Storage_location
STRING
Specifies the storage location for the received text
string.
Number_of_characters
INT, UINT, WORD
Specifies the number of characters to receive.
0 to 255
SCU_unit_number
INT, UINT, WORD
Specifies the number of the Serial Communica-
tions 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
Barcode reader
CPU Unit
Serial
Communications
Unit (SCU)
Unit No.: 0
Message
→
Value to read
Serial
port 2
Variables
BOOL
P_DoRecvData
(* Variable to control receive function *)
INT
iProcess
(* Process number *)
STRING Message
(* Variable to store received message *)
BOOL
P_RXDU_Recv
(* Status of Serial Communications Unit *) AT 1519.06 Unit No. 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 *)
(* 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
RXD_SCU(Message, 16, 0, 2, 7);
iProcess
:=
2;
END_IF;
2:
(* Reception has been completed if Communications Port Enable Flag is ON *)
IF
P_ComInstEnable
=
TRUE
THEN
iProcess
:=
0;
END_IF;
END_CASE;
Содержание SYSMAC CX-Programmer 9
Страница 2: ......
Страница 4: ...iv ...
Страница 6: ...vi ...
Страница 8: ......
Страница 16: ...xvi ...
Страница 20: ...xx ...
Страница 26: ...xxvi Application Precautions 4 ...
Страница 27: ...Part 1 Function Blocks ...
Страница 28: ......
Страница 154: ...128 Procedures Section 3 2 ...
Страница 155: ...Part 2 Structured Text ST ...
Страница 156: ......
Страница 160: ...134 CX Programmer Specifications Section 4 2 ...
Страница 206: ...180 Procedures Section 6 1 ...
Страница 208: ...182 System defined external variables supported in function blocks Appendix A ...
Страница 230: ...204 Revision History ...
Страница 231: ......