GPIB-232CT-A

Modes

The GPIB-232/485CT-A can be connected to a serial device and one or more GPIB devices. If the serial device is the Controller, you should use S mode. If the serial device is a Talker/Listener only, and a GPIB device is the Controller, you should use G mode.

Operating in S Mode

The GPIB-232CT-A should be configured to operate in S mode if your serial device acts as a Controller in the GPIB system, addressing devices, and performing other GPIB Controller functions. In other words, the 232CT is connected to the computer’s serial port. In S mode operation, you can use the NI-488.2 software.

Figure 1 shows an example of a setup using S mode. The GPIB-232/485CT-A is connected to a PC, which is controlling a GPIB plotter.

Figure 1

Operating in G Mode

The GPIB-232CT-A should be configured to operate in G mode if your serial device acts only as a Talker and/or Listener while a GPIB device manages the system, sending and receiving data to and from the serial device. The 232CT is being used to add a Serial device ( printer ) to the GPIB bus.

Figure 2 shows an example of a setup using G mode. The GPIB-232CT-A is connected to a serial printer, which is programmed by the GPIB Controller.

Figure 2

Description

Figure 3 is a top view of the 232CT-A and locations of the Serial and GPIB connector and the DC Power Jack.

Figure 3

Figure 4 is a view of the side panel with the DIP switches used to configure the 232CT-A.

Figure 4

S MODE

When used in S Mode, the 232CT-A can be used with NI-488.2 software. This allows the user to use regular GPIB programming calls to the GPIB driver even though the connection is via a serial port on the computer. This makes the serial portion invisible to the user.

The software is only available for Windows 3.1 and WIN95 and the MAC OS. The Windows OS require version 2.7 for Windows 3.1, but WIN95 also requires Compatibility Kit 1.2. The latest driver for GPIB software for Macintosh, is version 7.6.1. They are all available on the FTP site.

NI-488 GPIB Driver Set Up

The GPIB driver set up looks just like the setup for version 2.7.1 Windows 3.1 with one exception, the set up window for the 232CT. Figure 5 shows the main GPIB Configuration window for the driver. Select the GPIB Board and click on the configure button. The Board Type is grayed out and unavailable, the driver only works with the GPIB-232CT-A. The Device Template can be configured here as well.

Figure 5

Figure 6 shows the Configuration GPIB0. This will configure the computers serial port as well as show the corresponding switch settings for the 232CT-A. Click on the Software button to configure the GPIB0 Software Settings for the 232CT-A.

Figure 6

Figure 7 shows the GPIB0 Software Settings.

Figure 7

Figure 8

Fig. 8 shows IBTest upon the successful test of the GPIB-232CT-A.

When using the NI-488.2 software, the 232CT-A is used just as you would a GPIB board. IBIC is the usual way of trouble shooting.

Non NI-488.2 Operation

The GPIB driver software is not required to operate the 232CT-A in S mode, but easier to. There are commands in the manual that users can use to create their own drivers, or just incorporate them into their application. Some are similar to regular GPIB commands, such as those used in IBIC, a few are special to the 232CT-A.

S Mode Switch Settings for Serial Port Baud Rate

S Mode Switch Settings for Data Formatting Characteristics

8

Troubleshooting

The WIN32InteractiveControl can be used to troubleshoot a problem just as if it were a regular GPIB card in the computer. The NI-488.2 software must be installed.

If IBIC is not available, a normal Terminal that is able to access the computer’s serial port is perfect for testing out the converter. Use HyperTerminal in WIN95. The following is a HyperTerminal session to use to verify communication to the converter and to an instrument on the GPIB bus if possible.

HyperTerminal Session

CLR 5<CR> ( Resets the internal or device functions of the specified GPIB devices. Resetting device at address 5 here. )

RSC 1<CR> ( With a 1, the GPIB-232/485CT-A configures itself to be the GPIB System Controller. )

sic<CR> (set interface clear to remove old errors and become controller-in-charge)

sre 1<CR> (place devices in remote programming mode)

wrt 5<CR> ( Sends the following data, with out translation to device at address 5 )

*idn?<CR> ( The data being sent to the device at address 5 )

rd #100 5<CR> ( Read 100 bytes of data from the device at address 5 )

National Instruments GPIB and Serial Device Simulator Rev B.1 62 ( The return string )

There is a Check for Listening Devices, it is: ln alist<CR>

There is also an Identify System command: id<CR> Use this command if you cannot communicate with any instruments on the GPIB bus. Lets you know if you can communicate with the 232CT-A at least.

Things to check for:

1. Can computer talk to other GPIB instruments?

2. If available, does IBTEST pass?

3. Is the Ready light on?

2. Are they using a Null modem cable?

3. Have they configured both serial ports to match,? IE Switch settings for S mode? REQUIRED!

5. Can you do a test using HyperTerminal? Or IBIC?

G MODE

The 232CT-A requires a normal GPIB card in the computer to operate in G Mode. It will act as another device on the GPIB bus to bridge communication between the GPIB bus and a serial device. This address is used to send specific commands to the 232CT-A, such as to configure it’s serial port for baud rate, etc.

