08-10-2023 04:25 AM
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