2 Instruction Descriptions
2-670
NJ-series Instructions Reference Manual (W502)
The settings of Serial Communications Unit are given in the following table.
The number from the barcode reader is separated into individual characters and bit strings for the char-
acter codes are stored in RecvDat[]. One element of the RecvDat[] array corresponds to one character
from the barcode. First, the AryToString instruction is used to convert the data to a text string
(RecvStringDat). Then, the STRING_TO_ULINT instruction is used to convert the data to an ULINT
integer (Code).
Definitions of Global Variables
Item Set value
Port 2: User-specified Setting Inclusion User settings
Port 2: Serial Communications Mode No-protocol
Port 2: Data Length 8 bits
Port 2: Stop Bits 1 bit
Port 2: Parity No
Port 2: Baud Rate 38,400 bps
Port 2: No-Protocol End Code D
Port 2: No-Protocol Start Code Inclusion Setting No
Port 2: No-Protocol End Code Inclusion Setting Yes (Specify a desired end code.)
RecvDat[0]
RecvDat[1]
RecvDat[2]
RecvDat[3]
:
RecvStringDat
AryToString
STRING_TO_ULINT
ULINT#4901
‘4901 ’
BYTE#16#34
BYTE#16#39
BYTE#16#30
BYTE#16#31
:
BYTE array
STRING data
Code
ULNIT data
BOOL
Name
Global Variables
IOBus://rack#0/slot#0/P2_NopSta
/P2_NopRcvCompleteSta
Barcode_P2_NopRcvCompleteSta
Data type
AT specification
Comment
Reception Completed Flag