The serial device’s address will be the 232CT-A’s address plus one. The 232CT-A will automatically consider any communication addresses to 1 above it’s as a transfer to/from the serial device automatically. No other device on the GPIB bus should have either of these 2 addresses.

Hardware Setup

The DIP switches on the rear panel are used to configure the G mode settings. When switch 8 is set to G mode, switches 1 through 5 set the GPIB addresses for the GPIB-232/485CT-A and the serial device connected to it. This will be a binary pattern similar to the GPIB Instrument Simulator. Switches 6 and 7 must remain in the OFF position while in G mode.

The serial port is configured by commands over the GPIB bus in G Mode. The default settings on turn on are : 9600 is the baud rate, parity is disabled, 8 is the number of data bits, and 1 is the number of stop bits. Commands require an End of String character: \r

The G Mode commands that can be used are echo, onl, spset, and xon.

Spset – Set Serial Port Parameters

spset [baud] [parity] [databits] [stopbits]<CR>

Remarks: The argument baud is a numeric string specifying the baud rate (300, 600, 1200, 2400, 4800, 9600, 19200, 38400). The argument parity is a character specifying the parity (e for even, o for odd, n for none). The argument databits is a character specifying the number of data bits (7 or 8). The argument stopbits is a character specifying the number of stop bits (1 or 2).

The connections are as in Fig. 2.

IBIC Session

: ibfind gpib0 (this opens the board for board level commands)

gpib0: ibpad 0 (set the board's primary address to 0)

gpib0: ibrsc 1 (configure the board as system controller)

gpib0: ibsic (set interface clear to remove old errors and become controller-in-charge)

gpib0: ibsre 1 (place devices in remote programming mode)

gpib0: ibln PAD 0 (Find 232CT-A at primary address PAD, where PAD is an integer between 1 and 30. This must return true before proceeding. If it returns false, verify that the device is powered on, connected to the bus, and at the address specified.)

gpib0: ibdev 0 PAD 0 13 1 0 (here PAD is the same integer as above – Opens and initialize communication to GPIB-232CT-A )

ud0: (this new prompt is at the device level; ud is unit descriptor, increments as you open more devices)

ud0: ibwrt "spset 9600 N 8 1\r" ( spset – The function to set the serial port characteristics (baud rate:9600, parity: none, data bits:8 , and stop bits:1 ) to match those required by your serial device.

ud0: ibwrt "spset\r" ( Calling function without parameters queries 232CT for current setting )

ud0: ibrd 100 (reads from device, up to 100 characters)

[2100] ( end cmpl )

count: 12

39 36 30 30 20 6e 20 38 9 6 0 0 n 8 ( Example of queried setting )

20 31 0d 0a 1 . .

< Optional: IF REQUIRED FOR DEVICE. NOT REQUIRED FOR SIMULATOR >

ud0: ibwrt "eos X,13\r" ( eos – The function to Change/Disable GPIB EOS Termination Mode )

ud0: ibwrt "eos\r" ( Calling function without parameters queries 232CT for current setting )

ud0: ibrd 100

[2100] ( end cmpl )

count: 6

58 2c 31 33 0d 0a X , 1 3 . .

< END OPTIONAL >

ud4: ibdev 0 6 0 13 1 0 (here PAD is the same integer as above plus 1– Opens and initialize communication to serial device via GPIB-232CT-A )

ud5: ibwrt "*idn?\r" (*idn? is an identification command understood by many devices, but not all)

ud5: ibrd 69 ( 69 is the number of characters the Device Simulator responds to *idn? )

30 30 30 36 32 0d 0a 4e 0 0 0 6 2 . . N

61 74 69 6f 6e 61 6c 20 a t i o n a l

49 6e 73 74 72 75 6d 65 I n s t r u m e

6e 74 73 20 47 50 49 42 n t s G P I B

20 61 6e 64 20 53 65 72 a n d S e r

69 61 6c 20 44 65 76 69 i a l D e v i

63 65 20 53 69 6d 75 6c c e S i m u l

61 74 6f 72 20 52 65 76 a t o r R e v

20 42 2e 31 0a B . 1 .

< If a Simulator ( or serial device with a known output ), you can jumper pin 2 to 3 on serial instrument end of cable and verify communication up to that point >

ud7: ibwrt "test"

[0100] ( cmpl )

count: 4

ud7: ibrd 4 ( Read the number that you wrote so that you don’t get an error )

[0100] ( cmpl )

count: 4

74 65 73 74 t e s t

Troubleshooting

1. Can computer talk to other GPIB instruments?

2. Is the Ready light on?

2. Are they using a Null modem cable?

3. Have they configured both serial ports to match? REQUIRED!

4. Are 232CT-A’s switch settings correct for G Mode?

5. Can you do a loop test by jumpering pins 2 to 3 on end that connects to serial device? ( see last part of IBIC example )

6. Can they communicate with the 232CT-A? In IBIC, Query the 232 for it’s serial port parameters. Verifies communication up to that point.