| FieldTalk™ Modbus Master .NET Library |
|
MbusMasterFunctions.writeCoil Method
Modbus function 5 (05 hex), Force Single Coil/Write Coil.
[C#]
public
int writeCoil(
int slaveAddr,
int bitAddr,
bool bitVal);
Parameters
-
slaveAddr
- Modbus address of slave device or unit identifier (Range: 0 - 255)
-
bitAddr
- Coil address (Range: 1 - $10000)
-
bitVal
- true sets, false clears discrete output variable
Return Value
BusProtocolErrors.FTALK_SUCCESS on success or error code. See BusProtocolErrors for possible error codes.
Remarks
Sets a single discrete output variable (coil, 0:00000 table) to either ON or OFF.
Note Broadcast supported for serial protocols
See Also
MbusMasterFunctions Class | FieldTalk Namespace