Force Coil


I want to force a coil using modbus protocol TCP, but the modbus driver provided by ignition doesn´t have this option, How i can make that possible???

There shouldn’t be any issues writing to a Coil.

Make a tag pointing to the Coil you want to write to, then write to it from the designer, a client, or scripting.

What issues are you having?

Well, This is the problem:

I am working in a new project, in this project i use a Digi connectport X4 gateway like modbus bridge with RF Xbee’s modules, the RF Xbee´s are the slaves and the gateway is a master in modbus protocol. The protocol of communication between my pc and the digi gateway is Modbus TCP. In Ignition i use a Modbus V2 driver provided by ignition, the modbus queries options in this driver are only of reading for example: read a single coil (01 modbus function), discrete input (02 modbus function), input registers (04 modbus function), holding registers (03 modbus function), but when i want to use other modbus functions like 05-force coil this option doesn’t exist t:cry:

Can you help me???
Excuse my bad English! :blush:

The Modbus v2 driver is capable of writing to coils with function code 05, I’m not sure what you’re problem is still.

Hi Kevin,

Is it possible to only write to coils on events, disable reading them?

Polling “ns=1;s=[{Device}]{Node}.C1003” fails my other COILS. I suspect the controller will not allow me to read these COILS.

If you don’t want to read them then don’t create a tag for them.

Writes will have to be done using system.opc.write instead.


Thanks for the prompt reply Kevin.

I gave it a shot in the script console, but only get BAD returned. Can you assist me?

server = “Ignition OPC-UA Server”
path = “ns=1;s=[{Jets_CWM_Demo}]1.C1004”
newValue = 1
system.opc.writeValue(server, path, newValue)

That’s certainly not a valid OPC Item Path. You’re going to have to resolve that reference manually. Or just remove the curly brackets if those are a mistake and the device name is “Jets_CWM_Demo”.

Copy and paste error. :poop: Thanks again! :smiley: