andygood
Posts: 5
Joined: Mon May 12, 2008 6:47 pm
Location: Ireland

System lockup with more than one SerialNET.Port

Fri Jun 06, 2008 6:23 pm

I have a question regarding the creation of more than one SerialNET.Port object. When I run the following code, my system locks up on execution of the last line:

SerialNET.Port m_Port1 = new SerialNET.Port();
m_Port1.ComPort = 40;
m_Port1.BaudRate = 9600;
m_Port1.Timeout = 5000;
m_Port1.Enabled = true;

SerialNET.Port m_Port2 = new SerialNET.Port();
m_Port2.ComPort = 41;
m_Port2.BaudRate = 9600;
m_Port2.Timeout = 5000;
m_Port2.Enabled = true;

Note the port numbers 40 and 41. These are two Bluetooth devices. Is the (Toshiba) bluetooth stack to blame? If I run the code using ports 1 and 2, there are no problems...

PLEASE NOTE: I've already resolved the issue using threads, so I'm really just posting this to get your opinion... [:)]

Thanks & regards,
Andy.

RonG
Posts: 2
Joined: Sat Aug 02, 2008 9:27 pm

RE: System lockup with more than one SerialNET.Port

Sat Aug 02, 2008 9:37 pm

I have two ports working OK on my HP device. Make sure you set the m_Portx.parent value. I have a main form, then created a class for the port, then instantiated a class for each port. Works just fine. No extra threads required, as SerialNET takes care of it.

Return to “SerialTools”