NModbus used in vb.net application, GUI hangs while polling, what to do?

425 views
Skip to first unread message

shi...@gmail.com

unread,
Jul 30, 2007, 10:26:37 AM7/30/07
to NModbus
Hello,

We are using NModbus for a Data Acquisition Application, The
Application has a MDI form, and 5-6 Child forms. Which consists of
configuring slave nodes, tag blocks, com port setting, user access
control, database configuration and so on. When we start polling, we
can use any options in the application, not even stop option of
polling. It looks like the application has hanged, but polling will be
going on. If I want close the application I have End the process from
Task Manager. So please advise me how to handle this problem. When I
am polling I should able to work in the application.

Thanks in advance..

Shiddu

sja...@gmail.com

unread,
Jul 30, 2007, 4:00:02 PM7/30/07
to NModbus
I'm not sure what you're asking here exactly. You're unable to stop
the polling in your application? If you post some sample code
reproducing the problem I could be of more help.

Scott

Shiddu

unread,
Jul 31, 2007, 3:23:46 AM7/31/07
to NModbus...@googlegroups.com, sja...@gmail.com
Dear Scott

This is shiddu again, I am sending you the application which we have developed using Nmodbus.

When you start the application it starts reading registers from PLC with an interval of 1000ms. If I want to stop the polling and change any of the settings, I can not use any of the menu option or buttons, and even can not maximize if the window is minimized.

In simple sentence to tell you Once polling or reading registers from PLC starts I can not use GUI because of the continuous process of polling.
Is there any way to avoid this.

Hope you understand my problem now.

Thanks in advance

Shiddu
CurrentProject.rar

sja...@gmail.com

unread,
Jul 31, 2007, 1:22:06 PM7/31/07
to NModbus
You need to do your polling on a background thread, leaving the UI
thread free for the... UI. When a change is made to the UI you need to
cancel the polling on the background thread, make the changes, then
restart the polling.

This is pretty basic threading that is independent of NModbus. A VB
user group may be more appropriate.

Good luck.

Scott

> CurrentProject.rar
> 5199KDownload

Reply all
Reply to author
Forward
0 new messages