Help with increasing scan rate


Recommended Posts

I have am looking to increase the scan rate of my data collection.  not doing data logging and plotting xy of a channel that has a conversion with an A to D channel that uses 2 analog channel with conversions to calculate.  current timing is set at 0.01 for each channel and I am getting C1038 timing lag regularly.  I am running the display on a older laptop windows PC with a labjack T7.  Should I look at streaming the data and then plotting? Is that even possible.

Link to comment
Share on other sites

Do you want to go faster than 0.01?  If so you'll need to stream.  Yes, you can stream and plot without any issue, but streaming does take some extra steps.  Alternatively, at 0.01, you could try accessing the T7 directly through Modbus instead of going through the LabJack driver.  Make sure the modbus registers are consecutive and only query those two.  Of course this will only help if you are connecting over Ethernet instead of USB.  

Link to comment
Share on other sites

hanks this is helpful, still having issues making my system work.  I am using AIN0 through AIN2 for inputs I am using multiple ranges for the AI channels.  The sample file works fine but the script change ranges on the device inputs.  Are AIN0 and AIN1 the only streamable names to use?

 

Link to comment
Share on other sites

No, you can stream whatever the LabJack allows.  You just add to the list in the LJM_eStreamStart command (line 33), and then below in the loop, you replicate the lines to retrieve the data.  So for example, to add AIN2 you would change line 33 to:

LJM_eStreamStart(identifier, {"AIN0", "AIN1","AIN2"}, scanRate, scansPerRead, 1)

and then copy lines 45 and 46 and paste them right after 46, and make some minor mods.  The entire while(1) loop would become:

while(1)
   dataIn = LJM_eStreamRead(identifier)
   data = insertTime(dataIn.data.AIN0, st, 1 / scanRate)
   ChannelA.AddValue(data)  // Needs to match channel defined in "Channels".
   data = insertTime(dataIn.data.AIN1, st, 1 / scanRate)
   ChannelB.addValue(data)  // Needs to match channel defined in "Channels".
   data = insertTime(dataIn.data.AIN2, st, 1 / scanRate)
   ChannelC.addValue(data)  // Needs to match channel defined in "Channels".
   st += scansPerRead / scanRate
   backlog = dataIn.ljmscanBacklog
endwhile

Of course you can change the names "ChannelA", "ChannelB" and "ChannelC" as they are only for DAQFacotry, but the AIN0, AIN1 and AIN2 names are specific to the LabJack.

Link to comment
Share on other sites

  • 2 weeks later...

Yes, the streaming is independent of the range setting, BUT changes in range will affect the maximum scan rate, so it could be that you are trying to stream too fast for the given range.  You'll have to check the LabJack specs on what sort of rates you can achieve at different ranges.  It would also help to know more detail on what "problems" is...

Link to comment
Share on other sites

  • 2 weeks later...

Have converted to an LJtick-Ampin and and using 10V scale to  increase scan rate.  next obstacle is to get conversions on the stream points.  the DF channels dont seem to accomplish this when I apply conversions.  Am i missing something?

Link to comment
Share on other sites

You have to do the conversion before the addvalue().   So, if for example, ChannelA (in my first example) needs to be multiplied by two:

ChannelA.AddValue(data*2)  // Needs to match channel defined in "Channels".

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.