Author Topic: ModbusTCP parsing a PLC Boolean Array  (Read 925 times)

timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
ModbusTCP parsing a PLC Boolean Array
« on: May 29, 2018, 10:10:26 AM »
I have a job i'm doing for a customer that wants me to make an interface for their PLC.  The PLC is of type GE CPE330.  I'm using ModbusTCP to interface with it successfully so far.  I'm at a snag where I need to parse through a boolean array they have to determine what faults are active in the system.  It's 100 booleans and I need to send it over ModbusTCP to the HMI. I can use straight booleans or i can pack it into an INT somehow. 

But what on the AHMI side should I do to evaluate that data? I'm using a DataSubscriber 2 already on my MDI Parent for other items and I can add whatever element I need to that which will constantly check the machine for the active faults.  But what data type... how do I address it? How do I parse it?

I have 40500 and UP to work with for Modbus Addresses.

Please your thoughts are very much appreciated.
Still just trying to figure out this thing called Life.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: ModbusTCP parsing a PLC Boolean Array
« Reply #1 on: May 29, 2018, 11:12:46 AM »
Have you tried using the latest beta version?

Archie did fix a few things in Modbus drivers.

timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
Re: ModbusTCP parsing a PLC Boolean Array
« Reply #2 on: May 29, 2018, 11:49:07 AM »
No I haven't... anything YOU know of which would be advantageous to justify getting the latest?


 
Still just trying to figure out this thing called Life.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: ModbusTCP parsing a PLC Boolean Array
« Reply #3 on: May 29, 2018, 01:05:38 PM »
This is as much as it shows, Modbus related:

Modbus - Fixed writing multiple coils with function code 15
Modbus - Long, floats were not allowing bit addressing
Modbus - Subscribing to multiple elements was not working

There are a lot more changes to other components/controls, possibly DataSubscriber2.
All the improvements would always justify getting the latest version.

You might try adding another DataSubscriber2 and use it only to subscribe to those boolean values of interest to you.
Then, when you double-click the DataSubscriber2, you would use its DataChanged event to determine what boolean values have changed (this event is only fired when the values change).

Noe

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Re: ModbusTCP parsing a PLC Boolean Array
« Reply #4 on: May 29, 2018, 05:52:17 PM »
I can suggest to monitor the whole array in the PLC, with only one bit. So in case any alarm is triggered (I am guessing that the array is all zero when ok) that bit will be turn on (by a not equal statement). You can see the bit on, and then call the alarm array read so you will not have to be constantly readind the whole array permanently.

Hope I explained myself, I have used this method in something similar, is faster and saves bandwidth.

Phrog30

  • Guest
Re: ModbusTCP parsing a PLC Boolean Array
« Reply #5 on: May 29, 2018, 06:27:37 PM »
The app I posted several times with alarming shows how to read integer arrays and then look at individual bits. I tested with modbus as well.