Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA error

Hello.

 

I have communication problems while trying to initialize an instrument (Norma 4000).

There's something weird : if i use the windows hyperterminal, I get the expected answers from the instrument.

But as soon as I try to send the same commands using visa (LabWindows/CVI, LabVIEW or MAX), I get unexpected characters.

 

Here is an example of what I got with LabVIEW :

 

 

Requête:31/05/2012 15:33:05.81064 (+10.1563 seconds)

*RST.*IDN?.


Réponse:31/05/2012 15:33:05.81064 (+0.0000 seconds)

@øLEM,NORMA 4000,UO13246BA,V1.2

 

 

instead of :

 

Réponse:31/05/2012 15:33:05.81064 (+0.0000 seconds)

LEM,NORMA 4000,UO13246BA,V1.2

 

Does anyone have a solution ?

Thanks in advance

 

Dave

0 Kudos
Message 1 of 14
(3,809 Views)
0 Kudos
Message 2 of 14
(3,799 Views)

No no, I'm using the NI MAX tool (Measurement & Automation) and the hyperterminal.

And I forgot to specify that I'm using the serial port to communicate with my instrument.

 

0 Kudos
Message 3 of 14
(3,790 Views)

@__dave__ wrote:

No no, I'm using the NI MAX tool (Measurement & Automation) and the hyperterminal.

And I forgot to specify that I'm using the serial port to communicate with my instrument.

 


That's not what he is asking.

He is asking when you are using LabVIEW whether you are using the LabVIEW driver.

0 Kudos
Message 4 of 14
(3,782 Views)

Ah ok.

I have tried to communicate with the Visa vis provided with LabVIEW.

 

0 Kudos
Message 5 of 14
(3,779 Views)

I'm not overly surprised at seeing some "garbage" characters occur after a *RST command. HyperTerminal hides most non-printable characters so you think they're not there, but they actually are. You could try clearing the buffer after a reset.

 

But then, as I noted, there's a driver for that instrument, so why don't you use that?

0 Kudos
Message 6 of 14
(3,763 Views)

I cannot use the driver you advise me because this driver is for GPIB.

And I'm trying to repair the communication through RS232.

 

How can I clear the buffer ?

0 Kudos
Message 7 of 14
(3,761 Views)

Actually, the driver uses VISA. Consequently, it wouldn't take much to have it handle a serial interface. Many of the drivers on the NI site that use VISA are written to work with either GPIB or serial. If you look at the 34401 driver that ships with LabVIEW you will see how it's handled in the Initialize VI.

 

As for clearing the buffer, there's a VISA function for that: VISA Flush I/O Buffer. It's in the VISA -> Advanced -> Bus Specific palette. Please refer to the LabVIEW Help on how to use it.

0 Kudos
Message 8 of 14
(3,756 Views)

I've tried the given driver.

I get the same problem : I receive weird chars, which make the initialization fail.

0 Kudos
Message 9 of 14
(3,747 Views)

As you indicated and I confirmed, the driver was written to work with a GPIB interface, so I'm not sure I understand what you did when you said you tried the driver. Unless you made modifications so that it would configure the serial port, the driver would probably not work with a serial interface.

 

I would suggest that you monitor the serial port to see if these extra characters are coming when you use HyperTerminal. If you're on Windows, the PortMon utility (available from Microsoft) can be used to capture the serial port. You can then see if you're actually getting these when you use HyperTerminal, and if HyperTerminal is simply hiding them.

0 Kudos
Message 10 of 14
(3,737 Views)