LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

gpib command order

So, when I use ibdev in the 2nd controller (since it's not a controller, I should call it device A), the gpib0 you show in your previous e-mail is really the board index of the main (only) controller.  Is this right?
0 Kudos
Message 11 of 18
(1,590 Views)
Does MAX return the board index and primary address of the known devices?  At Device A (second controller), since it's like a Signal Generator, is there a runtime method of determining the board index that should be used?
0 Kudos
Message 12 of 18
(1,582 Views)

I finally got on the target and ran MAX.  On the main controller, I see this

Devices and Interfaces
    GPIB0 (PCI-GPIB)
        Instrument0
        Instrument1

The properties for GPIB0 show that "System Controller" has a check mark.  It also shows its GPIB Interface Number = 0.  Instrument0 primary address=18 and Instrument1 primary address=19
 
On the second controller, however, I see this
 

Devices and Interfaces
    GPIB0 (PCI-GPIB)
        Instrument0
        Instrument1
        Instrument2

GPIB Interface Number=0, Intrument0 Primary Address=0, Instrument1 primary address=18, Instrument2 primary address=19

When I highlight Instument0, under the Identification field, it says "Instrument did not respond to the *idn? Query"

I'm a little confused in that it seems that the GPIB in the second box is not only referred to as GPIB0, but also as intrument0.  Also, does it matter that in the main controller, the devices I want to talk to are referred to as Instrument0 and Instrument1, but in the second controller, the same devices (since they're both connected to the same devices) are referred to as Instrument1 and Instrument2?

 

0 Kudos
Message 13 of 18
(1,563 Views)

Hi mrbean:

Is this "second controller" another computer?  Do you have two computers with PCI-GPIB boards in them?  Is there any program running on the second controller or only the first one?  In MAX, on the second controller try changing the board index to 1 and try scan for instruments again on the first controller.  Does that bring up the second controller as another instrument?

Emilie S.

0 Kudos
Message 14 of 18
(1,550 Views)

Yes, the second 'controller' is another computer with its own gpib card.  The computers communicate via tcp/ip and both gpib cards are connected to the same signal generator (and spectrum analyzer - but he's not involved in the tests having problems).  The second computer receives commands from the first, telling it to ibdev, ibclr, ibsic, ibwrt, etc.  The test is supposed to ensure the second computer's gpib works.  This is done by the first computer telling the second to tune the signal generator to a certain freq, then the first is supposed to read the signal generator and ensure the desired freq was indeed set.

Are you saying that the first computer's gpib should be able to see the second computer's gpib through max, and that it should show up as another instrument?  When I see instrument0 at the second computer, is that a reference to the gpib on the first computer, or to itself?
0 Kudos
Message 15 of 18
(1,546 Views)

Hi mrbean:

Yes the first controller should see the second.  One thing in your post confused me though, it said the two computers are connected via tcp/ip, but they are communicating through GPIB right?  I believe this must be the case since you are sending GPIB commands from the first computer to the second. 

To regress a little though, you should only have the system controller box checked in the first controller.  Then for the second controller you should change its primary address to be something other than 0.  Then, when you scan for instruments in the first computer, it will find this other computer at the primary address you set.  (You can change the primary address by right clicking on the board in MAX and selecting properties.)  You will then only refer to it by its primary address, the board index doesn't matter.  So, if you give it PAD 1 then you would pass control as stated in a previous post by doing something like this:

second controller = ibdev (0, 1, 0....
ibpct (second controller)

At this point the second computer could run whatever code it has on it, then pass control back to the first computer.

Hope this helps out.

Emilie

0 Kudos
Message 16 of 18
(1,534 Views)

In one of your e-mail you said "... At this point this can be the only controller, the second controller is just an instrument with a primary address, this is where you should use ibdev.".  With what you know now, is this still the case.

Also, do you have any explanation for why I see two intruments under controller one and three instruments under controller two?

Finally, in MAX, when (for the second computer) I select properties and select GPIB0, GPIB1, etc, it gives me a drop down that shows DEV1 to DEV31.  I'm assuming this is the primary address of the second computer's gpib card.  Thoughts?

0 Kudos
Message 17 of 18
(1,525 Views)

In one of your e-mail you said "... At this point this can be the only controller, the second controller is just an instrument with a primary address, this is where you should use ibdev.".  With what you know now, is this still the case.

Yes this is the case.  You can only have one controller at a time.

Also, do you have any explanation for why I see two intruments under controller one and three instruments under controller two?

It could be that you have the system controller box checked on both computers, is this true?  I would expect you to see three instruments from the system controller.

Finally, in MAX, when (for the second computer) I select properties and select GPIB0, GPIB1, etc, it gives me a drop down that shows DEV1 to DEV31.  I'm assuming this is the primary address of the second computer's gpib card.  Thoughts?

First, you don't need to change GPIB0 to GPIB1, I was mistaken about that.  However you do need to change the primary address of the second controller to not be 0.  When you right click on the board and select properties, there should be a pull down menu labeled primary address.  This is where you should change the PAD.  What version of NI-488.2 are you using?

Emilie

0 Kudos
Message 18 of 18
(1,510 Views)