Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Contacting a LAN/GPIB/USB Gateway via NIVISA on a Red Hat Linux 8.6 pc

Hello,

 

At imec we are trying to talk to a gpib instrument over a LAN/GPIB/USB Gateway box via NIVISA.

The following code executes ok on a Windows pc with NIVISA installed and returns the id of the measurement instrument:


#include <visa.h>
#include <stdio.h>
int main() {

ViStatus err;Red Hat Linux 8.6

ViSession defaultRM, vi;
char buf [256] = {0};
/* Open session to GPIB device at address 22 */
err = viOpenDefaultRM(&defaultRM);
err = viOpen(defaultRM,"TCPIP0::10.90.4.26::gpib0,11::INSTR",VI_NULL,VI_NULL, &vi);
/* Initialize device */
viPrintf(vi, "*RST\n");
/* Send an *IDN? string to the device */
viPrintf(vi, "*IDN?\n");
/* Read results */
viScanf(vi, "%t", buf);
/* Print results */
printf("Instrument identification string: %s\n", buf);
/* Close session */
viClose(vi);
viClose(defaultRM);
}


On Red Hat Linux 8.6 with ni-rhel8centos8-drivers-2020.rpm installed.
    Supported OS: Linux
    Version: 2021 Q3
    Included Editions: Full
    Application Bitness: 64-bit
    Language: English

 

I could open the default resource manager:

err = viOpenDefaultRM(&defaultRM);   ===> err = 0

 

But the opening of the resource manager to the Keithley failed:

err = viOpen(defaultRM,"TCPIP0::10.90.4.26::gpib0,11::INSTR",VI_NULL,VI_NULL, &vi);             ===> err = -1073807343 = VI_ERROR_RSRC_NFOUND

 

Do I have to do additional steps to make the Linux pc find the TCPIP gateway?

 

Regards,

Albert

0 Kudos
Message 1 of 1
(344 Views)