Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Computer as 'black box' between contoller and device

Hallo,

I am trying to develop some sort of 'computer black box' (a computer
with a GPIB - board and some software) to catch all GPIB commands
from a controller to a device and back.
The commands from the controller must be interpreted by the 'black box'
and then send to the device - and the other way around.

Has anybody some ideas how to do this? I would be VERY happy to
get some sample code in c/c++.

Thanks in advance,
Carsten.

P.S.: My problem is that it seems that I have 2 contoller on the bus at some

time which causes problems.
0 Kudos
Message 1 of 5
(4,809 Views)
In article <38e34a12@newsgroups.ni.com>,
"Carsten Gruening" wrote:
>
> Hallo,
>
> I am trying to develop some sort of 'computer black box' (a computer
> with a GPIB - board and some software) to catch all GPIB commands
> from a controller to a device and back.
> The commands from the controller must be interpreted by the 'black
box'
> and then send to the device - and the other way around.
>
> Has anybody some ideas how to do this? I would be VERY happy to
> get some sample code in c/c++.
>
> Thanks in advance,
> Carsten.
>
> P.S.: My problem is that it seems that I have 2 contoller on the bus
at some
>
> time which causes problems.
>
Hello,

After tons of investigation, I finally found a way to put a PC on a
GPIB bus and lis
ten to all GPIB transactions between controller and
device. This in itself was quite a feat. In order for you to put a PC
in between a controller and a device, you would have to make the PC the
slave and the controller which is quite difficult. You would definetly
have to mess around with the controller code so that it would allow
other devices to become controllers. I'd probably reccomend two GPIB
cards in the 'black box'. A lot more expensive but a hell of a lot
easier.

Andrew Geissler


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 2 of 5
(4,809 Views)
You may be interested in some of our GPIB controllers w/ on-board analyzer
hardware, which allow you to monitor all commands and traffic on the bus. For
example, check out
http://sine.ni.com/apps/we/nioc.vp?lang=US&pc=mn&cid=1875
and
http://www.ni.com/support/trouble/gpib/max/analyzer.htm
for more information.

Regards,
Rich Yavorsky
NI

Carsten Gruening wrote:

> Hallo,
>
> I am trying to develop some sort of 'computer black box' (a computer
> with a GPIB - board and some software) to catch all GPIB commands
> from a controller to a device and back.
> The commands from the controller must be interpreted by the 'black box'
> and then send to the device - and the other way around.
>
> Has anybody some ideas how to do this? I would be VERY ha
ppy to
> get some sample code in c/c++.
>
> Thanks in advance,
> Carsten.
>
> P.S.: My problem is that it seems that I have 2 contoller on the bus at some
>
> time which causes problems.
0 Kudos
Message 3 of 5
(4,809 Views)
How does the device talk to the "black box"? If it is GPIB then you
need to implement a controller in charge scheme where the "black box"
tells the "controller" it needs to take over the bus. The "controller"
then can stop being in charge and the "black box" can take control of
the bus. You need to be careful though if there are other items on the
bus hat the "black box" would know what to do if a SRQ fro example came
in. If the "device" isn't on gpib the you just use the "black box" in a
slave mode and listen for commands to itself. Then a parser for any
commands can be built and the "device" controlled that way, with the
"black box" in the middle handling all the traffic. If the "device" is
on the gpib a second card could be added to the "black box" and an

interpreter is once again used to take commands from the "controller"
and pass them to the "device" bus. You chose. NI has sample code for
using a pc as a slave device. They might have a sample that also deals
with the controller in charge protocol.

It is manageable. I've got an exitsing system that handles commands
through a parser/interpreter and passes data to and from a group of
instruments not on a gpib bus.

Let me know if I can help anymore.

John Dempsey

Carsten Gruening wrote:
>
> Hallo,
>
> I am trying to develop some sort of 'computer black box' (a computer
> with a GPIB - board and some software) to catch all GPIB commands
> from a controller to a device and back.
> The commands from the controller must be interpreted by the 'black box'
> and then send to the device - and the other way around.
>
> Has anybody some ideas how to do this? I would be VERY happy to
> get some sample code in c/c++.
>
> Thanks in advance,
> Carsten.
>
> P.S.: My problem is that it see
ms that I have 2 contoller on the bus at some
>
> time which causes problems.
0 Kudos
Message 4 of 5
(4,809 Views)
Yes, this can, and HAS been done! Admittedly, this is an ADVANCED GPIB
application!

WHY would you want to do this? You may need to have the "black box computer"
translate GPIB commands originally intended for one instrument, so you can use a
newer replacement instrument. It may be the case that the original source code
and/or developement software tools are no longer available. (Think old,
military projects.)

On the other hand, if you just need to log GPIB traffic, and pass it on, then
NI's GPIB+ Analyzer card is all you need.

But if you really need to modify the GPIB commands on the fly, then you need TWO
GPIB cards in the black box computer.

The first card is setup/programmed to NOT be a system controller, and board
level IBRD and IBWRT calls are made to receive and send GPIB messages with the
(main) GPIB controller. Just put the IBRD and IBWRT in a loop, and use a short
timeout, say .1 second. Most of the time, these will timeout. But when the
(main) controller sends a message, the IBRD won't timeout, and your program then
knows it has recieved a new GPIB message from the main controller. Likewise,
when you need to send a response back to the main controller, just keep calling
IBWRT until it doesn't time out, then you know the main controller received it.

The second GPIB would be setup/programmed in the normal way, as GPIB system
controller.

The application software running on the black box computer would recieve a GPIB
message on the first (talker/listener) GPIB, process it in some way, then send
it to the instrument on the second (controller) GPIB.

I myself wrote a program for Tektronix TLA700 logic analyzers that makes the NI
PCMCIA-GPIB controller card behave exactly like a GPIB Talker/Listner. The
program parses the received GPIB commands and executes them by making calls to
the TLA700 software. This program was written in VB6 and is available from
Tektronix.

(note: I no longer work for Tek...)

Good luck!

--
Best Regards,
Mike T

Mike Tranchemontagne
Consulting Applications Engineer
TeraComm, Inc.
148 Main Street
Building A, 3rd Floor
North Andover, MA 01845
877-900-TERA (8372)
978-557-9490 (FAX)
603-598-4773 (Direct Line and Cell)


Carsten Gruening wrote:

> Hallo,
>
> I am trying to develop some sort of 'computer black box' (a computer
> with a GPIB - board and some software) to catch all GPIB commands
> from a controller to a device and back.
> The commands from the controller must be interpreted by the 'black box'
> and then send to the device - and the other way around.
>
> Has anybody some ideas how to do this? I would be VERY happy to
> get some sample code in c/c++.
>
> Thanks in advance,
> Carsten.
>
> P.S.: My problem is that it seems that I have 2 contoller on the bus at some
>
> time which causes problems.
0 Kudos
Message 5 of 5
(4,809 Views)