LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI-2566 Relay Card Timing Question

The attached VI demonstrates a timing question I have about this card.  I am trying to write a sub VI that I can call to pass open and close commands with delays to selected relays.  This test VI does that effectively, but introduces unwated ADDITIONAL delays, apparently because of the Initialize Topology VI.  How can I avoid having to Initialize more than once at the start?  Is there another way to pass the instrument handles to the open and close VIs without the need for the Initialize Topology VI?  I will need to call my sub VI often  to change relay positions and delays and can' have the time added to reinitialize.  Thank you.
0 Kudos
Message 1 of 5
(3,138 Views)
Take a look at an action engine.
 
This would allow you to call the subVI early in the program with an Initialize action.  The Initialize case would run the NI switch part of the code and store the reference coming out in the uninitialized shift register.  When you call the subVI later, you would use another case that uses the stored reference to execute the other portions of the code.
 
Where this could get a little tricky is if you are using this code to handle multiple references.  In that case, you may need to set your references to be an array where you use an index value to initialize and retrieve the appropriate reference out of the array for the code.
0 Kudos
Message 2 of 5
(3,129 Views)
The good news is that this technique does eliminate the start delay!  The bad news is that the new VI  now returns a session handle invalid error.....  Maybe I didn't get it quite right?  Is there an "easier" way? 

Thanks for the suggestion and your help.
Download All
0 Kudos
Message 3 of 5
(3,116 Views)
What you have should be a subVI.  It would be run from a main VI.  The stop button should be a true constant.
 
See attached.
Download All
0 Kudos
Message 4 of 5
(3,105 Views)
PERFECT,  thank you very much for your PROMPT help!!
0 Kudos
Message 5 of 5
(3,100 Views)