05-31-2012 08:58 AM - edited 05-31-2012 08:58 AM
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
05-31-2012 12:10 PM
Are you programming this yourself, or are you using the drivers: http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=BA0B4F7903CF0566E0440021287E65...
06-01-2012 12:15 AM
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.
06-01-2012 08:04 AM
@__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.
06-01-2012 08:19 AM
Ah ok.
I have tried to communicate with the Visa vis provided with LabVIEW.
06-04-2012 07:30 AM
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?
06-04-2012 07:40 AM
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 ?
06-04-2012 08:44 AM
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.
06-05-2012 12:25 AM
I've tried the given driver.
I get the same problem : I receive weird chars, which make the initialization fail.
06-05-2012 08:07 AM
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.