NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Checking the last iteration of the fileglobal value

Hello.

 

I have a subsequence in a new thread and an action VI. This action VI can change the fileglobal value (read and write) which the subsequence would then act on this fileglobal value. However, it is very prone to data overflow/buffering errors.

 

One way is to check if the fileglobal value has changed for every iteration before the subsequence can be called. How do I do this and is there any other way to optimise this process? The fileglobal values changes very fast (like 0.1s).

0 Kudos
Message 1 of 5
(856 Views)

Can you please  specify a use case / a user story?

Understanding what you are actually trying to achieve greatly helps finding a solution 😊

0 Kudos
Message 2 of 5
(831 Views)

A use case would be let's say the fileglobals is a value like 25, I have a subvi which can adjust the fileglobals from 25 to 5. I can choose to stop at any value from 5 to 25. The subsequence (in a new thread) will then do an action according to the current fileglobal value. However, since the fileglobals value are send very quickly, it will cause a data overflow error.

0 Kudos
Message 3 of 5
(817 Views)

My understanding is that you are trying to exchange data between two threads with the producer (the VI) writing data into a the FileGlobal variable in one thread and the Producer (the subsequence) consuming the data and executing stuff according to the actual value of the FileGlobal.

 

You are describing the occurence of a data overflow error. How does this manifest itself? Is there a runtime error? Is there any looping involved?

Can you possibly provide a stripped down version of your code?

0 Kudos
Message 4 of 5
(804 Views)

I cannot provide the code unfortunately. But I have reduced the occurrence by assigning the fileglobal.a to a locals.b, then adding a precondition to the action that locals.b!=fileglobal.a. That way, the action would only activate if there is any change in the fileglobal.

 

However, I will add another action in which the fileglobal can be tuned more finely. I will ask this in a separate thread.

0 Kudos
Message 5 of 5
(793 Views)