LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared & user-defined variable behavior when they are passed an error?

Solved!
Go to solution

If a [TRUE] error condition is preset at its input terminal:

  • What is the expected behavior for a shared variable which is being read?             My guess: To return the default value for the datatype being read.
  • What is the expected behavior for a user-defined variable which is being read?     My guess: To return the default value for the datatype being read.
  • What is the expected behavior for a shared variable which is being written?         My guess: To not update the value of the variable.
  • What is the expected behavior for a user-defined variable which is being written? My guess: To not update the value of the variable.

Are my guesses at the behavior correct?  If not, what is the real behavior?  This is for LabVIEW version 11 and newer.

 

Thanks!

0 Kudos
Message 1 of 3
(2,207 Views)
Solution
Accepted by topic author WNM

Hi WNM,

 

I made a sample vi and tested this condition with a shared variable and your above guesses correct.  With shared and user-defined variables the default data type is returned when it is read and the last value that was written to the shared variable is maintained when writing to it (when the error input to the variable is TRUE).

 

Regards

Arham H
Applications Engineer
National Instruments
Message 2 of 3
(2,173 Views)

Thank you Arham!   I'm sorry you had to go to the trouble of creating a test VI to get the answer. I thought that this might have been documented somewhere and I was just missing it. It still may be documented somewhere but sometimes creating a test VI is the quicker path to an answer than is a search for where the documentation is stored and the test VI is probably the more conclusive answer anyway.

 

In any case, thanks to your answer, it is now documented in a manner that should not be too hard for others to find, should they have the same question.

 

Thanks again.

0 Kudos
Message 3 of 3
(2,157 Views)