LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1074130544 Session Handle is not Valid goes away in Highlight Execution

Solved!
Go to solution

I'm trying to use 2 PXI-4312 SMUs in a VI using the niDCPower drivers. When I try to run the VI normally, both SMUs show the following error: "niDCPower Configure Output Enabled.vi<ERR>IVI: (Hex 0xBFFA1190) The session handle is not valid"

 

However, when I run the VI with Highlight Execution selected, it runs without any errors. If I wait the first 3 cases in the case structure execute and then turn off highlight execution, it will also run without errors.

 

Does anyone have any suggestions on how to debug this?

 

I have attached the VI. I am using LabVIEW 2019

0 Kudos
Message 1 of 3
(1,815 Views)
Solution
Accepted by topic author Phteven_722

Local Variables!  You don't need them.  Use Wires instead.

 

What is happening here is you have a race condition between when the loop gets to the first time it reads the resource variable to when your initialization completes and writes the local variable.  As GerdW will state: THINK DATAFLOW!  Use wires to pass your data around.


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 2 of 3
(1,802 Views)

That solved it. Thanks

0 Kudos
Message 3 of 3
(1,795 Views)