LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1 Configuration VIs while Passing Refnum through Shift Register on Mac

Solved!
Go to solution

I am just trying to understand, so the reference becomes invalid if the calling VI becomes idle eventhough the VIs are still loaded in memory?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 11 of 16
(737 Views)

P@Anand wrote:

I am just trying to understand, so the reference becomes invalid if the calling VI becomes idle eventhough the VIs are still loaded in memory?


Yep.  When the full call chain is idle, the references become invalid.


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
0 Kudos
Message 12 of 16
(724 Views)

Thats a new learning for me, till now I was assuming that as long as the VI is in memory the reference will be valid. In that case what will be the output of the 1st call primitive? Will that be True?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 13 of 16
(722 Views)

Thank you Crossrulz,

 

Today I learned new concept.

 

Just to correct myself, If I initialized properly then it will executes properly (if File exists) but how can I get the next states (like read/write/close) without state machine.

As you told, if it is not about next states (State machine) then please ignore this.

Munna
0 Kudos
Message 14 of 16
(709 Views)

As Tim already mentioned (and directed) you need to use the AE without a shift register for the states. So you have to call the AE (ini read sub VI) in individual instances to Open, Read, Write and Close seperately.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 15 of 16
(699 Views)

Well, in fact, LV is keeping the memory for the VI as well as the data stored in there. The point is, that the runtime engine obviously frees the resources which are attached to that handle.

As an example (i dont know if this really is comparable, but it is a good 'comparison' for understanding):

You open a session to a serial port (RS232). VISA will request the interface from the OS (as serial ports must be used by 0 or 1 processes at a time, not more). So the OS will lock the RS232 interface for THIS process.

The VISA layer will return a handle to the session to LV which is stored in the wire. Even if LV keeps that handle, it doesn't mean that the VISA layer has to hold the session. So VISA can return the interface to the OS (free).

 

So even if your VI still has some "valid appearing" handle to the RS232 port, you would receive an error trying to access it unless VISA re-allocates the session using this handle for you.

Yeah, that's some of the weirdness having layered applications. On the other hand, with this approach, resources can be handled in a much more effective way by the drivers/OS.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 16 of 16
(685 Views)