LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI about TDMS created by labview2017 and works, but not works in labview2018

Solved!
Go to solution

I created a VI about TDMS (picture as attached) by labview2017 and it works, but it doesn't work in labview2018 and error information is invalid TDMS file reference in pop-up (picture as attached). Could you please share why it happens? And how to solve it? Thanks a lot in advance!

1DF38BEF-EE62-47b4-9438-986A11EB7B0E.png

IMG_20230912_094807.jpg

0 Kudos
Message 1 of 6
(640 Views)
Solution
Accepted by Jack2023

The error occurs at TDMS Close. When you run the VI for the first time, the TDMS refnum has not been created hence it is invalid. You can add a Boolean logic to check if the refnum is valid before attempting to close it.

ZYOng_0-1694522549537.png

 

The reason why you are seeing a different error behavior in 2017 is most likely because you have automatically error handling enabled in 2018 but not in 2017. See Prevent LabVIEW Error Dialog Box

-------------------------------------------------------
Control Lead | Intelline Inc
Message 2 of 6
(584 Views)

Thanks a lot for your kindly sharing. It works. But same problem on IIR digital filter (works in labview2017, but not works in labview2018). Error message (picture as attached) metions that filter settings don't meet the rule, and the rule is 0 <f_low(low cut off frequency)<=f_high(high cut off frequency)<=fs/2(sampling frequency), but the current settings meet this rule(f_low=2.1Hz; f_high=200Hz; fs=1000Hz, and picture as attached). Could you please share why it happens? how to solve it? Thank you very much in advance!

9747713A-C586-4a0c-AD08-076CC3E20650.png

IMG_20230914_094013.jpg

0 Kudos
Message 3 of 6
(540 Views)

Hi Jack,

 


@Jack2023 wrote:

But same problem on IIR digital filter (works in labview2017, but not works in labview2018). Error message (picture as attached) metions that filter settings don't meet the rule,


The problem is the same: your code is buggy as it doesn't implement any serious error handling!

The "quick and dirty" solution is the same as with your previous problem: switch off automatic error handling…

 

The better solution would be to implement error handling - it doesn't make sense to apply a filter on a signal when it does not obey Mr. Nyquist.

 


@Jack2023 wrote:

the rule is 0 <f_low(low cut off frequency)<=f_high(high cut off frequency)<=fs/2(sampling frequency), but the current settings meet this rule(f_low=2.1Hz; f_high=200Hz; fs=1000Hz, and picture as attached). Could you please share why it happens?


Two simple options: Either the filter settings are wrong - or your signal is not as expected…

Best regards,
GerdW


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

Hi GerdW,

   Thanks a lot for your kindly sharing in midnight.

   It seems there is other root cause for this filter issue. The first reason is that this filter settings as showed in the picture obey Mr. Nyquist; The second reason is that the issue also happens even if the signal is from analog acquisition card created by NI MAX.

   For automatic error handling, I find it's on in both labview2018 and labview2017, but the VI works in labview2017 but not works in labview2018. It's strange for me. However, ZYOng's VI solved TDMS Close issue. 

0 Kudos
Message 5 of 6
(515 Views)

Hi Jack,

 


@Jack2023 wrote:

Hi GerdW,

   Thanks a lot for your kindly sharing in midnight.


You know this is a worldwide forum: for me it's (late) morning…

 


@Jack2023 wrote:

   It seems there is other root cause for this filter issue. The first reason is that this filter settings as showed in the picture obey Mr. Nyquist; The second reason is that the issue also happens even if the signal is from analog acquisition card created by NI MAX.


So what is the frequency of the input signal? Did you probe it?

How many samples does the waveform contain? Did you probe it?

 

When there are error messages then you need to debug your VI! (You may also test the filter function with known good input data…)

Best regards,
GerdW


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