Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Send times out when data includes embedded quotes

Hello,

(Previously posted in error to Instrument Drivers/IVI)

I have an application that controls a HP/Agilent 8753 Network Analyzer over the GPIB. I am now trying to convert this to use the NI series of GPIB interfaces, using a borrowed AT-GPIB/TNT (PnP) card for development purposes.

Using the Multi-Device calls, everything is fine until I try to Send a string that has embedded double-quotation marks (eg to send a title string to the instrument). As soon as I do this it fails with a timeout, either immediately or on the next call to Send. With the Send function, I pass the string length (without the trailing '\0') as the 4th parameter, and use NLend. When Send returns, ibcntl is one more than the original string length (ie the string length with the appended newline).

I have attached a code fragment (in C, with hard-coded parameters and without the checks on ibsta) at the end of this posting. As you can see, there are several GPIB calls before the call to set the title string - all of these calls return correctly, with the instrument behaving as expected.

Observations:
* The application works fine with a legacy Hewlett-Packard 82335B card using HP-IB Tools Rev B.00.00.00 (through a home-brewed DDE server to manage the 32/16-bit interfacing).
* It also works fine with a CEC488 PCI card, using native CEC function calls and their IEEE_32M DLL.
* It fails with the NI card, using the Multi-Device calls from NI488.2 2.2. This happens both when I access the NI GPIB-32 DLL functions indirectly through LoadLibrary, and when I include BorlandC_gpib-32.obj into my project.
* It also fails if I switch back to the CEC card, but use NI function calls with their compatible GPIB-32 DLL (Ver 5.14.0.0). I have only tried this with indirect (LoadLibrary) calls to the DLL.

Hardware & BIOS changes:
* Used a shorter GPIB cable - no improvement.
* Changed BIOS PCI IDE BusMastering from Disabled to Enabled - no improvement.
* Changed BIOS DMA 5 Type from Normal ISA to PC/PCI (Device Manager shows the card is using DMA 05) - no improvement.

Development platform:
* Borland C++Builder 5 Standard, running in debug mode.
* Windows 98 SE.
* Pentium 550.
* AMI BIOS V2.5 1997

Everything I have tried so far suggests that the Send function does not like to transmit embedded double-quotation marks.

One thing I have not yet tried is to use the Traditional calls instead of the Multi-Device calls.

Any ideas ?

TIA,
Bill

SendIFC( 0 );
Send( 0, 16, "IDN?;", 5, NLend );
Receive( 0, 16, inbuf, 256, STOPend );
Send( 0, 16, "OPC?;PRES;", 10, NLend );
Receive( 0, 16, inbuf, 256, STOPend );
Send( 0, 16, "OUTPERRO;", 9, NLend );
Receive( 0, 16, inbuf, 256, STOPend );
Send( 0, 16, "HOLD;", 5, NLend );
Send( 0, 16, "S21;", 4, NLend );
Send( 0, 16, "LOGM;", 5, NLend );
Send( 0, 16, "SCAL10;REFP10;REFV0;", 20, NLend );
Send( 0, 16, "CENT140.0000MHZ;SPAN50.0000MHZ;POIN801;", 39, NLend );
Send( 0, 16, "POWE6.0;", 8, NLend );
Send( 0, 16, "SWET3.000;", 10, NLend );
Send( 0, 16, "IFBW300.0HZ;", 12, NLend );
Send( 0, 16, "CORROFF;", 8, NLend );
Send( 0, 16, "CONT;", 5, NLend );
Send( 0, 16, "TITL\"This does not work\";", 25, NLend );
0 Kudos
Message 1 of 2
(3,728 Views)
I tested this with a PCI-GPIB card on XP with driver v2.2 and it seemed to work perfectly (though my instrument didn't particularly like the quotes, they were transmitted properly out of my GPIB card).

I verified with a Spy capture that my send string included the quotes. See http://digital.ni.com/public.nsf/websearch/8D890EC09B15C05A86256E6F007E3E86?OpenDocument

I also verified that the quotes (0x22) were transmitted out the GPIB port using a GPIB Analyzer board (not sure if you have one of these available, but it may shed some light on the subject): http://digital.ni.com/public.nsf/websearch/ABA74984DA039b2286256E6F007B0082?OpenDocument

Hopefully this will help. I don't have any ISA slots readily available, but I don't think this is bus-specific. Wha
t NI-488.2 Driver version do you have? You can find this in Measurement and Automation Explorer under the "Software folder" on the left hand side.

Scott B.
GPIB Software
National Instruments
0 Kudos
Message 2 of 2
(3,727 Views)