Module author: Galen Collins <bashwork@gmail.com>
Section author: Galen Collins <bashwork@gmail.com>
TODO write mask request/response
This function code is used to write a single output to either ON or OFF in a remote device.
The requested ON/OFF state is specified by a constant in the request data field. A value of FF 00 hex requests the output to be ON. A value of 00 00 requests it to be OFF. All other values are illegal and will not affect the output.
The Request PDU specifies the address of the coil to be forced. Coils are addressed starting at zero. Therefore coil numbered 1 is addressed as 0. The requested ON/OFF state is specified by a constant in the Coil Value field. A value of 0XFF00 requests the coil to be ON. A value of 0X0000 requests the coil to be off. All other values are illegal and will not affect the coil.
Decodes a write coil request
Parameters: | data – The packet data to decode |
---|
Encodes write coil request
Returns: | The byte encoded message |
---|
Run a write coil request against a datastore
Parameters: | context – The datastore to request from |
---|---|
Returns: | The populated response or exception message |
The normal response is an echo of the request, returned after the coil state has been written.
Decodes a write coil response
Parameters: | data – The packet data to decode |
---|
Encodes write coil response
Returns: | The byte encoded message |
---|
“This function code is used to force each coil in a sequence of coils to either ON or OFF in a remote device. The Request PDU specifies the coil references to be forced. Coils are addressed starting at zero. Therefore coil numbered 1 is addressed as 0.
The requested ON/OFF states are specified by contents of the request data field. A logical ‘1’ in a bit position of the field requests the corresponding output to be ON. A logical ‘0’ requests it to be OFF.”
Decodes a write coils request
Parameters: | data – The packet data to decode |
---|
Encodes write coils request
Returns: | The byte encoded message |
---|
Run a write coils request against a datastore
Parameters: | context – The datastore to request from |
---|---|
Returns: | The populated response or exception message |
The normal response returns the function code, starting address, and quantity of coils forced.
Decodes a write coils response
Parameters: | data – The packet data to decode |
---|
Encodes write coils response
Returns: | The byte encoded message |
---|