Can't not simulate when using Serial Port

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
ajack
Posts: 44
Joined: Wed Feb 22, 2012 12:01 am

Can't not simulate when using Serial Port

Post 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
error.PNG (17.13 KiB) Viewed 10976 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!

Skylar
Posts: 42
Joined: Wed Jan 04, 2012 11:17 am

Re: Can't not simulate when using Serial Port

Post by Skylar »

Could you also post the log file? That would probably help us determine what is happening.
Best Regards,

Beijer Electronics, Inc.
Skylar Walker | Applications Engineer

ajack
Posts: 44
Joined: Wed Feb 22, 2012 12:01 am

Re: Can't not simulate when using Serial Port

Post by ajack »

This is the log file.

Thanks,

Phong Duong
Attachments
Log.zip
(3.28 KiB) Downloaded 557 times

Skylar
Posts: 42
Joined: Wed Jan 04, 2012 11:17 am

Re: Can't not simulate when using Serial Port

Post 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.
Best Regards,

Beijer Electronics, Inc.
Skylar Walker | Applications Engineer

ajack
Posts: 44
Joined: Wed Feb 22, 2012 12:01 am

Re: Can't not simulate when using Serial Port

Post by ajack »

Dear Skylar,

This is my project, which is using Serial Port to send data through RS232.

Best regards,

Phong Duong
Attachments
SimpleSerialTmrEx.zip
(36.51 KiB) Downloaded 521 times

Skylar
Posts: 42
Joined: Wed Jan 04, 2012 11:17 am

Re: Can't not simulate when using Serial Port

Post 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!
Best Regards,

Beijer Electronics, Inc.
Skylar Walker | Applications Engineer

ajack
Posts: 44
Joined: Wed Feb 22, 2012 12:01 am

Re: Can't not simulate when using Serial Port

Post by ajack »

Dear Skylar,

I really appreciate your help!

Best regards,

Phong Duong

Skylar
Posts: 42
Joined: Wed Jan 04, 2012 11:17 am

Re: Can't not simulate when using Serial Port

Post by Skylar »

Glad that helps!
Best Regards,

Beijer Electronics, Inc.
Skylar Walker | Applications Engineer

Post Reply