<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: COMport problem in LabWindows/CVI</title>
    <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/4014402#M82425</link>
    <description>&lt;P&gt;USB com port can be shown setting the query type to Win32_PnPEntity that should list all devices. At least this is what I see on my desk with 2 different PCs and different port types, one of which with FDTY chip. If you don't see any port I would like to understand where the listing code stops enumerating devices, if you can run it with a breakpoint in GetPortsData (line 679).&lt;/P&gt;</description>
    <pubDate>Thu, 13 Feb 2020 16:17:47 GMT</pubDate>
    <dc:creator>RobertoBozzolo</dc:creator>
    <dc:date>2020-02-13T16:17:47Z</dc:date>
    <item>
      <title>COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/961884#M42442</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is another newbie problem on RS232, because I have a USB to Com (FTDI) interface, and PC is registering it as the last COM available, say I have previous Com1 and COm2, then when I plug the USB to COm interface it has Com22 assigned by XP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What&amp;nbsp; want my program in CVI is to enumerate all available COMport and select the last Com automatically. How can I do this&amp;nbsp; in CVI? Hopefully someone can provide me a sample code for this. Thank you in advance. &lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2009 07:08:25 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/961884#M42442</guid>
      <dc:creator>cblog16</dc:creator>
      <dc:date>2009-08-11T07:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/962002#M42444</link>
      <description>&lt;P&gt;See &lt;A href="http://forums.ni.com/ni/board/message?board.id=180&amp;amp;message.id=16380#M16380" target="_self"&gt;this thread&lt;/A&gt;, which contains a download of a DLL I wrote some time ago to enumerate the COM ports and find ones with specific names. It uses the Windows Setup API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote it as a DLL because, at the time, CVI had problems compiling the Setup API header files. That is no longer the case, so you could probably quite easily modify the source code to compile within CVI directly. &lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by msaxon on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 08-11-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 11:53 AM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 11 Aug 2009 10:53:58 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/962002#M42444</guid>
      <dc:creator>msaxon</dc:creator>
      <dc:date>2009-08-11T10:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/962511#M42452</link>
      <description>&lt;P&gt;Hi Martin,&lt;BR /&gt;&lt;BR /&gt;Thanks for posting that DLL, that's pretty awesome! You should consider posting it to the &lt;A href="http://community.ni.com" target="_self"&gt;community&lt;/A&gt; as an example so that it's more accessible to people that search on ni.com!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2009 20:08:01 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/962511#M42452</guid>
      <dc:creator>Jervin Justin</dc:creator>
      <dc:date>2009-08-11T20:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/962646#M42454</link>
      <description>thank you Martin for the help. Really appreciate it.</description>
      <pubDate>Wed, 12 Aug 2009 00:59:22 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/962646#M42454</guid>
      <dc:creator>cblog16</dc:creator>
      <dc:date>2009-08-12T00:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/963023#M42458</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;msaxon wrote:&amp;nbsp; &lt;P&gt;I wrote it as a DLL because, at the time, CVI had problems compiling the Setup API header files. That is no longer the case, so you could probably quite easily modify the source code to compile within CVI directly. &lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because I am old and decrepit, I had completely forgotten that I have already translated the source code to compile in CVI. A sample CVI 9 project containing the source code and a simple application to use it is attached.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2009 14:03:11 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/963023#M42458</guid>
      <dc:creator>msaxon</dc:creator>
      <dc:date>2009-08-12T14:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/973225#M42679</link>
      <description>&lt;P&gt;Hello Martin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for bringing this back again, the sample do the job fine as expected to be, though i run out on problem the given sample because of the redeclaration upon compiling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But my followup question would be, how can I select the last COMport scanned, so that the last COM will be the one to be used on either OpenComConfig or OpenCom under comport parameter. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I can use err= OpenCom(theLastCom,"") &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;James &lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2009 09:00:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/973225#M42679</guid>
      <dc:creator>cblog16</dc:creator>
      <dc:date>2009-08-27T09:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/973229#M42680</link>
      <description>&lt;P&gt;For follow-up, same scenario for the provided sample of CVI usng VISA on FindRsrc.c , I want to use the resource or COM last scanned.&lt;/P&gt;&lt;P&gt;So if it found 3 say&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3 instruments, serial ports, and other resources found:&lt;BR /&gt;&lt;BR /&gt;ASRL1::INSTR&lt;BR /&gt;ASRL10::INSTR&lt;BR /&gt;ASRL22::INSTR&lt;BR /&gt;&lt;BR /&gt;How can select the last resource scanned the ASRL22::INSTR, so I can place that on&lt;/P&gt;&lt;P&gt;status = viOpen (defaultRM, "ASRL22::INSTR", VI_NULL, VI_NULL, &amp;amp;instr);&amp;nbsp; dynamically&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2009 09:11:41 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/973229#M42680</guid>
      <dc:creator>cblog16</dc:creator>
      <dc:date>2009-08-27T09:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/974591#M42730</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take a look at the viFindNext operation on line 87 of the FindRsrc.c example (which installs with the NI-VISA driver). You can just loop through them until the final element, and you can know how many devices you have to go through to find the last one by using the numInstrs value that the viFindRsrc sets. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the Help for the viFindRsrc(), "The Find Handle, can be used in subsequent calls to the viFindNext operation to retrieve descriptor strings for the remaining instruments that were found."&amp;nbsp; The Find Handle is the parameter findList in the example.&amp;nbsp; &lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2009 21:26:06 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/974591#M42730</guid>
      <dc:creator>EadieU</dc:creator>
      <dc:date>2009-08-28T21:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/975747#M42775</link>
      <description>&lt;P&gt;Hello Mark,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for the help, I know this is spoon feeding (sorry for being a new ), is it possible if I can ask some code snippet on how can I accomplish this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;James &lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2009 08:16:14 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/975747#M42775</guid>
      <dc:creator>cblog16</dc:creator>
      <dc:date>2009-09-01T08:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/975807#M42776</link>
      <description>&lt;P&gt;I tried by inserting lines on the &lt;SPAN class="noindex"&gt;FindRsrc.c and it display the last scanned resource on the textbox but I dont know if this is the right thing to do.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The next question would be, how could I automatically send the Enter key without physically press the Enter key on the keyboard?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to give an idea on what I am trying to achieve,&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Open the Last scanned port.&lt;/P&gt;&lt;P&gt;2. Send Enter key to interrupt the booting of the DUT&lt;/P&gt;&lt;P&gt;3. Send reset command to the DUT&lt;/P&gt;&lt;P&gt;4. Read the response of the DUT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2009 10:28:12 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/975807#M42776</guid>
      <dc:creator>cblog16</dc:creator>
      <dc:date>2009-09-01T10:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/977057#M42809</link>
      <description>&lt;P&gt;Hi cblog16, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand correctly, you are trying to send a command with an enter key to your instrument? The enter key can be represented by "\r\n".&amp;nbsp; Also, I do want to note that certain instruments do require different ending characters.&amp;nbsp; This can be found in the user manual for the instrument.&amp;nbsp; Commonly, they are "\r" which is a carriage return and "\n" which is a new line, or a combination of the two.&amp;nbsp; I hope this helps! &amp;nbsp;  &lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2009 20:36:15 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/977057#M42809</guid>
      <dc:creator>Kelly_R</dc:creator>
      <dc:date>2009-09-02T20:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/977407#M42817</link>
      <description>&lt;P&gt;Hello Kelly,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I have just&amp;nbsp; send a command with "\r\n", and with reset command to the device, and the device responded to the reset. The next problem is, since the unit under test was reset, upon boot up it displays messages out of serial port,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. How can&amp;nbsp; I read those messages. and dsplay it on the textbox. I have tried to use&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;status=viRead(instr,buffer,strlen(buffer) ,&amp;amp;retCount)&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;but it returns nothing on&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SetCtrlVal(panelHandle,PANEL_TEXTBOX,buffer);&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i've set some timeout before the viRead, but I always got a timeout error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;status = viSetAttribute (instr, VI_ATTR_TMO_VALUE, 20000); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;same with other command,&lt;/P&gt;&lt;P&gt;if I issue say "check y1" -&amp;gt; this was executed fine and the unit under test should respond, "y1 passed", but when I try to read using viRead if I will get "y1 passed" nothing is displayed on the textbox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;note that , using teraterm, it is working fine. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2009 09:47:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/977407#M42817</guid>
      <dc:creator>cblog16</dc:creator>
      <dc:date>2009-09-03T09:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/977571#M42824</link>
      <description>&lt;P&gt;I'm not used to use VISA to access the serial port so I may be wrong, but I suppose that "strlen (buffer)" on viRead command can be dangerous in this situation: in that parameter you should the number of bytes to read from the port, so depending on wether you have initialized your 'buffer' variable or not you may be passing either 0 or some incoherent number on that parameter (hence the timeout).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you may try is to query the number of bytes ready to read and use that value as the 'count' parameter in viRead:&lt;/P&gt;&lt;P&gt;viGetAttribute (sessionHandle, VI_ATTR_ASRL_AVAIL_NUM, &amp;amp;bytes); &lt;/P&gt;&lt;P&gt;&lt;SPAN class="noindex"&gt;status=viRead (instr, buffer, bytes, &amp;amp;retCount)&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this can help. &lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2009 14:07:14 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/977571#M42824</guid>
      <dc:creator>RobertoBozzolo</dc:creator>
      <dc:date>2009-09-03T14:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/979197#M42897</link>
      <description>&lt;P&gt;Hello Roberto,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the help, appreciated it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have used the viGetAttribute previously though and same problem, all I get from the viRead is the command I have sent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I send a command using viWrite with example "y1 check" now, I need to read the response of the device which should have "y1 passed", but reading the port, yields me "y1 check" not "y1 passed" and to note that once I send the command "y1 check" the device response on the command (verified via device LED blink indicator".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Sep 2009 06:31:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/979197#M42897</guid>
      <dc:creator>cblog16</dc:creator>
      <dc:date>2009-09-07T06:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/3167557#M71075</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class="hps"&gt;Hello&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;Msaxon&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class="hps"&gt;Very good&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;DLL&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;locatecom&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;A&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;64-bit&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;version&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is very complex&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt; M&lt;SPAN class="hps"&gt;any greetings&lt;/SPAN&gt;&lt;BR /&gt; C&lt;SPAN class="hps"&gt;arlos&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2015 15:37:50 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/3167557#M71075</guid>
      <dc:creator>carlos789</dc:creator>
      <dc:date>2015-07-20T15:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/4013549#M82416</link>
      <description>&lt;P&gt;I have multiple FTDI usb to serial devices connected to the PC.&amp;nbsp; Each device is wired to a specific device.&amp;nbsp; I need to find the comport number assigned to each device.&amp;nbsp; If one device is used the supplied code works fine but it cannot identify each USB device indiviudually.&amp;nbsp; Can windows SDK commands be used to find a unique identifier for the device so I can determine the comport number for that specific FTDI device?&amp;nbsp; As you can see the devices have the same descriptor (different com numbers), and duplicate HWID's.&amp;nbsp; The hardware will be moved to different PC's so I will need to hard encode this "unique" id to find the correct port.&amp;nbsp; Any suggestions?&lt;/P&gt;
&lt;P&gt;HWID&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FTDIBUS\COMPORT&amp;amp;VID_0403&amp;amp;PID_6001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;USB Serial Port (COM16)&lt;/P&gt;
&lt;P&gt;FTDIBUS\COMPORT&amp;amp;VID_0403&amp;amp;PID_6001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;USB Serial Port (COM6)&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 16:49:51 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/4013549#M82416</guid>
      <dc:creator>Joncombat</dc:creator>
      <dc:date>2020-02-11T16:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/4014299#M82420</link>
      <description>&lt;P&gt;You may try retrieving informations on the devices with WMI: I have a StarTech ICUSB2322F USB-to-2-serial-ports device whose ports are identified this way both in DeviceID and PNPDeviceID:&lt;/P&gt;
&lt;P&gt;FTDIBUS\VID_0403+PID_6010+FTZ0Q7UG&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;A&lt;/FONT&gt;&lt;/STRONG&gt;\0000&lt;/P&gt;
&lt;P&gt;FTDIBUS\VID_0403+PID_6010+FTZ0Q7UG&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;B&lt;/FONT&gt;&lt;/STRONG&gt;\0000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to take a look at my example program on querying system info using WMI:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.ni.com/t5/LabWindows-CVI-User-Group/How-to-get-informations-on-the-system-through-WMI-in-CVI-Windows/ta-p/3505199" target="_blank" rel="noopener"&gt;How to get informations on the system through WMI in CVI (Windows Management Instrumentation)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The complete list of attributes associated with Win32:PnPEntity class can be found on &lt;A title="Win32_PnPEntity class" href="https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-pnpentity" target="_blank" rel="noopener"&gt;MSDN&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 12:41:08 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/4014299#M82420</guid>
      <dc:creator>RobertoBozzolo</dc:creator>
      <dc:date>2020-02-13T12:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/4014342#M82423</link>
      <description>&lt;P&gt;Thank you for the suggestion.&amp;nbsp; I ran the program but the USB ports do not show up.&amp;nbsp; I found some code that can read the pid/vid/sn of all usb devices connected to the PC.&amp;nbsp; I am trying to identify the actual comport number using this data.&amp;nbsp; The goal is to have an .ini file that will contain the USB vid/pid/sn and automatically find the enumerated comport.&amp;nbsp; This will allow the hardware to be used on multiple PC's without the operator having to configure comports.&amp;nbsp; Here is some code I pulled from the internet that can read the HWID data.&amp;nbsp; You must include the setupapi.lib file (c:\program files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\SetupAPI.Lib)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#include &amp;lt;windows.h&amp;gt; &lt;BR /&gt;#include &amp;lt;ansi_c.h&amp;gt;&lt;BR /&gt;#include &amp;lt;Setupapi.h&amp;gt;&lt;BR /&gt;#include &amp;lt;devguid.h&amp;gt;&lt;BR /&gt;#include &amp;lt;Setupapi.h&amp;gt;&lt;/P&gt;
&lt;P&gt;HDEVINFO deviceInfoSet;&lt;BR /&gt;GUID *guidDev = (GUID*) &amp;amp;GUID_DEVCLASS_USB; &lt;BR /&gt;TCHAR buffer [4000];&lt;BR /&gt;DWORD buffersize =4000;&lt;BR /&gt;int memberIndex = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;main()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;deviceInfoSet = SetupDiGetClassDevs(guidDev, NULL, NULL, DIGCF_PRESENT | DIGCF_PROFILE);&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;while (TRUE) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; SP_DEVINFO_DATA deviceInfoData;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ZeroMemory(&amp;amp;deviceInfoData, sizeof(SP_DEVINFO_DATA));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; deviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);&lt;BR /&gt;&amp;nbsp; if (SetupDiEnumDeviceInfo(deviceInfoSet, memberIndex, &amp;amp;deviceInfoData) == FALSE) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (GetLastError() == ERROR_NO_MORE_ITEMS)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;break;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; DWORD nSize=0 ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; SetupDiGetDeviceInstanceId (deviceInfoSet, &amp;amp;deviceInfoData, buffer, sizeof(buffer), &amp;amp;nSize);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; buffer [nSize] ='\0';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; printf ("%s\n", buffer);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; memberIndex++;&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp; if (deviceInfoSet) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; SetupDiDestroyDeviceInfoList(deviceInfoSet);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;getchar();&lt;BR /&gt;&amp;nbsp; return 0;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the program output, the first device is the one I am working with.&amp;nbsp; I just need to find a way using the SDK commands to find the friendly name that will contain the (COMx) number.&amp;nbsp; The MSN documentation is horrible, structures within structures without clear descriptions of what each function does.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;USB\VID_0403&amp;amp;PID_6001\FTH0DIT5&lt;/STRONG&gt;&lt;BR /&gt;USB\VID_413C&amp;amp;PID_2134\5&amp;amp;18054507&amp;amp;0&amp;amp;7&lt;BR /&gt;USB\VID_0A5C&amp;amp;PID_5832\0123456789ABCD&lt;BR /&gt;USB\ROOT_HUB30\4&amp;amp;1B12B7E5&amp;amp;0&amp;amp;0&lt;BR /&gt;PCI\VEN_8086&amp;amp;DEV_A12F&amp;amp;SUBSYS_07B01028&amp;amp;REV_31\3&amp;amp;11583659&amp;amp;0&amp;amp;A0&lt;BR /&gt;USB\VID_413C&amp;amp;PID_5534\5&amp;amp;18054507&amp;amp;0&amp;amp;22&lt;BR /&gt;USB\VID_047F&amp;amp;PID_C025\BD1C6365D53A417DA2CADCB8E8F5721C&lt;BR /&gt;USB\VID_413C&amp;amp;PID_2513\5&amp;amp;18054507&amp;amp;0&amp;amp;5&lt;BR /&gt;USB\VID_0C45&amp;amp;PID_6717\5&amp;amp;18054507&amp;amp;0&amp;amp;11&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 14:43:11 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/4014342#M82423</guid>
      <dc:creator>Joncombat</dc:creator>
      <dc:date>2020-02-13T14:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/4014402#M82425</link>
      <description>&lt;P&gt;USB com port can be shown setting the query type to Win32_PnPEntity that should list all devices. At least this is what I see on my desk with 2 different PCs and different port types, one of which with FDTY chip. If you don't see any port I would like to understand where the listing code stops enumerating devices, if you can run it with a breakpoint in GetPortsData (line 679).&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 16:17:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/4014402#M82425</guid>
      <dc:creator>RobertoBozzolo</dc:creator>
      <dc:date>2020-02-13T16:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: COMport problem</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/4014421#M82428</link>
      <description>&lt;P&gt;I didn’t see the switch on the GUI. That did it! I can see the PID/VID/SN info and the port number. I will strip out the necessary code to simplify the process. Thank you!&lt;/P&gt;
&lt;P&gt;I still want to find a solution using the windows commands, they have been bugging me!.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 17:07:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/COMport-problem/m-p/4014421#M82428</guid>
      <dc:creator>Joncombat</dc:creator>
      <dc:date>2020-02-13T17:07:04Z</dc:date>
    </item>
  </channel>
</rss>

