LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Get List of Connected Devices (USB, GPIB, etc)

Solved!
Go to solution

For GPIB (actually GPIB devices connected to GPIB to USB cable) I do:

 

 

static short addrList[31];
	static short listList[31];
    
	for (j=0;j<31;j++) {
		addrList[j] = j;	
	}
	addrList[30] = -1;
	
	SendIFC(0);
	FindLstn(0,addrList,listList,30);

 

 

But not sure how I would do other ports such as USB.  i can see it in MAX but it just seems to automatically appear.

 

Message 1 of 4
(7,090 Views)
Solution
Accepted by topic author ngay528

Hi,

 

personally I use VISA. For finding all available serial ports I use viFindRsrc ( resource_manager_handle, "ASRL[0-9]*::?*INSTR", &find_handle, &return_count, instrument_descriptor ); for GPIB you would use "GPIB[0-9]*::?*INSTR" as the second argument.

Message 2 of 4
(7,075 Views)

That actually worked pretty well!  I just did the generic search of "?*INSTR".  As I go through each Item, I can get its properties, port, etc.

 

Kudos & Thanks,

Nick

0 Kudos
Message 3 of 4
(7,041 Views)

You're welcome! Smiley Happy

Message 4 of 4
(7,035 Views)