Appendix C: COM2 UDCP Specification
237
Example 1 – Printing an Error Message from an Input
As described above, sending a message out of the COM2 port on the D320 PLC is a very simple
procedure. This example illustrates how to send a text message out of COM2 whenever an input
condition comes true.
For this example, input R0.0 is defined as an error-condition input. When it turns On, the D320 PLC
will print out the simple text string “ALARM” on COM2. The procedure is as follows:
1.
Set the COM2 port into UDCP mode. Also, for this example, the carriage return (CR) end
code will be used.
2.
When the input R0.0 turns On, place the text string “ALARM” into the Send buffer. The
string is created using the ASCII codes for each character, as follows:
“A”
= $41
“L”
= $4B
“A”
= $41
“R”
= $52
“M” = $4C
CR
= $0D
3.
Set the Request Transmission flag F11.0 to send the message.
Ladder Program
Rung 2:
When input 0 (R0.0) is
first triggered, the “ALARM”
message is loaded into
the Send buffer (SR298 to
SR301). Then the Send
Request flag F11.0 is
set to request the message
be sent out by the PLC.
R0.0
LET
D=SR298
S=$4B41
LET
D=SR299
S=$5241
LET
D=SR300
S=$0D4C
LET
D=SR370
S=6
F1.0
F11.3
F12.8
S
S
Rung 1:
This rung initializes the
port and communications
program by:
F11.3 - Enable End Code
F12.8 - UDCP Mode
R
F11.0
S
Summary of Contents for D320 PLC
Page 1: ...D320 PLC User s Manual...
Page 18: ...6 D320 PLC User s Manual...
Page 28: ...16 D320 PLC User s Manual...
Page 34: ...22 D320 PLC User s Manual...
Page 78: ...66 D320 PLC User s Manual...
Page 176: ...164 D320 PLC User s Manual...
Page 210: ...198 D320 PLC User s Manual...
Page 258: ...246 D320 PLC User s Manual...