Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the resource name or logical name for a device

I am working with Measurement Studio 7.1 and VB .NET. I have a connected Agilent Multimeter and have downloaded the appropriate driver for the device. As a change of pace I have decided to use the Instrument Driver Wizard to create a VB class that wraps the library files for the device driver. I have creates the wrapper class but in order to create a new instance of this wrapper I need to provide the device's resource name or logical name. How do I get this information?

The comments in the wrapper class give this example syntax to obtain the information:
GPIB[board]::<primary address>[::secondary address]::INSTR<LogicalName>

However, they do not say where to use it...just entering this as an argument into the parameter field with the appropriate addresses and such will obviously yield VB. NET compiler errors.

I've gone as far as to open MAX and create a logical name to associate with the driver session. I then used the logical name i created as my resource/logical name argument. This did not work.

Whatever I enter as the resource name I get this error:
"An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurred in MultimeterTest1.exe

Additional information: Primary Error: (Hex 0xBFFF0011) Insufficient location information or the requested device or resource is not present in the system."

Any help would be most appreciated as always.

~ Jeramy
CLA, CCVID, Certified Instructor
Message 1 of 4
(3,689 Views)
Figured it out!
The syntax they provide is correct...was just a little hard to understand what they meant.
For anyone else out there that has had this problem I'll explain it.

Here is a string that works: "GPIB::22::INSTR"

so their syntax...
GPIB[board]::[::secondary address]::INSTR
...makes sense but their brackets just confused the hell out of me

As long as you are using GPIB interface the first part of the string will be "GPIB" followed by the board index. If you do not put in a board index it will use 0 by default.
After that you need a "::" separator followed by the device's primary address.
You can then optionally add another "::" separator and secondary address (like so "GPIB0::22::5")
Finally you need a "::" separator followed by "INSTR"

The string gets decoded and eventually tells the class object you create to use the instrument on the GPIB board at the address you specify.

An example of the call to new would be such:
Private TheMultimeter as NAMEOFCLASS
TheMultimeter = New NAMEOFCLASS("GPIB::22::INSTR", False, False)

~ Jeramy
CLA, CCVID, Certified Instructor
Message 2 of 4
(3,682 Views)
HTML parser must have removed anything with triangle brackets on that last post...

their syntax should read:
"GPIB[board]::[::secondary address]::INSTR"
CLA, CCVID, Certified Instructor
0 Kudos
Message 3 of 4
(3,681 Views)
lol...ok...did it again, just see original post for syntax. : )
CLA, CCVID, Certified Instructor
0 Kudos
Message 4 of 4
(3,680 Views)