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,531 Views)
0 Kudos
Message 2 of 14
(3,521 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,512 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,504 Views)

Ah ok.

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

 

0 Kudos
Message 5 of 14
(3,501 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,485 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,483 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,478 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,469 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,459 Views)

As I said in my first message, I've tired to monitor the instrument with the windows hyperterminal, and there wasn't any additional character.

Then I tried to monitor the instrument with NI Max (using VISA), and the unexpected characters occured.

See the 2 attached files (one for the hyperterminal, and the other for MAX)

Download All
0 Kudos
Message 11 of 14
(761 Views)

HyperTerminal is not a monitoring program. You also do not monitor using MAX. To monitor you need something else, which is why I suggested PortMon, which allows you to see explicitly the bytes that are sent over the serial port. NI-Spy will do this as well, but it won't work with HyperTerminal. You chose to use HDD Software Serial Monitor, which is fine. Of course, your screenshots show no difference between the communication done with HyperTerminal and the communication done with MAX. Both show the same exact response to the *IDN? command.

0 Kudos
Message 12 of 14
(753 Views)

Yes, you're right, I get the same answer to my "*IDN?"

But if you look at the next command, you will see the problem (see attached file)

0 Kudos
Message 13 of 14
(738 Views)

Something doesn't look right with those captures. And by that I don't mean the received data. I'm referring to the timestamps. In the one for HyperTerminal the response from *RST *IDN? comes about 150 msec after the command. In the MAX case it comes 10.6 seconds later. This makes no sense to me. Additionally, the HyperTerminal capture shows the second set of command being split, with a 12 second gap. The MAX command set was sent 15 seconds after the response from *IDN? and the response coming 2.5 seconds later.

 

How exactly are you sending these commands in MAX? And how are you sending these commands in HyperTerminal? Are you uploading a file with the command in there?

 

You said you tried to do this in LabWindows and LabVIEW. Can you upload your actual code?

0 Kudos
Message 14 of 14
(723 Views)