User`s manual

DSM314 COMM REQ
GFK-1742A Appendix B DSM314 Communications Request Instructions B-5
B
Monitoring the Status Word
Error Detection and Handling
As shown in the table above, a value of 1 is returned to the Status Word if communications
proceed normally, but if any error condition is detected, a negative value is returned. If you
require error detection in your ladder program, you can use a Less Than (LT) compare instruction
to determine if the value in the Status Word is negative (less than zero). An example of this is
shown in the following figure. If an error occurs, the Less Thans output (Q) will go high. A coil
driven by the output can be used to enable fault handling or error reporting logic.
The FT output of the COMM REQ, described later in this appendix, goes high for certain faults
and can be used for fault detection also. Additionally, the Status Word can be monitored by error
message logic for display on an Operator Interface device, in which case, Status Word codes
would correspond to appropriate error messages that would display on the operator screen. For
example, if a 1 was detected in the Status Word, a message could be displayed that says
something like Error communicating with the DSM module in an expansion rack.
To dynamically check the Status Word, write a non-significant positive number (0 or 99 are
typically used) into the Status Word each time before its associated COMM REQ is executed.
Then, if the instruction executes successfully, the CPU will write the number 1 there. This
method lets you know that if the number 1 is present, the last COMM REQ definitely executed
successfully, and that the 1 was not just left over from a previous execution. In the example
presented at the end of this appendix, the number 99 is moved into the Status Word (%R0195) in
a rung prior to the rung that contains the COMM REQ instruction.
When multiple DSM COMM REQs are used, it is recommended that each be verified for
successful communications before the next is enabled. Monitoring the Status Word is one way to
accomplish this.
Verifying that the DSM Received Correct Data
For critical applications, it may be advisable to verify that certain parameter values were
communicated correctly to the DSM module before operation is allowed to continue. To
accomplish this, first program the
Select Return Data
%AQ Immediate Command to specify a
DSM parameter number to be read into the applicable
User Selected Data
%AI double word
(there is one
User Selected Data
%AI double word for each axis).
Note that at least three PLC
sweeps or 20 milliseconds, which ever represents more time, must elapse before the new
User
Selected Data
is available in the PLC.
This requires programming some time delay logic to
ensure that this requirement is met. Then, program a Double Integer type Equal instruction to
compare the value returned in the
User Selected Data
double word with the value sent. Section 5
of this appendix shows an example of this. Also, refer to Chapter 5 for more information on the
User
Selected Data
word
and the
Select Return Data
command.
L
T
I
1
I
2
I
NT
Q
STATUS
+00000
F
AULT