LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Variables & LVOOP bug

I have not be able to create a (simple) VI to generate the error, but sometimes I have an error 91 or -1967362020 when I try to read a shared variable from inside a LVOOP class method.
I don't think that the bus is in my code because the error 91 description is "The data type of the variant is not compatible with the data type wired to the type input." and I do not use "variant to data", just read from a shared variable. And the error -1967362020 description is "The provided refnum is invalid." and I do not know what it has to do with shared variables.
The erros appear just after the shared variable node.
0 Kudos
Message 1 of 4
(2,609 Views)
The Network-Published Shared Variable does a conversion to variant when writing to the variable, and a conversion from variant when reading from the variable.  This can result in an error 91 if the data in the variable is not of the right type.  I have seen error 91 when "Bind To Source" is enabled in the Shared Variable Properties, and the Variable is configured to be a different data type than the source.  There is a CAR indicating that the Shared Variable should report a better error code when this happens (CAR #3TUDI2NM).  Does your variable have "Bind To Source" enabled in the properties?

I'm not sure what would cause the other error that you are seeing.  Could you please post some code that reproduces this issue?

-Chris
0 Kudos
Message 2 of 4
(2,566 Views)
I do not use the "bind to source" property. It is a network-published shared variable used only with the shared variable node.
I have not be able to create a simple code to reproduce the error, but I have the error only if the variable is used inside a LVOOP dynamic method (but not always).
One more thing: I use the dynamic VIs inside a VI that runs and stops many times, and I run it by using the "Run VI" method with the "wait until done" to FALSE. I do not know if this can affect shared variables, but the first time that I run the VI I NEVER get the error and the second time almost always I get the error. I also tried to use autodeploy and manual deploy, but the behavior does not change.

0 Kudos
Message 3 of 4
(2,555 Views)
As of Feb 6, 2007, there are no known issues with using a shared variable on the block diagram of a VI that is part of a LabVIEW class. Given that VIs in classes -- even those that are invoked through dynamic dispatching -- are the same as any other VI when they are running, it is unlikely that any bug in shared variables exists which is specific to LVClasses.
0 Kudos
Message 4 of 4
(2,459 Views)