from: Marco Panzanella
marco@gore.afep.cornell.edu
to: Reflector
Date: Wed, 12/4/96
Hello HP-Vee'rs,
Can anyone tell me how to decifer the serial codes in the intrument
driver configuration window. I am trying to communicate to a Keithley 2000 DMM
via the RS-232 port com2, 3, and 4. I will later use the IEEE-488 bus for the
DMM. I am just experimenting now. The VEE manual does not seem to clear on how
to do this. Thanks in advance. Marco.
gvg@lvld.hp.com / 970-679-3030 / FAX 970-679-5971
to: Marco Panzella -- VRf
date: Wednesday, 04 December 1996 1111 MST
> from: Marco Panzanella
> marco@gore.afep.cornell.edu
> to: Reflector
> Date: Wed, 12/4/96
>
> Hello HP-Vee'rs,
> Can anyone tell me how to decifer the serial codes in the intrument
> driver configuration window. I am trying to communicate to a Keithley
> 2000 DMM via the RS-232 port com2, 3, and 4. I will later use the
> IEEE-488 bus for the DMM. I am just experimenting now. The VEE manual
> does not seem to clear on how to do this. Thanks in advance. Marco.
Sir:
Here's my survey of the topic. If you need any clarification, let me know
and I will enhance it accordingly.
[%%] regards -- greg goebel
--------------------------------- cut here ----------------------------------
[9.5] TROUBLESHOOTING RS-232 COMMUNICATION PROBLEMS UNDER WIN95
* Instrument control over RS-232 has always been particularly troublesome to
deal with, and though much was done in Win95 to improve I/O configuration,
nothing much has seriously changed as far as RS-232 -- sometimes known as
"bunch of wires" -- goes. It is useful to provide a section showing how to
attack such problems in detail.
* For an example, let's consider interfacing a 54600 scope over RS-232 to a
PC running HP VEE under Win95.
The first thing to do is to make the physical hookup. I put a 54651A serial
module on the back of the scope, and hooked the scope to the PC with a 24542G
cable. I checked the scope's utility menu to confirm that it was running at
9600 BPS -- I assumed 8 bits, one stop bit, no parity, which is about as
conventional as anything ever gets for RS-232 -- and selected XON-XOFF
handshaking.
* As an initial test, I ran Windows Terminal to check to see if the RS-232
link was operational. Terminal came up as below:
+-----------------------------------------------------------+
| Terminal - (Untitled) [_][ ][x] |
+-----------------------------------------------------------+
| File Edit Settings Phone Transfers Help |
+-----------------------------------------------------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+-----------------------------------------------------------+
I went to "Settings->Communications" and set it to 9600 baud, 8 data bits, 1
stop bit, no parity, and XON-XOFF; I went to "Settings->Terminal Preferences"
and selected "Local Echo" and "CR->CR-LF". This done, I typed in:
*IDN?
-- and the scope came back with its ID string:
HEWLETT-PACKARD,54600A,0,2.3
The two were communicating. If this had not worked, I would have needed to
examine or doublecheck my physical serial connections and parameter settings.
* Next, I used the HP I/O configuration utility (supplied with the HP I/O
libraries software) to ensure that the PC interface had been configured.
Invoking it brought up:
+------------------------------------------------------------------------+
| Interface Configuration Application - I/O Config [_][ ][x] |
+------------------------------------------------------------------------+
| File Help |
+------------------------------------------------------------------------+
| This utility configures I/O interfaces. To configure a new interface, |
| select it in the Available Interface Types list and click on |
| Configure. To edit a previously configured interface, select it in |
| the Configured Interfaces list and click on Edit. |
| |
| +- Available Interface Types -+ +- Configured Interfaces ---+ |
| | | | | |
| | | | SICL Name VISA Name | |
| | +-----------------------+ | | +---------------------+ | |
| | | HP 82335 HP-IB | | | | COM1 ASRL1 | | [ OK ] |
| | | HP 82340/82341 HP-IB | | | | lan n/a | | |
| | | HP E2075 GPIO | | | | | | |
| | | LAN Client | | | | | | |
| | | LAN Server | | | | | | [ Help ] |
| | | RS-232 | | | | | | |
| | | VISA LAN Client | | | | | | |
| | | VXI Command Module | | | | | | |
| | | | | | | | | |
| | +-----------------------+ | | +---------------------+ | |
| | [ Configure ] | | [ Edit ] [ Remove ] | |
| +-----------------------------+ +---------------------------+ |
| |
+------------------------------------------------------------------------+
COM1 was fortunately available, but if it wasn't, I could have added it with
the "Configure" button. In any case, I can select the COM1 entry to get the
settings dialogue:
+------------------------------------------------------------------------+
| RS-232 / Serial Configuration |
+------------------------------------------------------------------------+
| Questions? Press the Help button below. Recommended default values |
| are shown. |
| |
| Port Number: [ 1 ] SICL Interface Name: [ COM1 ] |
| |
| Logical Unit: [ 9 ] VISA Interface Name: [ ASRL1 ] [ OK ] |
| |
| Stop Bits: [ 1 ] Baud Rate: [ 9600 ] [ Cancel ] |
| |
| Data Size: [ 8 ] Parity: [ None ] [ Help ] |
| |
| SRQ Line: [ RI ] Flow Control [XON/XOF] [ Defaults ] |
| |
+------------------------------------------------------------------------+
These were all the right settings (though they were merely defaults ... I
still had to ensure that VEE had the right settings), so I clicked on "OK"
and then exited the utility.
* Now on to VEE ... I ran VEE, went to "I/O->Other Instruments" (this was
"I/O->Configure Instruments" in VEE versions before 3.2), and got the
instrument-configuration dialogue:
+----------------------------------------------------------------+
| Instrument Select or Configure |
+-------------------------------------+--------------------------+
| HP33120 (hp33120a@NOT LIVE) | Instrument Type |
| HP3478 (hp3478@NOT LIVE) | |
| | <*> Instrument Panel |
| | < > Component Driver |
| | < > Direct I/O |
| | |
| +--------------------------+
| | Instrument Configure |
| | |
| | [ Add Instrument... ] |
| | [ Delete Instrument... ] |
| | [ Edit Instrument... ] |
| | |
+-------------------------------------+--------------------------+
| [ Get Instr ] [ Save Config ] [ Cancel ] [ Help ] |
+----------------------------------------------------------------+
I didn't have an entry for the scope, so I clicked on "Add Instrument" to get
the dialogue:
+------------------------------+
| Device Configuration |
+------------------------------+
| |
| Name: [ 54600 ] | <-- Gave it device name (arbitrary).
| Interface: [ Serial ] | <-- Set Serial interface.
| Address (eg 9): [ 9 ] | <-- Set address 9.
| Gateway: [This host] |
| Device Type: [ ] |
| Timeout (sec): [ 5 ] | <-- Five seconds is fine.
| Byte Ordering: [ MSB ] |
| Live Mode: [ ON ] | <-- OK
| |
| [ Direct I/O Config... ] |
| [ Instrument Driver Config ] |
| |
| [ OK ] [ Cancel ] [ Help ] |
+------------------------------+
I set this dialogue as shown above (fields for which no comment is given
above are not important for our purposes here) and I then selected "Direct
I/O Config" to get the next dialogue:
+---------------------------------+
| Direct I/O Configuration |
+---------------------------------+
| |
| Read Terminator: [ "
" ] |
| Write: |
| EOL Sequence: [ "
" ] |
| Multi-field as: [DataOnly] |
| Array Separator: [ "," ] |
| Array Format: [ Linear ] |
| Baud Rate: [ 9600 ] | <-- OK
| Character Size: [ 8 ] | <-- OK
| Stop Bits: [ 1 ] | <-- OK
| Parity: [ none ] | <-- OK
| Handshake: [XON/XOFF] | <-- Set this instead of "none".
| Receive Buffer Size: [ 4096 ] |
| |
| [ OK ] [ Cancel ] |
+---------------------------------+
I clicked on "OK" and went back to the previous dialogue ... there I clicked
on "Instrument Driver Configure" and specfied the "ID Filename" as
"hp54600.id".
I exited the dialogue, did a "Save Config" on the main Instrument dialogue,
and I was ready to go.
* To actually do something, I brought up "I/O->Other Instruments", selected
the "Direct I/O" flag, selected my new "HP54600 (hp54600@9)" entry, and
clicked on "Get Instr" ... a DIO box came up:
+------------------------+
| 54600 (hp54600@9) |
+------------------------+
| |
| |
+------------------------+
I used this to write the following program:
+----------------------------+ +------------------------------+
| 54600 (hp54600@9) | | AlphaNumeric |
+------------------------+---+ +------------------------------+
| WRITE TEXT "*IDN?" EOL | X +-->| HEWLETT PACKARD,54600A,0,2.3 |
| READ TEXT X STR | | +------------------------------+
+------------------------+---+
It read the ID string as shown above. I could also then fetch a panel driver
and use it to control the scope.
* Note that VEE accessed the interface using the "logical unit number" of 9
... this number is actually more-or-less arbitrary, and I could change it
to another value as follows:
% Exit VEE (VEE only reads SICL configuration when you bring it up, so if
you don't do this, it won't change).
% Go into the I/O Config program, select COM1, get the logical unit value,
and change it to one of the allowed values -- say, 13. Save the
configuration.
% Re-run VEE.
% Go into "I/O->Other Instruments", select the "54600" entry, do an "Edit
Instruments", and change the value for the serial port from 9 to 13.
% Save the configuration, and now things will work as they did before with
the new logical unit value.
* In summary, the steps for performing the RS-232 I/O are as follows:
% Make the proper hardware connection between PC and instrument.
% Confirm the instrument serial parameters (baud rate, parity, word size,
stop bits, handshake).
% Run Windows Terminal, set it to the proper parameters, and get ID from the
instrument. (Note that older instruments may not understand the *IDN?
command ... check your instrument manuals for a reasonable alternative.)
If you cannot get this to work, either you have your parameters wrong or
your cable isn't the right one.
% Run HP I/O Config to ensure that the serial port is configured under the
HP I/O Libraries and make a note of the logical unit number.
% Run VEE and configure an I/O device using that logical number; define the
proper serial parameters as well. At this point, you should be able to
run Direct I/O or an instrument driver.
One last note: some popular instruments, such as the HP34401 DMM, have both
HPIB and RS-232 interfaces ... you'll need to set the 34401 to RS-232 from
the DMM's front panel to get serial communications to work. (Note that the
34401 tells you what interface it is set to on power-up.) Another
peculiarity of the 34401 is that you have to send a ":SYSTEM:REMOTE" command
to it before it will respond correctly over RS-232.
[<>]