Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5378

viFindRsrc using VI_ATTR_USB_SERIAL_NUM

$
0
0

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.


Viewing all articles
Browse latest Browse all 5378

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>