To download NI software, including the products shown below, visit ni.com/downloads.
This document explains how you can obtain a list of only the COM ports while using VISA Find Resource.vi.
You can do this by filtering through the VISA Resource Names returned by VISA Find Resources.vi. In a For loop, use VISA Open to open each resource, then use a Property Node to obtain the Interface Description (Properties » Interface Information » Interface Description). This property details whether a resource is a COM port or an LPT port. Using this information, you can discern which type it is with Match Pattern and a Conditional terminal. Use VISA Close to close the reference.
The below VI snippet shows an example of how to do this.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.