LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

releasing visa resources

Solved!
Go to solution

hey guys,

how can i release a visa connection without stoping the vi?

the whole vi is in the loop to trap any event from boolean controls. one of the boolean control is to stop

visa connection to release the connection on whatever connected to that visa resources. take note, the whole structure didnt use event structure, it uses a loop.

i am using the visa close vi (from ni lv) to close the connection. 

but its not working, it didnt release the connection.

 

 

 

0 Kudos
Message 1 of 9
(4,807 Views)

What hardware are you controlling, and what do you mean by "it didnt release the connection"? That you aren't able to estabilish a new connection? Or that your hardware still have the "remote" flag active?

Just trying to figure out what is wrong.

Regards

0 Kudos
Message 2 of 9
(4,794 Views)

i have my com1 connected to i2c interface...

 

i just want to release the connection (visa connection) without stoping the program.

 

0 Kudos
Message 3 of 9
(4,788 Views)

...strange, I'd expect the resource to be released by using VISA close.

Can you post your VI?

0 Kudos
Message 4 of 9
(4,784 Views)

attached is the sample vi similar to the actual vi.

 

see attached.

0 Kudos
Message 5 of 9
(4,782 Views)

Please post the actual VI, not only a jpg (case and stacked sequences are not accessible).

But something is wrong even in the jpg: I won't use local variables to initialize controls...

0 Kudos
Message 6 of 9
(4,776 Views)

see attached...a sample vi, similar to actual application vi.

we will not debate on using local variables to initialize controls.

 

we'll focus on why CLOSE VISA vi doesnt release the connection

0 Kudos
Message 7 of 9
(4,766 Views)
Solution
Accepted by topic author cmdrb

What do you mean by "it didn't release the connection"

 

I tried your code and it seemed to work as I expected with HyperTerminal.

 

If I opened the port with your VI "Start" button, then HyperTerminal could not open the com port.

Then when I closed the port with your VI "Stop" button, then HyperTerminal was able to open the com port.

 

I can switch back and forth between your VI and HyperTerminal opening and closeing the com port. Getting an error message if the other has it opened. Closeing it port and then being able to open it with the other.

 

Omar

Omar
Message 8 of 9
(4,743 Views)

Yeah, your right, its working now also...

i dont know what did happen, i been playing around with it this morning and it didnt release the connection.

now it works fine.

 

thanks Omar for your time.

 

Xdaf,

thank you for your time.

0 Kudos
Message 9 of 9
(4,733 Views)