DAQFactory very slow and dropping data


robopp

Recommended Posts

Hi,

We're having an issue with DAQFactory where the UI becomes very sluggish and serial data is being dropped. This is how we've configured DAQFactory for our test:

We're reading data from two devices - a LabJack and serial input data. We're sampling 19 analog LabJackUD channels and 100 serial channels. Each channel has a history of 500,000 points. The serial telemetry data is output by our micro at a 1Hz rate and we're using the following protocol script to push the serial parameters to the channel table:

if (strIn == Chr(13))
   private string datain = ReadUntil(13)
   private string head = Left(datain,6)
   if(head == "+telem")
      
      private string data = Parse(datain, 1, ":")
      
      private string items = parse(data, -1, ",")
  
      private numEntries = NumRows(items)

      // Go through each one and pull off the value
      for (Private.index = 0, index < numEntries, index++)
         Channel.AddValue(strDevice, 1, "Telemetry", index, StrToDouble(items[index]))
      endfor
   endif
endif 

We've defined a total of 8 pages where each page has at least one graph in it and numerous Variable Value display UI element. We are also logging all channel data to a file. When we first start running, all UI elements are being updated and DAQFactory is somewhat responsive, but as our test continues to run DAQFactory starts dropping serial data and becomes very sluggish. A restart every hours or so appears to fix the data dropping issue, but is certainly not ideal since our tests last days. What are we doing wrong, or are we exceeding the capabilities of DAQFactory?

Thank you,

Rob

Link to comment
Share on other sites

I think the serial protocol can't keep up because it has to run the if() on every character and you have a lot of characters.  I would skip using the user protocol and simply have a sequence in your application that polls the data.  The script is very similar.  Let's assume you have a device named "tele", with a NULL protocol and the port corresponding to your serial device.  The sequence script would look like this:

device.tele.purge()
while(1)
   try
      private string datain = device.tele.ReadUntil(13)
      private string head = Left(datain,6)
      if(head == "+telem")      
         private string data = Parse(datain, 1, ":")      
         private string items = parse(data, -1, ",")  
         private numEntries = NumRows(items)
         // Go through each one and pull off the value
         for (Private.index = , index < numEntries, index++)
            Channel.AddValue(strDevice, 1, "Telemetry", index, StrToDouble(items[index]))
         endfor
      endif
   catch()
      ? strLastError
   endcatch
   delay(0.1)
endwhile
                                                   
                                                   
Link to comment
Share on other sites

Archived

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