I have a program that will program up to 256 devices over SerialPorts. (max in most Windows OS)
I would probably stick to 5 at a time.
I am going to multi-thread the program to do this and handle the reply from the external devices.
So for ## devices, do I need to declare ## SerialPort classes???
for example,
string [ ] myString = SerialPort.GetPortNames(); |
SerialPort [ ] mySerialPortArray = new SerialPort [ myString.Length ]; |
|
Array.Sort( myString ); |
|
for(int i = myString.Length - 1; i == 0; i++) |
{ |
mySerialPortArray [ i ].BaudRate = 115200; |
mySerialPortArray [ i ].DtrEnable = true; |
mySerialPortArray [ i ].Parity = Parity.None; |
mySerialPortArray [ i ].StopBits = StopBits.One; |
mySerialPortArray [ i ].DataBits = 8; |
mySerialPortArray [ i ].PortName = myString [ i ]; |
} |
|