Write data over USB port

My team recently purchased a set of LED beacons, to display alarm statuses.

We'd like to write to these beacons from inside Ignition -- the plan is to have a vision client running on a nearby machine. These beacons expect to be written to over a USB connection. There is some demo python code provided to write to them, but it uses PyUSB, which doesn't work in Jython. There is also Java code, which uses usb4java, which just calling import org.usb4java.Context; doesn't work, I'd need to somehow bring the package into the vision client as well.

My hope is to use the Ignition Serial Module to write to these beacons, but I'm not sure how to (or if I even can). The beacons do not register themselves as a COM port. The expected way to connect to them is by specifying the device (device id and vendor id), whereas the serial module expects a single port name

Is there any method I can use to get the serial module to write this data, or do I need to look at a more complicated solution?

Reading through the Github, you have a few options.

  • Write a module to add the usb4java and wrapping code so you can use this directly.
  • Write a python flask webserver on the client and use REST commands to make it run.
  • Send the beacons back, get normally wired ones and use a modbusTCP IO unit to drive them with the Ignition Modbus driver.
  • Utilise system.util.execute | Ignition User Manual and call one of the command line versions of the PATlite code from Github.

Personally I think the easiest is the latter. The modbusTCP option is infinitely more supportable and reliable though.

3 Likes