Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Programming with the GPIB-VXI/C



Hardware: GPIB>>Plug-in Controllers>>GPIB-VXI/C

Problem:
I have a GPIB-VXI/C module and need to know commands to issue and how to issue them. Where can I find this information?

Solution:
This section describes some of the most common commands that you can issue to the GPIB-VXI/C. The commands can be issued through the serial interface or using IEEE 488 commands. The RM Information Queries will be covered followed by a description of some of the most common I/O commands.

RM Information Queries
The RM Information Queries return information about the known system. If the GPIB-VXI/C is the system RM (Resource Manager), it can access information about the entire system. If it is not the RM, it has information only about itself and its immediate Servants.

This section explains how to issue these commands using IEEE 488 commands. Therefore, if you are using any of our GPIB drivers, you can use the GPIB interactive control (IBIC) program. You have to open a session to the GPIB-VXI/C to issue the RM Information Queries. Below is an example of how to open a session to GPIB-VXI/C, where its primary address is 1 and secondary address is 0 (96 in IBIC).

The ibsic command will clear the GPIB bus. The ibdev command will open a session to the GPIB-VXI/C. Now you are ready to issue the RM Information Queries.

The RM Information Queries covered in this section are the following:

  1. A24MemMap? and A32MemMap?
  2. Laddrs?
  3. NumLaddrs?
  4. RmEntry?
  5. ConsMode


A24MemMap? and A32MemMap?

Purpose: Get the A24/A32 address space allocation for the system.

Query Syntax: A24MemMap? or A32MemMap?

Response: Program response:

<la1>,<A24/A32 memory base>,<A24/32 memory size><CRLF>

<la2>,<A24/32 memory base>,<A24/32 memory size><CRLF>

. .

. .

<la N>,<A24/32 memory base>,<A24/32 memory size><CRLF> where <la1> through <la N> are logical addresses containing A24 address space.

Console response:

A24 Memory Map is as follows:<CRLF>

Logical Address <la1> has <A24/32 memory size>k

(<A24/32 memory size> bytes) at A24/32 Address<A24/32 memory base><CRLF>

. .

. .

Logical Address <la N> has <A24/32 memory size>k

(<A24/32 memory size> bytes) at A24/32 Address<A24/32 memory base><CRLF>

From IBIC, you can do the following:

Observe that LA 19 requests 64k (10000h) bytes at offset 200000h of the A24 address space.

Laddrs?

Purpose: Get a list of the known logical addresses.

Query Syntax: Laddrs?

Response: Program response:

<la1>,<la2>,..., <la N><CRLF>

where <la1> through <la N> are the known logical addresses.

Console response:

Known logical addresses are <la1>,<la2>,..., <la N><CRLF>

CI logical addresses are terminated with an asterisk (*) in the console mode response.

In IBIC you would see the following:

Note that the logical addresses of the system are 0, 17 and 19. If using VISA, you may see an extra logical address that corresponds to the VISA Code Instrument (CI) that VISA downloads to run on the GPIB-VXI/C controller. This CI is used by VISA to handle some of the VISA communication.


NumLaddrs?

Purpose: Get the number of known logical addresses.

Query Syntax: NumLaddrs?

Response: Program response:

<num las><CRLF>

where <num las> is the number of known logical addresses.

Console response:

There are <num las> known Logical Addresses<CRLF>

In IBIC you would see the following:

Note: There are 3 logical addresses in the system. If using VISA, you may see an extra logical address that corresponds to the VISA Code Instrument (CI) that VISA downloads to run on the GPIB-VXI/C controller. This CI is used by VISA to handle some of the VISA communication.



RmEntry?

Purpose: Return RM information about a device or all devices. RmEntry? does not return the Servant list.

Query Syntax: RmEntry? [<logical address>]

(If <logical address> is omitted, RmEntry? returns the RM information for all devices.)

Response: Program response:

<la>,<cla>,<sa>,<slot>,<devclass>,<subclass>,<manID>,<modelcode>,

<memspace>,<membase>,<memsize>,<state>,<line status><CRLF>

Console response:

Resource manager entry for Logical Address <logical address>:

<CRLF>

<CRLF>

Commander's Logical Address :<cla><CRLF>

GPIB Address :<addr><CRLF>

Slot :<slot><CRLF>

Device class :<devclass> (class)<CRLF>

Extended Sub Class :<subclass><CRLF>

Manufacturer's ID :<manID> (manufacturer's name)<CRLF>

Model code :<modelcode><CRLF>

Memory space :<memspace> (memory space)<CRLF>

Memory Base :<membase><CRLF>

Memory Size :<memsize>K (<memsize> bytes)<CRLF>

Status State :<state> (state)<CRLF>

Forced Offline? :<line status> (yes/no)<CRLF>

The mnemonics have the following meanings:

la Device's logical address

cla Commander's logical address

addr Device's GPIB address

(255 if not assigned GPIB address)

slot Slot number

(255 if unknown, such as if the device does not have MODID capability)

devclass Device class; the following values may be used:

0 = Memory Class

1 = Extended Class

2 = Message-Based

3 = Register-Based

subclass Extended class device's subclass

manID Manufacturer's ID number

modelcode Device's manufacturer-assigned model code

memspace Memory space requirement:

0 = A16 only

1 = A16/A24

2 = A16/A32

membase Memory base address

memsize Memory size in bytes

state Status state:

0 = Failed and not Ready

1 = Passed and not Ready

2 = Failed and Ready

3 = Passed and Ready

line status Online/offline status:

0 = online

1 = forced offline

The program mode response format is the same for all devices. However, the console mode response returns only the lines that are relevant. For example, memory base address and memory size lines are not returned for A16-only memory space devices.

To issue this command from IBIC, first enable the console data mode and then issue the RmEntry? command.

You would do this as follows:

    Ibwrt "consmode 1"

    Ibrd 100

    Ibwrt "rmentry? 19"

    Ibrd 10000


This example displays the all the information returned by the resource manager for LA 19.

ConsMode

Purpose: Enable or disable the console data mode.

Command Syntax: ConsMode <Boolean>

Action: If <Boolean> is TRUE, ConsMode enables console format responses for the command source issuing the command.

If <Boolean> is FALSE, ConsMode disables console format responses for the command source issuing the command.

The console response mode applies only to the response path connected to the ConsMode command source. For example, disabling the console response mode from the GPIB port does not affect the response mode on the serial port.

From IBIC you can enable the console data mode by issuing the following command:

    Ibwrt "consmode 1"

    Ibrd 100


To illustrate the difference between enabling and disabling the console data mode, the A24MemMap? command will be sent to the GPIB-VXI/C. The response to this command will be read both with the console data mode option enabled and disabled.

Console data mode enabled:

Console data mode disabled:

Observe that now the response is displayed in a much simpler form. With console data mode enabled, the response to the command contains a brief description of the output.




Related Links:
KnowledgeBase 4055MS5N: Addressing VXI Devices Using the GPIB/VXI-C

Attachments:


vxi_gpib-vxi_image31.gifimage32.gifimage34.gifimage35.gifimage36.gifimage37.gifimage38.gif


Report Date: 10/25/2006
Last Updated: 12/07/2006
Document ID: 42OHLOD2

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit