Page 1 of 1
Can't not simulate when using Serial Port
Posted: Wed Feb 29, 2012 6:22 am
by ajack
Hi,
It confuses me a little bit with this minor problem: when I try to run iX program to simulate my coding, which contains SerialPort method.
- error.PNG (17.13 KiB) Viewed 14085 times
Actually, I can run this code before and nothing happens! It has just happened recently after few changing in code itself. But, I did open the good one but nothings changed!
Re: Can't not simulate when using Serial Port
Posted: Wed Feb 29, 2012 10:17 am
by Skylar
Could you also post the log file? That would probably help us determine what is happening.
Re: Can't not simulate when using Serial Port
Posted: Wed Feb 29, 2012 8:38 pm
by ajack
This is the log file.
Thanks,
Phong Duong
Re: Can't not simulate when using Serial Port
Posted: Thu Mar 01, 2012 11:25 am
by Skylar
Phong,
It looks like there could be a few errors in the code. Can you send me your project? I will PM my email address to you.
Re: Can't not simulate when using Serial Port
Posted: Thu Mar 01, 2012 6:39 pm
by ajack
Dear Skylar,
This is my project, which is using Serial Port to send data through RS232.
Best regards,
Phong Duong
Re: Can't not simulate when using Serial Port
Posted: Fri Mar 02, 2012 11:59 am
by Skylar
Phong,
It looks like the issue deals with the COM port you are trying to open on line 48. If that port does not exist on the host machine, an exception will be thrown. For example, on my PC I have COM 1 and COM 2... If I change line 48 to read:
sPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
Everything works fine. I hope that helps!
Re: Can't not simulate when using Serial Port
Posted: Fri Mar 02, 2012 7:16 pm
by ajack
Dear Skylar,
I really appreciate your help!
Best regards,
Phong Duong
Re: Can't not simulate when using Serial Port
Posted: Mon Mar 05, 2012 9:38 am
by Skylar
Glad that helps!