LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

viFindRsrc using VI_ATTR_USB_SERIAL_NUM

Solved!
Go to solution

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.

0 Kudos
Message 1 of 4
(3,608 Views)

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

0 Kudos
Message 2 of 4
(3,571 Views)

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.

0 Kudos
Message 3 of 4
(3,569 Views)
Solution
Accepted by topic author Tevildo

From what I've found so far, going through the full list is the only way to find the device.

0 Kudos
Message 4 of 4
(3,544 Views)