06-30-2022 04:00 AM
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
06-30-2022 04:22 AM - edited 06-30-2022 04:24 AM
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…
06-30-2022 04:28 AM
This is the main display page of the code, im not sure i will be of much help as it is very messy.
06-30-2022 07:19 AM
06-30-2022 08:41 AM
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.
07-01-2022 01:47 AM
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?
07-02-2022 12:12 PM
@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.