05-08-2013 01:33 PM
Hi, I have an instrument which has a usb connection. When I connect it to a Windows 7 PC, it automatically picks up the driver and shows up as a "USB Serial Port (COM7) (Manufacturer is FTDI).
When I open up NI MAX, this device shows up as COM7 (ASRL7::INSTR) under "Serial and Parallel". And, when I click on Open VISA Test Panel, and try the "*IDN?" command, it works OK.
However, the VI (which just sends a VISA command "*IDN?") gives me a time out error (0XBFF0015) or a device/resource not present error ( 0XBFFF0011). Attached is a screenshot of the VI.
Any ideas why?
Thanks.
PS: I went through the process to create the VISA-USB driver, but that has some other issue, but I am trying to understand why this occurs. This device also has a GPIB port and when I use a USB-GPIB adapter, it works very well.
Solved! Go to Solution.
05-08-2013 02:06 PM
@SysB1 wrote:
Hi, I have an instrument which has a usb connection. When I connect it to a Windows 7 PC, it automatically picks up the driver and shows up as a "USB Serial Port (COM7) (Manufacturer is FTDI).
When I open up NI MAX, this device shows up as COM7 (ASRL7::INSTR) under "Serial and Parallel". And, when I click on Open VISA Test Panel, and try the "*IDN?" command, it works OK.
However, the VI (which just sends a VISA command "*IDN?") gives me a time out error (0XBFF0015) or a device/resource not present error ( 0XBFFF0011). Attached is a screenshot of the VI.
Any ideas why?
Thanks.
PS: I went through the process to create the VISA-USB driver, but that has some other issue, but I am trying to understand why this occurs. This device also has a GPIB port and when I use a USB-GPIB adapter, it works very well.
Look up the examples that ship with LabVIEW. What you have there isn't quite complete - for serial VISA. While GPIB will work great with what you have, serial VISA requires you to configure your serial port and is a little more complicated to read.
05-08-2013 03:56 PM
I'm with Billko. It is very likely you need to configure your serial port in the LabVIEW program. There is a Configure Serial Port in the VISA palette.
05-08-2013 04:36 PM
Do you need to send a termination character after the *IDN? ?
05-09-2013 12:36 PM - edited 05-09-2013 12:41 PM
Thanks, I missed the configuration block, however, even when I add that, I am getting a timeout while reading back. I am using this example http://zone.ni.com/devzone/cda/epd/p/id/2669 . The settings seem to be fine. Attached are the JPEGs showing my settings. I tried MATLAB and it worked fine, so it is not the communication, but something that I am doing in the VI.
Thanks.
05-09-2013 12:53 PM
That looks like a lousy example. It doesn't match the Basic Serial Write and Read example you find using the example finder in LabVIEW.
The string to write is just *IDN? not *IDN?\n like the real LabVIEW example has. So that goes back to my question, "Do you need to send a termination character?" With your VI, it looks like you did not.
I suggest adding \n (while the string control is in \codes display) to the string to write and try again.
05-09-2013 12:55 PM
@RavensFan wrote:
That looks like a lousy example. It doesn't match the Basic Serial Write and Read example you find using the example finder in LabVIEW.
The string to write is just *IDN? not *IDN?\n like the real LabVIEW example has. So that goes back to my question, "Do you need to send a termination character?" With your VI, it looks like you did not.
I suggest adding \n (while the string control is in \codes display) to the string to write and try again.
Whew, then it's not just me that thought it was a terrible example? The serial read part of it was almost dysfunctional to me.
05-09-2013 02:10 PM - edited 05-09-2013 02:20 PM
@RavensFan wrote:
The string to write is just *IDN? not *IDN?\n not.
I suggest adding \n (while the string control is in \codes display) to the string to write and try again.
Thanks for your time and the response. Was the above a typo (it is confusing). Regardless I am using the "\n".
Question:
1. I looked at the example fromthe Labview installation and that's all I need. However, I am wondering why it wasn't working in the first place. Attached is a VI which has two serial reads. The first one doesn't work and the 2nd one works. Both look exactly the same.
Thanks.
05-09-2013 02:15 PM
No. Your first string to write is sending a literal backslash and a literal n. Your control shows \n, but it is in Normal display mode. Change it to \codes mode and delete the extra backslash there.
Your second string to write is properly set for \codes mode.
Since the wrong string is being written, the timeout error occurs, and that prevents the downstream VI's on that same error wire from running.
05-09-2013 02:20 PM
Thanks. That was it. Thanks so much for your time.