Jump to content

Variable: ASCII String Refreshing


Recommended Posts

I am developing my own event log display. I am reading a string from a data table and then displaying it using the ASCII String variable. I am doing this sequentially using the same vector of 30 MI's for 20 rows. I am doing it this way so I don't have to use 600 MI's (30 x 20) to hold the required data for the full display.

eventlogdisplay.png

If i have the keypad entry box ticked in the ASCII String variable everything works perfectly. However, if I un-tick the the box the variable keeps updating automatically. This overwrites my messages with whatever is in the last message. This is not helpful because I don't want the keypad entry.

What is the purpose of the Linked MB when the keypad entry is not ticked? It seems to me it has no use if the variable is update automatically?

Does anyone know of a work around to either disable the keypad entry or the automatic updating? Does anyone know of a better way to achieve the same thing?

The messages are generated dynamically based on several pieces of data so I can't use the string library.

Link to comment
Share on other sites

I don't know if it is just me, but I am having a really hard time trying to visualize what it is you are doing. I get that it is an on screen event log and that it is twenty log items you want to show on screen. I assume this is some sort of time stamped event that you want a user to be able to look up to see what event/alarm/shutdown occured at whit time and date.

If it is what I think you are trying to do. How I handle this is to have all of the vital data that I want recorded on an event stored into a data table. When the next event needs to be recorded I copy the entire data table down one row and then load the data for the new event on the first row of the data table. I then have a screen where I can see all of the historical events by loading the data from the table where the first row is the newest and the last row is th3e latest. By doing it this way I can record and show alarm/shutdown/event history for up to 1000 time stamped events. (I show as many as I can on one screen then use a page up/page down button structure to move forward or backwards in the event log).

I apologize if this has nothing to do with what you want to do, but like I said I am having dificulty determining exactly what it is you want to do.

Keith

  • Upvote 1
Link to comment
Share on other sites

Hi Keith

Thanks for your reply. I am often not very good at explaining things, so I will try again.

I am doing exactly what you have explained. The issue I have is that the event message is stored in the data table as a string of up to 60 characters. This string is created by assembly several bits of information before it is written to the data table. When the one message is read from the data table it occupies 30 MI's. If I have 20 of these messages display at a time this will occupy 600 MI's.

This seems like a waste of resources to me. So to overcome this I am loading the 1st message into a vector of 30 MI's and then setting the Link MB of the 1st message on the HMI page. The OS then refreshes the display and resets the Link MB. I then load the 2nd message into the same vector of 30 MI's and set the Link MB of the 2nd message on the HMI page. The OS then refreshes the display and resets the Link MB. The process repeats for the full 20 messages. Doing it this way means I am only using 30 MI's instead of 600.

eventlogdisplay2.png

As explained in my first post, this works well when I have the Keypad Entry boxed checked but not when it isn't.

Cheers,

Justin

Link to comment
Share on other sites

  • External Moderators

I did something similiar to what you describe here: http://forum.unitronics.com/index.php?/blog/16/entry-44-simple-alarm-module/page__mode__show

I'm not sure about the variable data, I've not tried that, but if you can insert the data directly into the string, you don't need any MI at all, just an array of DW holding the index of the string. Might be worth a look.

Best of Luck!

TM

Link to comment
Share on other sites

Hi TM

Yes I used your alarm module in my last project and it worked great so thanks very much for sharing. The down side of this approach is that the alarms must be static (e.g. predefined in the string library). This was not an issue for my last project and the vector of alarm bits was also a good fit.

However my current project is a bit different. The event log I am developing is more for information purposes rather than a set number of fault conditions. The log is displayed on a master PLC that has up to 20 slaves that look after up to 1000 animals. There are several different event types that have different numbers and types of associated variables. I could put all these variables into different columns in the event log (and indeed this is the case with the date stamp), but then some of these columns would be empty and the result is an untidy looking page. I could create several different log types but that's not very user friendly. I have chosen to assemble a string based in the received data and store in a data table. As far as i know you can't store data into the string library like this.

It's sounds complicated but its not really. I'm storing events into a data table in 7 nets of code and displaying them on the event log page in 6 nets so far.

Thanks,

Justin

Link to comment
Share on other sites

Once, i was trying to do exactly the same and it did not worked.

Seems to me, the OS refreshing display strings to linked operands once per second regardless of "refresh bit".

That's mean the only way to make a grid is to allocate (in you case) 600 MI's or 300ML's for display variables. Use MI2010 [60] array as a buffer and use "copy vector with offset" for corresponding rows. You can do it easy in a loop, so all your grid will be refreshed instantly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.