![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/3/8d/38d56254-54fe-46e3-85ae-d3f5260e1091/38d56254-54fe-46e3-85ae-d3f5260e1091-bg167.png)
FX Series Programmable Controllers Points Of Technique 10
10-19
10.14.2 Header and Terminator Characters
The header and terminator characters can be chan
ed b
the user to suit their requirements.
The default settin
for the header stored in D8124 is 'STX' (or 02H)and the terminator default
settin
stored in D8125 is 'ETX' (or 03H).
The header and terminator characters are automaticall
added to the 'send' messa
e at the
time of transmission. Durin
a receive c
cle, data will be i
nored until the header is received.
Data will be continuall
read until either the termination character is received or the receive
buffer is filled. If the buffer is filled before the termination character is received then the
messa
e is considered incomplete.
If no termination character is used, then readin
will continue until the receive data buffer is
full. Onl
at this point will a messa
e have been accepted and complete. There is no further
bufferin
of an
communications, hence if more data is sent than the available destination
buffer size then the excess will be lost once the buffer is full.
It is therefore ver
important to specif
the receive buffer len
th the same size as the lon
est
messa
e to be received.
Events to complete a transmission:
The RS instruction should be set up and active.
The data to be transmitted should be moved into the
transmission data buffer. If a variable is bein
used to
identif
the messa
e len
th in the RS instruction this
should be set to the new messa
e len
th. The send fla
M8122 should then be SET ON. This will automaticall
reset once the messa
e has been sent. Please see the
example pro
ram ri
ht.
Events encountered when receiving a message:
The RS instruction should be set up and active.
Once data is bein
received and an attempt is made to
send out data, the special M fla
M8121 is set ON to
indicate the transmission will be dela
ed. Once the
'incomin
' messa
e is completel
received the messa
e
received fla
M8123 is set ON. At the same time if M8121
was ON it is automaticall
reset allowin
further
messa
es (dela
ed or otherwise) to be transmitted.
It is advisable to move the received data out of the received data buffer as soon as possible.
Once this is complete M8123 should be reset b
the user. This is then read
to send a
messa
e or to await receipt of a new messa
e.
K 10D200RS D49D50
M8000
X3
BMOV K 6D50D100
MOV D49K6
SET M8122
K 10D200RS D49D50
M8000
M8123
BMOV K 10D70D200
RST M8123