NickB Posted December 20, 2022 Share Posted December 20, 2022 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. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted December 21, 2022 Share Posted December 21, 2022 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. Quote Link to comment Share on other sites More sharing options...
NickB Posted December 22, 2022 Author Share Posted December 22, 2022 Where can I find guidance on setting up a streaming sequence? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted December 22, 2022 Share Posted December 22, 2022 LabJack actually has a nice intro page here for using T series devices with DAQFactory: https://labjack.com/pages/support/software/?doc=/software-driver/example-codewrappers/daqfactory-for-ljm-windows/ It includes a sample app for doing streaming. Quote Link to comment Share on other sites More sharing options...
NickB Posted December 22, 2022 Author Share Posted December 22, 2022 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? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted December 23, 2022 Share Posted December 23, 2022 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. Quote Link to comment Share on other sites More sharing options...
NickB Posted January 6, 2023 Author Share Posted January 6, 2023 I am having problems with streaming a value from a load cell. I am using a low voltage range for this channel. Can I stream with low voltage? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted January 6, 2023 Share Posted January 6, 2023 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... Quote Link to comment Share on other sites More sharing options...
NickB Posted January 15, 2023 Author Share Posted January 15, 2023 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? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted January 15, 2023 Share Posted January 15, 2023 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". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.