09-04-2014 10:25 AM
I'm trying to get the VISA resource string for a USB/RAW device based on the serial number. If I do
viFindRsrc(hRM, "/USB?*RAW{VI_ATTR_USB_SERIAL_NUM == 123456/789}", VI_NULL, &lCount, szBuffer);
I get VI_ERROR_RSRC_NFOUND. However, if I just use "/USB?*RAW" as the resource string, then go through the list, open a session to each device, and use
viGetAttribute(hSession, VI_ATTR_USB_SERIAL_NUM, szBuffer);
I can find the correct device by looking at szBuffer. Am I doing something wrong in the viFindRsrc call? Do I need to escape the / in the serial number, for instance? Or is going through the full list the only way to find the device?
Thanks in advance for your help.
Solved! Go to Solution.
09-08-2014 03:55 AM
Hi Tevildo,
It may be worth having at look at this KnowledgeBase article: How do I Find All VISA Instrument Resources Using LabWindows/CVI?
I hope this helps!
SFuller
09-08-2014 04:11 AM
Thanks - that's what I'm doing at the moment - I was wondering if it was possible just to use one call to viFindRsrc, rather than having to iterate through the entire list of instruments.
09-09-2014 06:52 AM
From what I've found so far, going through the full list is the only way to find the device.