Support for National Instruments' software and hardware products
1. Overview of the products of National Instruments
National Instruments (NI) has a long history of innovation and currently is the top and major company providing hardware and software for data acquisition (DAQ) products.
The portfolio of software products of NI includes :
- LabVIEW
- SingnalExpress
- Measurment Studio
- LabWindows/CVI
- DIAdem
and many other packages
Hardware products and interfaces supported include :
- Ethernet
- GPIB
- GPIB-VXI
- VXI
- PXI/PCI
- Serial
- USB
- Firewire
Most of the customers and users of the hardware and software products of NI are actually software and/or hardware developers themselves.
National Instruments has a very close relationship with its customers and users - through support services and nurturing of an online community.
2. Overview of the products of ARS Technologies
Currently we have 2 lines of hardware products -
*** USB2 based, which include USB2ISA family of products and USB2PCMCIA.
This product line allows using :
- ISA cards - standard and Plug and Play (PnP)types
- PCMCIA cards - 16bit, PCCard type
on desktop and notebook computers, through USB.
*** PCI Express based, which include XPRS_PCI , and XPRS_PX_x16.
This product line allows using :
- PCI cards - standard 32bit type
- PCI Express cards - x1 / x16, through XPRS host cards.
The USB2 and XPRS lines of products are supported under a number of operating systems :
- Windows - 7 and later / 64bit releases
- Linux - 5.xx kernels and later / 64bit releases
- Mac OS X - 10.7 and later
Both USB2 and XPRS lines of products offer software support for developers through the SDKBUS product, which contains an API set and samples for dealing with peripheral cards based on - ISA, PCI and PCMCIA bus.
3. Hardware overview
The most popular microprocessors on the market are based on or compatible with Intel / AMD 64bit hardware and the instruction set.
A microprocessor can be represented as a combination of:
- address lines,
- data lines,
- and control lines.
The size (width) of the address lines of the modern Intel (or compatible) microprocessors can be 64bit. The size (width) of the data lines can be 64bit as well.
Historically, since the first Intel microprocessors, the address space includes:
- physical memory space - currently 32 or 64bit address width
- input/output (i/o) space - 16bit address width
A modern day computer system can be put together using:
- a microprocessor
- memory
- peripheral chips and components
An older computer system allow extending its functionality using peripheral cards based on :
- ISA bus - for desktops
- PCMCIA bus - for notebooks
A modern day computer system provides a way of extending its functionality using peripheral cards on - PCI bus.
The PCI bus itself may extend to devices based on:
- USB
- Firewire
- Ethernet
- PCI Express
- ExpressCard
- etc. ...
National Instruments broadly divides the devices serviced on :
- message based - for ex. based on Ethernet, GPIB, Serial, USB, Firewire
- register based - for ex. based on VXI, PXI/PCI
However even the message based devices, are a collection of registers, and are controlled by these registers.
One hardware peripheral device is a collection of one or more of the following resources:
- physical memory registers
- i/o ports registers
- IRQ channels
- DMA channels (ISA bus only)
Examples :
- serial port - 8 i/o port registers, 1 IRQ channel
- USB host controller - 256 physical memory registers, 1 IRQ channel
- etc. ...
4. What ARS Technologies is offering
Our USB2 and XPRS lines of products allow connecting of - ISA, PCI, and PCMCIA peripheral cards, on a variety of computer systems - desktops, notebooks, embedded.
The connected peripheral cards are scanned and configured and the peripheral devices on them appear as a combination of resources - i/o ports, physical memory registers, IRQ channels, DMA channels.
We offer a subset of our API set from our commercial product - SDKBUS, to customers of the products of National Instruments.
It is available as part of our installation software.
Our offering covers 2 cases -
4.1. For Developers and users of older hardware and older NI software
New releases of the software packages of NI no longer support ISA cards and 16 bit PCMCIA cards.
The developers can rebuild older software, using our API set, to use older hardware with the latest software packages of NI.
Older hardware - ISA, PCI, PCMCIA cards, initially supported under older Windows releases, may now be used on computers running a variety of operating systems including new Windows releases, Linux, and Mac OS X.
In addition hardware cards suited for use on one type of computer system, may be used on another type of system, for example:
- use of ISA and PCI cards on notebook systems
- use of ISA and 16bit PCMCIA cards on desktop systems
- use of ISA and 16bit PCMCIA cards on embedded systems with no bus slots
4.2. For Developers and users of new hardware and software
ISA cards and 16 bit PCMCIA cards are very easy to develop, implement, and test as a hardware.
Developers of new ISA, PCI, PCMCIA cards have more freedom with the size, and dimensions of the cards, and the power budget / currents consumed of the peripheral cards.
In addition, developers no longer need to deal with :
- device drivers - under Windows
- loadable kernel modules - under Linux
- kernel extensions - under Mac OS X
Hardware cards developed for use on one type of computer system, may be used on another type of system, as shown :
- use of ISA and PCI cards on notebook systems
- use of ISA and 16bit PCMCIA cards on desktop systems
- use of ISA and 16bit PCMCIA cards on embedded systems with no bus slots
5. API set
The NI's Virtual Instrument System Architecture, or VISA there are two styles for accessing registers of a hardware device:
*** High-Level Access, including :
High-Level Access Read - viIn8(),viIn16(),viIn32()
High-Level Access Write - viOut8(), viOut16(), viOut32()
High-Level Block Read - viMoveIn8(), viMoveIn16(), viMoveIn32()
High-Level Block Write - viMoveOut8(), viMoveOut16(), viMoveOut32()
*** Low-Level Access, including :
Low-Level Access Read - viPeek8(), viPeek16(), viPeek32()
Low-Level Access Write - viPoke8(), viPoke16(), viPoke32()
The above commands are not quite clear on whether the access is to - i/o ports, or physical memory areas of a hardware device.
In addition, if dealing with memory, a question arises whether the memory address is physical, or virtual (used by paging enabled processor).
Application callbacks for handling IRQ events are available in C/C++, but not in LabVIEW or Visual Basic. Callbacks in C are registered with the viInstallHandler() operation . After installing an interrupt handler and enabling the appropriate event(s), an event occurrence causes VISA to invoke the callback.
ARS Technologies offers:
*** commands used for direct access to i/o ports -
in8/16/32() - returns 1/2/4 bytes of data read from the i/o address
out8/16/32() - writes 1/2/4 bytes of data to i/o address
*** commands used for direct access to physical memory -
rd8/16/32() - returns 1/2/4 bytes of data read from the physical memory address
wr8/16/32() - writes 1/2/4 bytes of data to physical memory address
*** commands used for getting an amount of data on i/o FIFO ports -
in8/16/32Buf() - returns an amount of data read from the i/o FIFO address
out8/16/32Buf() - writes an amount of data to i/o FIFO address
*** commands used for getting an amount of data on physical memory -
rd8/16/32Buf() - returns an amount of data read from the physical memory address range
wr8/16/32Buf() - writes an amount of data on of data to physical memory address range
*** a command used for checking the IRQ/DMA channels -
GetIrqDmaSts() - get the IRQ and DMA lines status; allows polling of the channels; may be included in a thread or a timer routine, to invoke a callback or service handler;
The above commands may be used not only under VISA environment, but on all of the NI's interfaces and environments, under Windows, Linux, Mac OS X.
The API set is available as 'C' functions. Under Windows environment there is VisualBasic API set offered as well.
6. Working sample of use
6.1 Pre-requisites
To illustrate the use of the API set we offer one sample which can be built and used in real world conditions.
The sample uses one of our USB2ISA family cards - you will need to order one, download the installation software, setup the software, and get familiar with our user's guide.
Different environments may have some specific requirements for installing and setup.
In addition, the sample uses 2 ISA cards :
- standard ISA i/o card which includes - 1 floppy and 1 ide controllers, 1 parallel, 2 serial ports; this type of card was popular in the past - with dozens of different manufacturers, and millions of cards produced;
- standard ISA VGA card; popular in the past as well - with lots of different manufacturers and cards produced;
You can mount USB2ISA + ISA cards, and connect/disconnect to USB. The ARSTech Enumerator will show auto detected resources for the connected ISA card - i/o ports, memory area, IRQ channels.
If some resources are not detected, they can be added manually in the Enumerator.
The resources of the particular used ISA cards may appear as :
*** ISA i/o card - i/o ports: 278/8, 5f0/8, 7f0/10 | irq: 4,7,14
device interpretation:
- i/o port x278/8 + irq 7 are the resources for LPT2, as selected by the jumpers on the particular isa card;
- i/o port x5f0/8 + irq 14 are the resources for the IDE controller; initially located at i/o address x1f0; the enumerator 're-located' it with x400 to avoid a collision with the controller on the motherboard of the system;
- i/o port x7f0/10 + irq 4 are several devices; the address is i/o x3f0 're-located' with x400 to avoid a collision; x7f0-7f3 are floppy controller ports, the irq6 is not connected by jumpers; i/o x7f6-7f7 are IDE ports; i/o x7f8-7ff + irq 4 are the COM1 ports; COM2 ports and irq are not connected / enabled by jumpers;
*** ISA VGA card - i/o ports: i/o ports x3c0/10 | irq 9 | physical memory xc0000/8000
device interpretation:
- the card is has a video BIOS area - x0c0000/8000, which has to be executed in order to initialize and 'see' the video ram area - x0a0000+ ; the video card is controlled through the i/o ports and irq channel;
6.2. Building of the 'isarw' sample
Almost identical 'C/Cpp' source code is placed in a number of folders for the different environments - Windows, Linux, Mac OS X.
In this way identical source code can be used for cross platform development.
Windows folder includes 2 samples built with - Visual C and cygwin.
Linux, and Mac OS X come with the GCC compiler environment - already pre-installed.
We provide a Windows/Mac OS/Linux 64bit shared library / dll containing our API set .
6.3. Running of the 'isarw' sample
The 'isarw' sample contains 3 sub-tests :
a) i/o read/write test
- uses USB2ISA with an ISA i/o card - uses the parallel port portion of the card
- does write to the par.port - digital outputs, which may be observed with a voltmeter on the 25pin connector
- exercises in/out8() - single 8bit i/o port read/write commands of the API set
b) irq test
- uses USB2ISA with an ISA i/o card - uses the parallel port portion of the card; requires an additional wire connecting 2 pins on the 25 pin con.
- exercises GetIrqDmaSts(), in/out8() - checking irq and dma status, and single 8bit i/o port read/write commands of the API set
c) physical memory buffer read test
- uses USB2ISA with an ISA VGA card - uses the VGA BIOS on the card
- does a single read of a portion of the VGA BIOS
- exercises rd16Buf() - 16bit phys.mem. buffer read commands of the API set