9. Appendix C: Practical Example (RSLogix 500)
9.3.
The role of this
•If the user changes the number (or address) of the parameter to be read (N7:1) this causes the data used by the
B3:0/0 = 1 .................... A parameter is read on all TeSys U motor starters: In progress.
Reset (C5:0) ................ The number of motor starters polled counter is reinitialized.
Reset (T4:0)................. The timer associated with the timeout for a parameter’s read response is reinitialized.
N7:2 = 4....................... Index in the array of results → No. of the 1st element in the array = N7:4.
N7:3 = 1....................... Address of the Modbus slave polled → Address of the first TeSys U motor starter, that is to say 1.
N7:[4..11] = 0............... The contents of the array of results is reset.
B3:0/5 = 0 .................... Enables the update of the “trigger byte” that will trigger the emission of the query.
•The output data corresponding to the read query is updated (O:1.10 to O:1.12) and the N7:36 counter (“trigger byte”) is increased by one. This update is only done once (bit B3:0/5 used for this pupose). Reminder: In the LUFP9 gateway’s default configuration, this output data corresponds to the personalized Modbus command “Transactions 1” of the “TeSys U n°1” node. The query frame for this personalized command is sent when the “trigger byte” located in bits
•The data from the Modbus response which corresponds to this read command is checked. The values of inputs I:1.10 and I:1.11 are compared to those of output O:1.10 and the value 16#02xx (AND mask set to 16#FF00) in order to determine whether the response to the command has arrived or not. If the slave number and the function number correspond to those of the query (see above) and the number of bytes of data received is correct, bit B3:0/1 is activated in order to tell the rest of the
•The value of the read parameter is copied into the array of results. So the value of I:1.12 is transferred to the location reserved for the result of the motor starter currently being polled (use of index N7:2). This transfer only takes place if the response has arrived and its content is correct (bit B3:0/1 is active). The LSB and the MSB for this value are then swapped in this array so as to restore the value of the read parameter. The timer for the response timeout (T4:0) is reinitialized to allow the process of reading the same parameter on the next motor starter.
•Management of the response timeout (TON block on variable T4:0). Until the response arrives or if its content is incorrect (bit B3:0/1 = 0), a
•On receipt of the response, or after the timeout has been triggered, the internal data used by this
•When the reading of the 8th motor starter is finished (counter C5:0 reaching its preset value), the reading process is halted (bit B3:0/0 is reset). However, until the reading of the parameter for the 8th motor starter has finished, the
89