LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timing for VISA Measurement Device

I am working with a Anemometer and was reading the data from it through LabView. I have the program completely configured but i am having problems with the time instants at which a measurement is made from my device and stored in a excel sheet. The current data recorded on excel sheet is random and there are 4 measurements in a second and sometimes there are no measurements for 2 or 3 seconds. I want to configure my device so that a reading is noted in the excel only at one second intervals. I tried using 'elapsed time' module and set it 1 second before giving the signal to 'write to file' but for that no measurements were recorded in the excel file.

0 Kudos
Message 1 of 6
(1,530 Views)

Hi Ahraar,

 


@Ahraar wrote:

The current data recorded on excel sheet is random and there are 4 measurements in a second and sometimes there are no measurements for 2 or 3 seconds. I want to configure my device so that a reading is noted in the excel only at one second intervals.


A big problem: you are using the WriteMeasurementFile ExpressVI to write to a XLSX file! This will take longer than you might expect!

A better solution would be to write to a simple CSV file, which is opened once before the loop and closed once after the loop…

 

When you want to write to the file once per second you might write each 4th iteration of the loop: use Q&R (quotient&remainder) on the loop counter to check for each 4th iteration and place the FileWrite function inside a case structure…

 

Btw. cleaning up the block diagram will help you and others to understand the code better/easier:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(1,517 Views)

How do i save it to CSV file. In the properties of my 'Write to Measurement file' module, i can select .tdms , .xlsx , .lvm options for file formats. Can you also please describe something about how to use the Q and R inside the case structure to record the measurements every one second

0 Kudos
Message 3 of 6
(1,482 Views)

Hi Ahraar,

 


@Ahraar wrote:

How do i save it to CSV file. In the properties of my 'Write to Measurement file' module, i can select .tdms , .xlsx , .lvm options for file formats.


Use WriteTextFile with FileOpen/-Close before/after the loop. No need for ExpressVIs!

 


@Ahraar wrote:

Can you also please describe something about how to use the Q and R inside the case structure to record the measurements every one second


Do you know about modulo division? "i modulo 4 == 0" every 4th iteration of the loop…

(Read the help for the Quotient&Remainder function!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(1,478 Views)

I don't know how to implement the file open and file close loops. What module do i need to wire my signal then to store the data to a file? I can configure express vi. 

Can you maybe provide a link wherein i can learn about this, maybe a labview course.

 

0 Kudos
Message 5 of 6
(1,472 Views)

Hi Ahrar,

 


@Ahraar wrote:

Can you maybe provide a link wherein i can learn about this, maybe a labview course.


There are"Training resources" at the top of the LabVIEW board.

And there are lots of examples in the LabVIEW example library!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(1,470 Views)