![]() |
Serial_GetUSBInfo |
Get USB information (if available) of the serial port with the specified name.
Syntax
Serial_GetUSBInfo ( switches ; portname )
Parameters
switches | specifies which information you want to get |
portname | the name of the serial port you want to get the USB information of |
Switches
switches can be one of this:
-Verbose | (default) returns a list of USB information about the port |
-USBVendorName | returns the vendor name of the USB port hardware |
-USBProductName | returns the product name of the USB hardware |
-USBSerialNumber | returns the serial number of the USB hardware |
-USBVendorID | returns the vendor ID as a hex number |
-USBProductID | returns the product ID of this hardware product as a hex number |
-USBLocationID | returns the location ID, indicating the (physical) location in the USB device tree |
Returned Result
Data type returned
Text
Result
The requested information.
If an error occurs an error code is returned. Returned error codes can be:
$$-50 | paramErr | parameter error |
Other errors may be returned.
Originated in
Troi Serial Plug-in 8.0
Compatibility
FileMaker Pro 18 to FileMaker Pro 2025
Considerations
A serial port can be implemented as virtual port on top of a USB port. When this is the case this function returns information about the USB (hardware) port, like the USB vendor name, USB Product name and USB Serial number.
If this serial port is not running on a USB port the function returns “<no USB information found>”.
If you specify no portname a list of information of all ports is returned.
v9.0 now also returns the location ID in the result and added the switch “-USBLocationID” which returns only the location ID.
The location ID of a serial USB port is a hexadecimal code which indicates the (physical) location in the USB device tree. For example 0x14200000 can indicate controller 1 -> USB hub 4 -> port 2. You can use the location ID to identify a USB serial device by determining which physical port it is plugged into.
Example
Set Field [ result ; Serial_GetUSBInfo ( "-Verbose" ; "usbmodem15501" ) ]
This returns the USB information of the usbmodem15501 serial port, and will be similar to this:
USB Vendor ID: 0x2a03
USB Product ID: 0x1043
USB Vendor Name: Arduino SRL
USB Product Name: US-123AB Serial Adapter
USB Serial Number: 12345678AB5B0
USB Location ID: 0x14400000
Example 2
Set Variable [ $USBSerialNumber ; Serial_GetUSBInfo ( "-USBSerialNumber" ; "usbmodem42501" ) ]
This returns the USB serial number of this USB port. If you have multiple USB devices attached to a computer you can use the USB serial number to distinguish between these similar USB ports.
Used in example file
Debug.fmp12
Related functions
Serial_GetPortInfo |
Serial_GetPortNames |
Related topics
Troi Serial Plug-in online help (overview)