LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay in Tdms logging

Hi everyone, i have this problem with my TDMS logging that i cant quite figure out, essentially the file path of my TDMS setting will be always one iteration behind. For example, when i run the code and select the file path, my data wont get store in that file path. But once i stop the code and rerun it with a different file path, my data will be saved under the previous file path and not the current file path. The pattern will constantly repeat where my data will be saved to the previous file path instead of the current file path. Does anyone have any idea why this might be? I appreciate any help i can get. Thank you

0 Kudos
Message 1 of 7
(221 Views)

Hi MB,

 


@MBSHIRAZIZ wrote:

i have this problem with my TDMS logging that i cant quite figure out, essentially the file path of my TDMS setting will be always one iteration behind.


That's a typical race condition problem due to not "OBEYING DATAFLOW!"

 

Unfortunately we cannot tell you the exact spot of the problem as you decided to attach no code, but just an image showing irrelevant parts of your code…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 2 of 7
(212 Views)

This is the main display page of the code, im not sure i will be of much help as it is very messy.

0 Kudos
Message 3 of 7
(205 Views)

Hi MB,

 

when you want help for your VI you should downconvert it to some older LabVIEW version (File->Save for previous).

I prefer LV2019…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 4 of 7
(179 Views)

It appears your Init UI Values case is only called at initialization (this is mostly a guess since you did not include any subVIs).  This is where your path is read.  So if you edit the path after it has been read, it will not update everything in the code.  You could add an event case for when the path is edited and then send a message to the UI Message Loop to update the path in the giant cluster.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 7
(168 Views)

Hi crossrulz, thanks for the response, I understand what you are saying and i think you might be right. However, i'm not quite sure how to implement your suggestion to solve the problem. Could you elaborate a little more or show an example?

0 Kudos
Message 6 of 7
(141 Views)

@MBSHIRAZIZ wrote:

Hi crossrulz, thanks for the response, I understand what you are saying and i think you might be right. However, i'm not quite sure how to implement your suggestion to solve the problem. Could you elaborate a little more or show an example?


Add an event case to your Event Structure for the path control's Value Changed event.  In that case, you send a message to the UI Handling loop to update the path.  In the new case for the UI Handling loop, you can just read the control's terminal and update the state cluster with the new path.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 7
(111 Views)