cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Ensuring tags are updated for datalogger

AK_11656070
3-Newcomer

Ensuring tags are updated for datalogger

I am using the datalogger in KEPServerEx 6.16 to store "frames" of data to SQL. Things like recipes and test results, where I have a single set of data that I want inserted all at once.

 

I have  a way set up that works pretty well. I stage the data to be sent in a buffer in the plc, set the datalog trigger to start and stop on a specific tag and to log all items on starts, and when the data is ready, I activate that trigger and read back the msg_count incrementing as an acknowledge it was sent to reset the trigger and stage the next data.

 

I found that every once in a while, I would get a null or double entry in my database doing this method. I did some experimenting, and what I believe is the cause is occasionally the trigger would be read before all the data had. The trigger is set to update every second while the log data is only every 100ms, so in theory that shouldn't happen.

 

I seemed to have fixed it for now by simply adding a timer delay between staging the data and activating the trigger, but I'm not sure that is robust. It doesn't actually prevent the data error from happening if the data updates extra slowly for some reason, and while it's not a concern right now, it artificially limits how quickly I can actually send the data out.

 

Because of this, I'm wondering if there is a better way to accomplish this, e.g. a comparison that all the data tags last updated timestamp is greater than the time the trigger tag became high, or causing an async read that has to finish before logging the data.

 

Has anyone dealt with situations like this or have any suggestions?

We do have the advanced tags addon, though it didn't seem to be able to do much with timestamps.

 

Thanks.

0 REPLIES 0
Announcements


Top Tags