From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

session handle lost

Hi

I attach the screenshot where the instruments are initialized and (in example), the vi where the DMM is controlled. The DMM is one of the instruments that used to lost the session.... but it happens randomly.... I mean, I can not find a patrol that generates this error....

Any clue?

Download All
0 Kudos
Message 11 of 18
(2,512 Views)
Try using the error in/out connections to sequence the initialization of all of the instruments.
0 Kudos
Message 12 of 18
(2,499 Views)

I did it, but the message does not give me too much info. 

I attach a screenshot of the last one.

0 Kudos
Message 13 of 18
(2,493 Views)

Hi,

this error occurs when the name od the device you are using in LV does not match with the name in the MAX.

I recomend you to reconfigure your device!

 

Kudos are Welcome 😉

0 Kudos
Message 14 of 18
(2,475 Views)
You are using local and global variables a lot as well as the stacked sequence structure. None of that is proper style and good design. You can easily be losing the handles because of that. I would suggest using a shift register that holds the references and an unbundle by name in the cases where you need them. A state machine should replace the stacked sequence structure. The stacked sequence structure has even been removed from the palette in current versions of LabVIEW.
0 Kudos
Message 15 of 18
(2,464 Views)

Hi!

could you show me an example of  "a shift register that holds the references and an unbundle by name in the cases where you need them"

Also about the state machine. 

 

I have check the code, and I think that I only initialize the session handle at the beginning of the process, so I son't know where can be a conflic between local and global variables... any idea?

 

All the best and thank you very much for your help!!

0 Kudos
Message 16 of 18
(2,445 Views)
You are already bundling the references. You just needed to make this into a shift register instead writing to a local. There are state machine examples provided. You can also select File>New.. and browse the provided templates.
Message 17 of 18
(2,439 Views)

Hi,

 

Just found this thread when I was about to post my question.

I am operating the TDK power supply thorugh labview using ivi drivers.

I am also facing same issue. Sometimes I am facing the error "Session handle is not valid: .This error comes randomly so I am unable to track the root cause.

Logical name given in the VI is exactly same as mentioned in MAX. Also power supply is connected over LAN to test system.

My code is also not so complex. its a single VI weherin i am setting voltage and current after initialize with options .vi

 

Not able to understand the cause of this error.

Does it affect when we remove LAN connections of the power supply from a network and then reconnect it?

0 Kudos
Message 18 of 18
(2,342 Views)