Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Open VISA session in c# to RIO0::INSTR cause error

Hi,

 

I use VisaNS.dll  version 13.0.40.167 in a Visual Studio 2010 c# application and try to open a visa session to RIO::INSTR.

HW is NI PXI-7842R

 

shortinterfacenum = 0;

HardwareInterfaceType interfacetype = HardwareInterfaceType.Pxi;

ResourceManager.GetLocalManager().ParseResource("RIO0::INSTR", out interfacetype, out interfacenum);

 

NI I/O Tracer

1.  viOpenDefaultRM (0x05F02E60)
Process ID: 0x000010B8         Thread ID: 0x00001BE0
Start Time: 17:03:58.620       Call Duration 00:00:00.024
Status: 0 (VI_SUCCESS)

2.  viParseRsrcEx (0x05F02E60, "RIO0::INSTR", 8, 0, "INSTR", "RIO0::INSTR", "RIO1")
Process ID: 0x000010B8         Thread ID: 0x00001BE0
Start Time: 17:03:58.648       Call Duration 00:00:00.035
Status: 0 (VI_SUCCESS)

3.  viClose (0x05F02E60)
Process ID: 0x000010B8         Thread ID: 0x00001BE0
Start Time: 17:03:58.684       Call Duration 00:00:00.002
Status: 0 (VI_SUCCESS)

 

private Session rbSession;

rbSession = (Session)ResourceManager.GetLocalManager().Open("RIO0::INSTR");

 

Exception During Open Visa Session to RIO

[System.MissingMethodException] = {"Constructor on type 'NationalInstruments.VisaNS.Session' not found."}

 

Access to NI PXI-7842R using PXI7::15::INSTR works and provides access reading attributes.

 

But I need access to the serial number described in Document ID: 4687QJ5K How Do I Programmatically Get Backplane Information of My RIO Device? but using the .NET Language

 

NI MAX is able to get the information


339.  viFindNext (0x046FBEB0, "RIO0::INSTR")
Process ID: 0x00000728         Thread ID: 0x0000163C
Start Time: 16:32:27.878       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

340.  viParseRsrc (0x025D8338, "RIO0::INSTR", 8, 0)
Process ID: 0x00000728         Thread ID: 0x0000163C
Start Time: 16:32:27.878       Call Duration 00:00:00.012
Status: 0 (VI_SUCCESS)

341.  viOpen (0x025D8338, "RIO0::INSTR", 4, 0, 0x04855700)
Process ID: 0x00000728         Thread ID: 0x0000163C
Start Time: 16:32:27.890       Call Duration 00:00:00.046
Status: 0 (VI_SUCCESS)

342.  viGetAttribute (RIO0::INSTR (0x04855700), RSRC_IMPL_VERSION, 0x0C10C001)
Process ID: 0x00000728         Thread ID: 0x0000163C
Start Time: 16:32:27.936       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

343.  viGetAttribute (RIO0::INSTR (0x04855700), RSRC_MANF_ID, 4086)
Process ID: 0x00000728         Thread ID: 0x0000163C
Start Time: 16:32:27.936       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

344.  viGetAttribute (RIO0::INSTR (0x04855700), INTF_INST_NAME, "RIO0 (NI PXI-78...s/n 0x0154560D)")
Process ID: 0x00000728         Thread ID: 0x0000163C
Start Time: 16:32:27.936       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

 

What is wrong?

 

 

0 Kudos
Message 1 of 3
(6,431 Views)

Hi MicWal,

 

not all components do have a serial number. What device's serial number are you trying to read?

0 Kudos
Message 2 of 3
(6,403 Views)

Hi Topper_Harley,

 

it is the NI PXI-7842R

 

NI MAX Devices and Interfaces shows the serial number and NI I/O Tracer reads from "RIO0::INSTR" via NISA GetAtribute of "INTF_INST_NAME" additional information including the serial number.

 

viGetAttribute (RIO0::INSTR (0x04855700), INTF_INST_NAME, "RIO0 (NI PXI-78...s/n 0x0154560D)")

 

I am trying to do it in a similar way like NI but I can not open a VISA session to "RIO0::INSTR".

0 Kudos
Message 3 of 3
(6,385 Views)