Thanks for the good info there.
Yer' Welcome!
bmacattack33 said:
I realized the problem I was having with trying to use the COP instruction to shift the data was that I wasn't putting the "#" indicator on the source address, so it was just copying the same data across the array, rather than shifting it.
It was likely the direction of the copy, not the lack of index symbols that messed it up.
bmacattack33 said:
This method accomplishes the same thing as the third method I posted above, but it's a lot cleaner. Of course, it does display the chronological order of events horizontally in the PLC data table, rather than vertically, but that's not really a problem, since the HMI is the only place you'd really be looking at the data.
How much free memory do you have in the PLC? Plenty, I am guessing.
Create 6 or 10 new consecutive files and name them LOG_Hour LOG_Min LOG_Code, etc and so forth. Make them all the max size (256 in a SLC)
Here's how I typically craft these type of low level alarms/lists using a circular queue:
How ever many low level parameters there are for the record, make that many (usually integer) files and make them all 256 elements.
You will store the most recent 256 events and associated data and show them as many as you want in whatever order they want.
Heck you can even share the Last_Alarm pointer with the HMI so it could read all the ones it missed and write them to CF even after being disconnected for up to the amount of time it takes to get 255 events.
In the SLC, On commissioning, FLL them all with -1. Don't do that afterward. Don't do anything to the data on powerup or first scan.
Use logic to move as many pointers as you need through the file. One for next alarm which you will paint with -1 each time you get a new Alarm_Last Alarm_Last will always be one position lower than Alarm_Next pointer, but calculate them both once, in one place, and keep them in the range 0-255.
So, your PV+ takes the pointer, and through an expression, paints the alarm fields that are presently requested for viewing on screen with the correct consecutive data. If the PV+ can't do that type of indirection with HMI array tags and some EOF detection for the -1 stripe, then you may have to write a little map routine in the SLC. NO bigge, and its a good exercise. This is actually a good case for a conditional subroutine in a SLC...
Have a couple of pointers also for the range to be displayed. When the range pointer(s) change, run a subroutine that maps them to the tags seen on the screen.
Your pointer, just rolls, and each time it moves, it paints the oldest data with a "stripe" of -1, then paints the new data right behind it. This is easy to identify from a remote and even very intermittent connection to the user/HMI, historian, SCADA, or whatever.
The cool thing about the circular queue, is that you can have a dozen different sets of pointers looking at different ranges of it, without much PLC overhead...no copying unless a limited HMI requires it...just a tad bit extra indirect addressing to have all the numbers you need and more, preserved predictably and reliably right there in the SLC.
Now that I have talked you into doing it that way, you can remap and re-orient the display order on the HMI. Remapping also gives you the discretion to apply filters, sort, range check the time, etc.
On the HMI, you could make the text color animation visibility dependent on != -1
bmacattack33 said:
The problem with using a pointer is that they want a list-type display on the HMI that will show the 10 most recent events in order, so with a wrap-around pointer, once you got over 10 events, the log wouldn't shift, just write over the events at the beginning of the list.
I could just go ahead and add a string array that would load and shift the same way as the timestamp data, unless there's a way that the texts can be stored on the PV+, and loaded into the display table with the appropriate event (and still be retained in event of power loss).
Could you elaborate a little on how you would use the multi-state object w/ integer for the messages?
Thanks again,
Dustin
In FTView Studio, look at the Multistate indicator properties. When the condition is true which can be a value or range of values, the state changes, each one has its own appearances, colors, texts, the whole she-bang. Great place to store text that shouldn't change very often (Alarm names, that is).
Paul