Thanks for the code, Dennis. That shows:
static ViStatus hp33120a_DefaultInstrSetup (ViSession vi, ViBoolean reset)
{
/* some stuff deleted for brevity here,
including variable declarations */
if (interface != VI_INTF_ASRL)
viCheckErr( viPrintf (io, "%s*CLS;*ESE 1;*SRE 32;"));
/* *** Huh? a %s without a parameter **BUG** */
else
{
/* The manual for hp33120a states:
- The "SYSTEM:REMOTE" command must be sent whenever communicating over RS-232.
- The communication must be set up with TWO stop bits
- The function generator uses DTR/DSR handshaking
*/
viCheckErr( viPrintf (io, "SYSTEM:REMOTE"));
/* **BUG??** Y
ou're sending this before setting the stop bits/etc ??? **/
viCheckErr( viSetAttribute (io, VI_ATTR_ASRL_STOP_BITS, VI_ASRL_STOP_TWO));
viCheckErr( viSetAttribute (io, VI_ATTR_ASRL_FLOW_CNTRL, VI_ASRL_FLOW_DTR_DSR));
}
viCheckErr( viPrintf (io, ":FORM:BORD NORM;:APPL:SIN 1000.0, 0.05, 0.00;",
(reset) ? "*RST;" : ""));
/* Now you are supplying a parameter without a %s ??? ***BUG** */
/* I forget how the firmware works in the 33120, but the driver
that I wrote sent the "SYST:REM" after the "*RST" was sent --
and resent the SYST:REM every time a *RST was done. The reset might
take it out of SYST:REM.
My driver used SYST:REM, instead of the full SYSTEM:REMOTE. So I
know the abbreviated version works. Some instruments had defects in
the command set. I don't remember about the 33120, so I can't guarentee
that the long form works.
While looking up other things, I found:
http://www.hhdsoftware.com/
They have a serial
bus monitor for $70. It should be able to tell you
what commands are really being sent. It might be a useful debugging tool.
Les.Hammer@CompleteTest.com