occurrence counter & memory

Discuss issues and ideas you have to configuring displays with PowerVision
verschuren
Posts: 79
Joined: Wed Oct 28, 2015 8:40 am

occurrence counter & memory

Post by verschuren » Wed Jan 13, 2016 11:40 am

Hi,

I have a CAN variable (1 byte, 8 bits long with 6 conditions) I'm monitoring that will have to store the last value before power cycle and display this in a popup at startup. I also would like to make an occurrence counter for those conditions to keep track of the frequency of those conditions.

1) I'm not sure how to store the individual conditions in the memory and individually add them up in a counter with every new occurrence.
2) How can I store the last condition before the power cycle and display the correct condition at startup?

I would appreciate any input on this. I'm using a PV480 display.

Thanks!

Mario
Mario Verschuren
Controls Integration
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: occurrence counter & memory

Post by stalley » Wed Jan 13, 2016 12:04 pm

Hi Mario,

All of the variables in Programming have a Fire on change event. You can use it to do what you need.
  • Put your on change event on the CAN variable.
  • Seems like the simplest way is to have 6 variables for the 6 conditions and 1 variable for the current condition. These need to have the current condition variable set as Survives Powercycle.
  • Your script, activity program or state machine that runs when the on change event gets fired will have the logic to update the variables. Be sure to send the Database Manager Save or SaveAll after the update.
  • Use your current condition variable in your popup at startup.
Let us know how you get along!
Sara Talley
Software Engineer
Enovation Controls
verschuren
Posts: 79
Joined: Wed Oct 28, 2015 8:40 am

Re: occurrence counter & memory

Post by verschuren » Thu Jan 14, 2016 7:45 am

Thanks Sara,

I will try this out and let you know.
Mario Verschuren
Controls Integration
verschuren
Posts: 79
Joined: Wed Oct 28, 2015 8:40 am

Re: occurrence counter & memory

Post by verschuren » Thu Jan 28, 2016 8:28 am

Hi Sara,

Could you give me an example? That would help out a lot.
Mario Verschuren
Controls Integration
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: occurrence counter & memory

Post by stalley » Thu Jan 28, 2016 4:05 pm

Hello verschuren,

I am sending an example. It looks at a J1939 parameter, Current Gear, which is one byte. All of the variables, the one event and an activity program are in the ~Demo group. I don't have all of the variables you need, just enough you can see how I would do what you are asking.

Current Gear has an offset of -125, so you will need to transmit 126 or 127 for the counter variables to increment.

This is a config for a PV380, so be sure to change the hardware type to your display type.

Hope this helps!
Attachments
Demo - Occurence Counter.zip
(678.4 KiB) Downloaded 18 times
Sara Talley
Software Engineer
Enovation Controls
verschuren
Posts: 79
Joined: Wed Oct 28, 2015 8:40 am

Re: occurrence counter & memory

Post by verschuren » Fri Jan 29, 2016 9:41 am

Thanks Sara,

This worked out very well. I also store the different counters and keep track of those events.
Mario Verschuren
Controls Integration