03-24-2011 01:42 PM
Does anyone have experience using WMI to enumerate com ports from CVI?
Thanks for any info anyone can provide.
Menchar
03-28-2011 08:33 AM
Hi menchar,
I looked for some example code to accomplish this, but unfortunately I could not find anything. However, other engineers here may have experience with WMI and C or LabWindows CVI, so I would check this forum again after some time. Ultimately, WMI is Microsoft's product and your best bet is to contact them to find out the correct commands in C. Their forums may quickly be able to explain the commands you will need.
All the best on your project!
03-28-2011 02:15 PM
Well, getting info on a C interface from Microsoft isn't always easy.
This would seem to be a general issue for any CVI app that needs to interact with the PC HW, is there some other way to enumerate the installed com ports from a CVI application?
Thanks.
Menchar
03-28-2011 02:44 PM
Hi,
I assume you are aware of the code snippet by msaxon given here
and the possibility to use viFindRsrc ( resource_manager_handle, "ASRL[0-9]*::?*INSTR", &find_handle, &return_count, instrument_descriptor );
But somehow I missed why these approaches don't work in yor case?
Wolfgang
03-28-2011 02:47 PM
We're trying to port some existing VB code that is set up to use WMI - otherwise we wouldn't bother with it.
03-28-2011 03:18 PM
And we're looking for a string returned from WMI that identifies a particular port as being a USB to UART bridge (Silicon Labs CP210x), we have code that can retrieve this string from WMI but not any other way that we know of now.
03-29-2011 01:27 AM
Bob,
sorry if I am wasting your time, but would it be possible to use VISA with viGetAttribute (,VI_ATTR_MANF_ID,)?
03-29-2011 01:35 PM
I'll forward this and see if it works, it's another engineer that has the problem ...
Thanks for your interest.
Bob