Is there a way to List the available serial ports in a drop down list on the client PC when using the serial module, I could do with a setup page to allow ‘engineers’ to change the assigned serial port number of a barcode scanner which is connected through a USB/Serial convertor, these can when plugged into different USB ports change there serial port assignment.
No idea how fast this would be, but you might try using Ignition’s system.serial module to try all COM ports (1…255). If you get a connection, close it and add the COM# to a list and then display the list.
I know this is a old post but for the next person who needs i wrote a quick little script that returns the active Serial ports and stores them in a dataset.
# """ Lists serial port names
#Create a list of Ports
ports = ['COM%s' % (i + 1) for i in range(256)]
#Place to store Active Ports
result = 
s = system.serial
#loop Through and try all the ports to find which are open
for port in ports:
print 'Connecting to Serial Port: ' + str(port)
#store active Ports
print 'Port added to active list: ' + str(port)
print 'PORT IS NOT ACTIVE: ' + str(port)
#Return the Dataset of Ports.
print'Start of Main'
#Call Module for finding Serial Ports.
ActivePorts = serial_ports()
#Print Available Ports
print'End of Main'
#Main Sub Call