Lag and string problems

Recommended Posts

There are two problems I am having that have recently started popping up in DAQfactory:

First off, the lag issue: For some reason the longer DAQfactory runs without being restarted, the more it lags. Upon starting the program, all the values, match those coming in on the com monitor. Within a minute the value displayed for part count(which only increases in increments of 1) will be 1 or 2 behind the data coming in. After hours of running the displayed values will be hundreds behind. This applies to more than just the part count, however the rest are different values and dont increase by 1. If you let the system sit for a few hours even after the presses the system gets data from have shut down, it will eventually catch up, however parts of the data will not have logged. The only possible explanation I could think of was maybe differences in the press clock and computer clock.

Next up is the string issue. The presses in question run parts with job numbers in the AXXXX format. When the presses are set up the settings are stored in a setup file which is simply the job number in the AXXXX format. Sometimes however, they will be doing some special batch and add a note like AXXXXAUG02 or AXXXXD1. The problem is for some reason DAQfactory is limiting this string to the standard length of 5 characters(the last 5), so these special names are displayed(and logged as) just AUG02 or XXXD1.

Link to comment
Share on other sites

The first problem is probably caused by whatever script you are using to poll your devices. It is not executing fast enough to get all the data. The live serial stream is buffered into a rather large buffer. All serial commands work on a buffer, not the live data. If the buffer is being filled faster than you empty it, it will appear that the system is lagging because the data the serial commands are getting are old. The purge() function on the port will clear out the buffer, but of course, any data would be lost and you have to worry about frame alignment issues. I'd instead try querying the device more often.

As for the string issue, this is almost certainly an issue parsing the incoming data. DAQFactory doesn't limit string sizes, so somewhere when you are reading the incoming data you are just reading 5 characters.

For both these issues I'd talk with whoever wrote the protocol to communicate with your devices.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.