122
RS-232C Serial Communications Section 7-2
■ Checksum Calculation Subroutine
Step Description
1 The fixed portion of the send command is set. This processing is performed once at startup.
Note The start code at the beginning of the command format does not need to be set here. The value that is set
in the PLC Setup will be sent.
2 A communications refresh timer of 300 ms is started. This performs the first sending after 300 ms.
3 Once 300 ms has elapsed, the Built-in RS-232C Port Reception Completed Flag is checked, and receive pro-
cessing is performed if data has been received. A send command from the Standard PLC is initially required, and
so reception processing is performed after completing the first send.
4 The RS-232C reception size is temporarily stored in D323 in the work area.
5 The reception response is read to D200 and following words from the RS-232C receive port.
6 The checksum calculation subroutine given above is called, and the checksum of the reception response is cal-
culated.
7 The checksum of the reception response and the end code are checked, and the G9SP Communications Trans-
mission Data is copied to CIO 200 and CIO 201 and G9SP Safety Input Terminal Data is copied to CIO 202 to
CIO 204.
8 The system checks whether the RS-232C send port status is ready to send.
9 If sending is possible, G9SP communications reception data is set to the send command from CIO 100.
10 The checksum calculation subroutine given above is called, and the checksum of the send command is calcu-
lated.
11 The send command is transferred to the RS-232C send port, which enables sending to the G9SP-series Control-
ler.
12 The timer is restarted and the next receive processing is performed after 300 ms.