LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa/Serial Problem

Hi all

I've written a vi which uses a VISA session to probe the PC com (serial)
port and check to see if there is a CTS present. I use this to confirm the
presence or absence of a remote instrument.

It all works fine until I initialise the serial port with the labview
serial initialise VI after which the VISA CTS check VI doesn't work until
I reboot the PC.

If anybody can help I would greatly appreciate it.

MTIA

Bill

mailto:wsymonds@clara.co.uk
0 Kudos
Message 1 of 7
(4,686 Views)
You can't use both the serial VIs and VISA. Use VISA to initialize the port.
Easy VISA Serial Write & Read.vi on the VISA pallette shows how.

wsymonds@clara.co.uk (Bill Symonds) wrote:
>Hi all>>I've written a vi which uses a VISA session to probe the PC com
(serial) >port and check to see if there is a CTS present. I use this to
confirm the >presence or absence of a remote instrument. >>It all works fine
until I initialise the serial port with the labview >serial initialise VI
after which the VISA CTS check VI doesn't work until >I reboot the PC.>>If
anybody can help I would greatly appreciate it.>>MTIA>>Bill >>mailto:wsymonds@clara.co.uk
0 Kudos
Message 2 of 7
(4,686 Views)
hi Bill,

i don't know if it will be the right option but try to enable "close
automatically VISA sessions" inside the options dialog under others (or
like it's called in the english version). Normally the close visa
session will not really close the actual refnum.

good luck
Henrik


Bill Symonds wrote:
>
> Hi all
>
> I've written a vi which uses a VISA session to probe the PC com (serial)
> port and check to see if there is a CTS present. I use this to confirm the
> presence or absence of a remote instrument.
>
> It all works fine until I initialise the serial port with the labview
> serial initialise VI after which the VISA CTS check VI doesn't work until
> I reboot the PC.
>
> If anybody can help I would greatly appreciate it.
>
> MTIA
>
> Bill
>
> mail
to:wsymonds@clara.co.uk
Message 3 of 7
(4,686 Views)

I had a similar problem. i have a Newport ESP301 and am connected via USB.

i comunicate with it as if it were a serial port.

 

I want to scan all COM ports to find this device and then connect to it.

 

i open the connection using the  "Serial Port Init.vi" as the Visa property to do this didn't work.

I then go through all the COM ports sending a  "VE" command which will return the ESP301 identification.

Once I find it I and have used the "Serial Port Init.vi" i use VISAs to communicate with it from then on in lots of other VI's.

interestingly I open and close all my VISA sessions in the other VI's and all is OK, I just have to make sure that i have run "Serial Port Init.vi" at least once before at the beginning.

 

If the ESP301 is switched on and off again then the "Serial Port Init.vi" returns an error. I have to restart LabVIEW in order to make "Serial Port Init.vi" work and reestablish communication with the ESP301.

 

When I followed Henriks advice for "close automatically VISA sessions" I no longer had to reboot LabVIEW in order to reestablish comms once the ESP301 was turned on and off. (NOTE: This is now located in Tools>Options>Environment)

Message Edited by stubon on 06-02-2009 11:24 AM
0 Kudos
Message 4 of 7
(4,265 Views)

This is an 8 1/2 year old thread you are commenting on.  As Dennis said, you should be using the VISA functions rather than and old serial driver VI's.

 

Are you saying you are still having trouble with your VI and need help?

 

If so, please tell us what versions of LabVIEW and VISA you are using.  And post your VI so we can help you troubleshoot.

Message 5 of 7
(4,253 Views)

Hi,

 

I was actually just adding some more detail about how I had "solved" a similar problem so as a help to other people. I realise this is an old thread, but I hoped my comments were still relevant and could help someone.

 

The LabVIEW vis examples from Newport were very lite and all used Serial Port vi's

 

My two aims are: (Find device COM port.vi)

1. Scan all COM ports and identify what is connected at each port

2. Communicate with the instrument through VISA only.

 

 

I have got it working but I know that I shouldn't have to use the old Serial vi's (open USB.vi) so I have gone back and replaced the Serial vi  this with a VISA (open USB(VISA).vi) so that it is consistent with the rest of my code. Thanks for embarassing me into doing this as I have now actually solved the problem rather than a work around. 😉

 

 

The only thing I can't set is the buffer size as the old serial port vi does. Any ideas.

 

I have attached the relevant VI's. Thank you very much for offering to help.

 


 

many thanks

Download All
0 Kudos
Message 6 of 7
(4,230 Views)

stubon wrote


The only thing I can't set is the buffer size as the old serial port vi does.


Located under Instrument I/O >> Serial >> VISA Set I/O Buffer Size.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 7 of 7
(4,216 Views)