LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous Measurement and Logging (NI-DAQmx) CVI equivalent

Hello,

 

Does anybody know if there is a CVI equivalent to the LabVIEW 'Continuous Measurement and Logging (NI-DAQmx)' project template.  I would assume the CVI example would use thread safe queues to accomplish this.

 

Thank you,

0 Kudos
Message 1 of 11
(6,323 Views)

Hi,

 

CVI Has several Continuous Measurement with DAQmx, it's separated by the trigger for start for example:

 

Look in examples > Hardware input output > DAQmx > Analog measurements > Voltage >

 

You have there lots of example and it's very easy to implement.

 

Regarding threads, it's not based on threads.... You can use CVI threading to implement your code, buy if you have a device with buffer why not let him sample ?

 

Just trigger it and when the results are ready fetch them...

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 2 of 11
(6,322 Views)

Thank you Kobi, I have looked at the examples, but may need a design pattern with queues.

 

We need to sample greater than 110 channels at 12Khz rate.   We need to analyze the samples pseudo-real-time for out of tolerance conditions while logging to a file conditionally based on where we are in the process.

 

We could use the DAQmxConfigureLogging to stream directly to TDMS file but our acquisiton could be greater than 100 minutes.  So the data footprint would be large.

 

I just thought maybe the way to go would be to mirror the Continuous Measurement and Logging (NI-DAQmx) LabVIEW example and how it uses queues.

 

 

0 Kudos
Message 3 of 11
(6,316 Views)

A good thig that can help you is EveryNSampleEvent...

 

If you have a lot of data (and you do)...let the device (Whice hardware unit is it by the way ?) to sample in continus mode and each X samples get it to file...

 

you can process the data in the background, it will good to use threds but don't forget to lock the file:)

 

12 Khz it's not that fast rate so this is good, how many sampels per min do you want from each channel ?

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 4 of 11
(6,311 Views)

Yes, I was thinking about using EveryNSampleEvent callback where the callback would write to data queue.

 

Our system uses two PXI-6255 devices.

 

We need to conditionally log data.  For instance, the first and last minute of the 100 minute process.   As mentioned we need to continously evaluate data for failures and log the last 1 minutes worth of data if a failure occurs.

0 Kudos
Message 5 of 11
(6,302 Views)

How many sampels per sec do you need to use ?

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 6 of 11
(6,299 Views)

Do you mean the sample rate?  It is around 12KHz

0 Kudos
Message 7 of 11
(6,295 Views)

Sample rate foramt shuold be like 1000 S/s, 1000 Sampels per Sec

I want to know it so i can know how many sampels the software need to process at a each time.

 

when you say 12 Khz yo mean 12000 sampels per sec ?

 

By the way 6255 dont have Simultaneous Sampling!

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 8 of 11
(6,292 Views)

Yes, 12000 samples per second.  We really don't require simulataneous sampling for our application.

0 Kudos
Message 9 of 11
(6,288 Views)

OK, 12000 it's not a high rate but when handling with data it can be rather big.

 

My advice is try to sample 6 sec (60000) process data and use the clock to see how much time it takes, 

if it's ok that your system will have 6 sec delay in response then you can use it.

 

if you want it on files you can do something really easy:

 

1. choose a dir 

2. sample and put the samples in file (SamX) when X is incremented.

3. another thread will always look for files and process it for events when he finish with a file he deletes it.

 

you can set the amount of data at each file so that is will be faster or slower.

 

I had the same system but with 100,000 samples.

 

do not use ascii ! it's 6X bigger then bin files, TDMS it's a good option.

 

I think you need to try it and measure the time, also if it's 100 analogs that you want to sample it means 100 X 12000.....

 

 

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 10 of 11
(6,283 Views)