09-03-2013 10:16 AM
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?
09-06-2013 07:27 AM - edited 09-06-2013 07:43 AM
Hi MicWal,
not all components do have a serial number. What device's serial number are you trying to read?
09-09-2013 06:03 AM
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".