LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need guidance in data reading part of code

Hasham622x_0-1732849443908.png

Hi,

 

Apologies for the disturbance, but I am encountering an issue that I need your guidance on.

The data I am obtaining from the code seems to reflect real measurements; however, the presence of a red dot raises concerns that there might be an error in my implementation, potentially affecting the accuracy of the data.

Could you please assist me in verifying whether the data is correct? I have also attached the code in the LV19 version for your reference.

Thank you for your time and assistance.

 

Kind regards 

Hasham

0 Kudos
Message 1 of 6
(126 Views)

If you're looking to just log data from DAQ, FlexLogger lite will be a simpler and easier approach. After logging to TDMS, you can read the TDMS in LabVIEW for advanced analysis or processing.

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 6
(117 Views)

Hi Hasham,

 

when you want to save the measurement data to a file you could enable the TDMS logging in the DAQmx task.

You will get a TDMS file without any (additional) programming needed…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 6
(89 Views)

A red dot just means that the wired input is not what the function is able to accept directly and LabVIEW will make some reasonable assumptions to keep the code unbroken. It is up to you to decide if the coerced behavior is acceptable for you specific case.

 

Your current file write function accepts 1D and 2D arrays and definitely not waveforms! A waveform data is a structure consisting of two scalars (t0 and dt) and a 1D Y data array.  With every iteration of your loop, t0 (?) and the data will probably change while dt remains constant.

 

As a first step, you need to decide how your delimited text file should look like (Unless you want to do some of the fancier file types suggested by others). One reasonable choice would be two columns, one with time and one with Y data. Here is one possible way to convert your waveform to a 2D array with a time and data column that will be accepted by the file IO you are using.

 

altenbach_0-1732905696121.png

 

Writing a simple delimited file might be more useful, depending on what you plan to do with it later (e.g. Import into excel, read with third party software, etc.)

 

 

Message 4 of 6
(69 Views)

Hi,

 

Thank you for your reply. I switched to 2D, which resolved the red dot issue; however, I started receiving two samples per trigger signal instead of the required one sample per trigger. To address this, I switched back to 1D, but the red dot reappeared.

 

Kind regards

 

Hasham

0 Kudos
Message 5 of 6
(41 Views)

@Hasham622x wrote:

Thank you for your reply. I switched to 2D, which resolved the red dot issue; however, I started receiving two samples per trigger signal instead of the required one sample per trigger. To address this, I switched back to 1D, but the red dot reappeared.


A waveform is not the same as a 1D array, so you did not "switch back", because you originally never had a 1D array. The file IO has inputs for 1D and 2D arrays and as long as you use the appropriate input, you should be OK.

 

If you don't care about the time column, you could just get the Y data from the waveform and append to a single column. We cannot guess what you really want at the end.

 

If you get an unexpected number of values, that needs to be solved upstream. fiddling with datatypes at the end is a Band-Aid solution. The primary goal is correct functionality, not making red dots disappear!

Message 6 of 6
(31 Views)