T7 sample rate on Labview | LabJack
 

T7 sample rate on Labview

9 posts / 0 new
Last post
manuel aiello
manuel aiello's picture
T7 sample rate on Labview

Hi, first of all i wanted to say that i am new to labjack and labview.

I'm trying to build a visual interface in labview to control and acquire data from solid rocket motor tests for a project. I need to acquire pressure,temperature and thrust and i'm currently using 3 thermocouples, 1 load cell (connected to a LJTick-InAmp) and a pressure transducer (with a output of 0-10V ) and my Labjack T7 is connected with direct ethernet to my computer.

The problem is that i wanted to have a sample rate of 1Khz (at least for load cell and pressure transducer) and save data to a .txt file with that speed. Obviously what i'm doing is not working well because even changing resolution index to 1 and lowering settling time i'm not getting what i expected (i get something like 100ms between two readings on the saved file) and i don't understand if there's somethig i'm missing both on Labjack  or Labview side.

So my questions are:

1) Is command/response the rigth way to achive that sample rate?;

2) I've attached the Vi that i've made modifing a basic example, are there any big problems that i'm missing?

 

I'm sorry if i did't include all the necessary information, but let me know what i have to add to meke things more clear.

thank you.

File Attachment: 
LabJack Support
labjack support's picture
To sample at 1kHz you should

To sample at 1kHz you should use stream mode acquisition. We do not expect 1kHz sample rates to be possible via command response and command response is prone to occasional jumps in communication overhead such as what you are likely seeing with the 100ms delays. I would recommend seeing our Stream_Basic examples from the LJM LabVIEW example package as a starting point.

manuel aiello
manuel aiello's picture
But is there a way to have

But is there a way to have each value acquired during stream with his on timestamp when writing on file?

manuel aiello
manuel aiello's picture
But is there a way to have

But is there a way to have each data with it's own timestam? Because i'm trying to save streamed data for the load cell in a .txt file on labview and i get confused data (that are actually rigth values) arranged in strange manner (i don't have two column of data, one for time end one for thrust).

LabJack Support
labjack support's picture
With stream mode you have a

With stream mode you have a relative timestamp inherent to the acquisition since the sampling is hardware timed. For example, if you sample at 1kHz you know that a scan (containing a sample from each channel in your scan list) occurs every 1/1000 seconds after starting stream. To translate the relative timestamp to calendar time you only need to get the calendar timestamp at the start of stream. We have some relevant information in our stream docs:

https://labjack.com/support/datasheets/t-series/communication/stream-mod...

Stream data is returned channel interleaved per scan. If you sample two channels and look at the first three scans worth of data you would see [channel1, channel2, channel1,channel2, channel1, channel2]. We have a VI under the LJStreamM source called "LJStreamM add data to file.vi" that could work as a reference for data formatting and file IO in LabVIEW if you only look at the logic in the case structure where "disable scaling" is true.

manuel aiello
manuel aiello's picture
Thank you very much for the

Thank you very much for the quick response;

I was tryin to understand the examples you told me and a was also trying to see if   LJStreamM.vi could do what i wanted and in fact it does (it saves data exactly as i want on a file).

What i don't understand is why only readiang 4 AINs channels with a scan rate of 500 Hz gives me this error:

LabJack Error #2942:  STREAM_SCAN_OVERLAP occurred at LJM_eStreamRead2D.vi

so from my understanding a new scan is starting before the previus is terminated, but the configuration (attached below in .txt extension because i couldn't upload it in .cfg) that i'm using should be to scan at higher scan rate the 4 AINs. the only thing i can think of is that the range of channels is not properly set (in the configuration each AIN is set to RANGE = 0) but if i change the configuration settings in the file and then i try to load it at the beginning of the Vi the range in not updated.

what could be the problem or what i'm i missing?

i'm asking because although this example looks really complex to me, it does exactly the type of logging that i want that is the format in the data0.txt file, but for now i can only do it with one channel. 

 

File Attachment: 
LabJack Support
labjack support's picture
First, please note that we

First, please note that we also distribute LJStreamM as an executable included in our LJM installer package, so you do not need to go into LabVIEW unless you are planning to make modifications to LJStreamM:

https://labjack.com/support/software/applications/t-series/ljstreamm

Resolution and settling are not actually controllable in LJStreamM without additional modification to set these stream configs up somewhere. Their existence in the config file is a relic from our older LJStreamUD program; the config files are not intended for direct modification.

Your scan overlap error code indicates your channel settings are not valid under stream mode. Please see table A.1.7 on our data rates page for supported settings:

https://labjack.com/support/datasheets/t-series/appendix-a-1#t7-stream-r...

The stream config registers and AIN_RANGE register are described in greater detail on our stream and AIN pages respectively:

https://labjack.com/support/datasheets/t-series/communication/stream-mod...

https://labjack.com/support/datasheets/t-series/ain#range

manuel aiello
manuel aiello's picture
Hi, is there any example on

Hi, is there any example on how to save data from labjack device to a spreadsheet in labview

LabJack Support
labjack support's picture
No, we do not have any

No, we do not have any examples that write to spreadsheet files.

LJLogM and LJStreamM both write tab delimited ASCII files that can be imported into spreadsheet software. More generally, LabVIEW supports some VIs to write to spreadsheet files:

https://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/writing_to_s...