Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to configure GPIB-USB as non-controller using LabVIEW

I am trying to program a NI GPIB-USB-B to look like an instrument.  Using property nodes, I am able to read the configuration but not change the configuration.   I am suspecting that NI-MAX may be running in the background and causing the problem as the read configuration always follows the NI-MAX settings.

 

Any Ideas??

0 Kudos
Message 1 of 18
(5,340 Views)

Gary Y,

 

You are correct, many of the options for your GPIB-USB-B will need to be done in MAX, can I ask what specifically you are trying to change?

 

Eric K

Applications Engineering

National Instruments

0 Kudos
Message 2 of 18
(5,308 Views)

 

 

Hi,

I am not able to configure the GPIB USB for my machine. 

I have added the new interface in the gpib.conf

interface{
        minor = 0
        board_type = "ni_usb_gpib"
        name = "usb_connector"
        master = no
        pad = 0
        sad = 0
        timeout = T3s
}

 

But Running the gpib_config utility give the follwing error :

failed to configure boardtype: ni_usb_gpib
failed to configure board
main: Invalid argument

 

if i try loading firmware manually

fxload -D /proc/bus/usb/002/004 -I niusbb_firmware.hex -s niusbb_loader.hex

 

gives following error

 

write external: Connection timed out
unable to download niusbb_firmware.hex

 

I have installed the hotplug and fxload.

 

Any help in this regard is greatly appriciated.

 

Thanks,

HG

 



interface{
        minor = 0
        board_type = "ni_usb_gpib"
        name = "usb_connector"
        master = no
        pad = 0
        sad = 0
        timeout = T3s
}
0 Kudos
Message 3 of 18
(4,919 Views)

himanshu7gupta,

 

Have you been able to configure your device in MAX? Which device do you have? What operating system are you using?

National Instruments
0 Kudos
Message 4 of 18
(4,887 Views)

Hi D beil ,

I am able to configure the USB.

I am having GPIB-USB-HS( Nationa Instrumnets).

I am facing one issue i am not able to make the device as non controller.

 

For controller i am using the ibtest program given in the linux-gpib-3.2.14 examples. from ibtest i am opening the board and sending the command 33 for making other gpib device as listner. Now i am making the board terminal as talker device and sending the data.

 

Data sent is recived at the Non controller end now i am calling the ibwrt API for writing the response. For this again i am sending the command 65 for making the non controller as Talker now. But it is not getting change to talker the ibsta shows still the listner bit is set.

 

The behaviur is inconsitence one in ten time i am able  to make the device as listner and able to read the data through ibtest program.

 

I am working on non controller part only. Any help in this will be helpful

 

for non controller i am using the following program:

#include "gpib/ib.h"
#include <stdio.h>
#include <iostream>
#include <stdlib.h>

#include <unistd.h>

using namespace std;
static char buffer[100];
static int panelHandle;
static int noncontroller;

int main ()
{
   printf("entered main ");
   cout <<"entered main "<<endl;
   int err;
   // Open a session to the GPIB board

//   err = noncontroller = ibfind ("violet");
   err = noncontroller = ibfind ("usb_connector");
   //noncontroller = ibfind ("gpib0");
   cout <<"ibfind done "<<endl;
   cout << err << endl;


   // Release system control
   err = ibrsc (noncontroller, 0);  
   cout <<"released "<<endl;
   cout << err << endl;

   // Change primary address from 0 to 1
   err = ibpad (noncontroller, 1);  
   cout << err << endl;
   cout << "LACS="<<(err&LACS) << endl;
//   uint8_t ret = MLA (1);  
 //  cout << "MLA ="<<(int)ret << endl;

   while (1)
   {
      //cout <<"before ibwait "<<endl;
      // Update Status variable
      err = ibwait (noncontroller, 0);  
      cout <<"after ibwait  status =" <<err<<endl;
      //cout <<"after ibwait "<<endl;
      // Wait until non-controller is listener and ATN line is dropped.
      if ((ibsta&LACS)&&(!(ibsta&ATN)))  
      {
     cout <<"reading "<<endl;
         cout<<"LACS is set"<<endl;

         ibrd (noncontroller, buffer, 100);   // Read data bytes
         printf ("%s\n",buffer); //print buffer
         buffer[ibcnt] = '\n';   // Add linefeed and 0 to string.
         buffer[ibcnt + 1] = 0;
         printf ("%s",buffer); //print buffer
         //return 0;
     

      //Send (noncontroller, 0, "Iamat alker", 13, 0);  
      // If addressed to talk, send the response "I am a talker"
     if ((ibsta&TACS)&&(!(ibsta&ATN)))  
      {   
//     cout <<"writing "<<endl;
         cout<<"TACS is set"<<endl;
    // ibrsv(noncontroller, 64);
         // Send data across the bus.
         //ibwrt (noncontroller, "I am a talker", strlen("I am a talker"));  
         ibwrt (noncontroller, "I am a talker", 13);  
         //send (noncontroller, 0, "I am a talker", 13, 0);  
         //return 0;
      }   // second if
      //}
   }   // while
return 0;
}   // main

 

0 Kudos
Message 5 of 18
(4,806 Views)

Hi ,

I am getting this error while calling the ibwrt API:

RCI: ibutil.c:384: conf_lock_board: Assertion `conf->has_lock == 0' failed.

can any one tell how to resolve this.

 

0 Kudos
Message 6 of 18
(4,764 Views)

Hello,

 

That assert message is not of the form that our NI-488.2 driver asserts take.  From the message, I don't think that you are using the NI-488.2 driver to communicate with your NI GPIB USB interface.

 

Who-ever made your driver will be able to support this issue.

 

Thanks,

Steven T.

0 Kudos
Message 7 of 18
(4,744 Views)

himanshu,

 

I do not see command 65 being sent. Where in the code do you write that?

 

Also, what driver are you using? Is this the NI-488.2 driver? Or a third party driver?

National Instruments
0 Kudos
Message 8 of 18
(4,725 Views)

 I am getting error for calling ibclr(Devicedescriptor);

The error is EARG.

for otherAPI(ibrd,ibwrt) it is woking fine.

I am using NI drivers and GPIB-USB-HS on Linux system.

Any suggestion?

0 Kudos
Message 9 of 18
(4,600 Views)

Do we have to call ibonl() for every unsuccessful GPIB call (ibwrt , ibrd , ibclr ,ibpad) or when we are done with the device.

0 Kudos
Message 10 of 18
(4,599 Views)