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
occurrence counter & memory
- verschuren
- Posts: 79
- Joined: Wed Oct 28, 2015 8:40 am
occurrence counter & memory
Mario Verschuren
Controls Integration
Controls Integration
- stalley
- Enovation Controls Development
- Posts: 618
- Joined: Tue Mar 18, 2014 12:57 pm
Re: occurrence counter & memory
Hi Mario,
All of the variables in Programming have a Fire on change event. You can use it to do what you need.
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.
Sara Talley
Software Engineer
Enovation Controls
Software Engineer
Enovation Controls
- verschuren
- Posts: 79
- Joined: Wed Oct 28, 2015 8:40 am
Re: occurrence counter & memory
Thanks Sara,
I will try this out and let you know.
I will try this out and let you know.
Mario Verschuren
Controls Integration
Controls Integration
- verschuren
- Posts: 79
- Joined: Wed Oct 28, 2015 8:40 am
Re: occurrence counter & memory
Hi Sara,
Could you give me an example? That would help out a lot.
Could you give me an example? That would help out a lot.
Mario Verschuren
Controls Integration
Controls Integration
- stalley
- Enovation Controls Development
- Posts: 618
- Joined: Tue Mar 18, 2014 12:57 pm
Re: occurrence counter & memory
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!
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
Software Engineer
Enovation Controls
- verschuren
- Posts: 79
- Joined: Wed Oct 28, 2015 8:40 am
Re: occurrence counter & memory
Thanks Sara,
This worked out very well. I also store the different counters and keep track of those events.
This worked out very well. I also store the different counters and keep track of those events.
Mario Verschuren
Controls Integration
Controls Integration