Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pause Execution

Status
Not open for further replies.

wlaflamme

Technical User
Aug 1, 2003
22
US
Hi,
Newby to programming but my question is as follows:

I am currently programming a motion control system that i can control two motors and 8 Inputs and 8 outputs. I am trying to monitor the Inputs for safety issues while displaying the status on the screeen however the thread going in the background reading the inputs and refreshing is getting jumbled with procedures selected in the on screen form. Basically i need to pause the execution of the refresh thread when items are clicked on the main form. Any help would be greatly appreciated!!!!

wlaflamme
 
set up a boolean variable at the beginning of the refresh thread. if its set to true then run the thread else dont run it. on the form startup set the boolean variable to false so it starts the refresh thread with the application. When you click on the main form change the value to true. This would be done with an onClick_ from a command button or whatever you're using.

hope that helps

~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."
 
You say < I am trying to monitor the Inputs for safety issues >

If there are real safety issues here, you may wish to consider using a more robust and low level solution. It's difficult to guarantee that a VB program will always respond in a timely manner. It may be that a dedicated controller will be required for the direct controls, only feeding data back to VB for presentation, and accepting requests from VB for action.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
johnwm has a very good point. maybe to expand a little, instead of VB you could try a language that was purposely made with this kind of application in mind. You dont get the pretty (or ass ugly) GUI but you do get an interfaceable, speedy program that does the job well.

Id have to check some books at home to give you a name of such a language though. Maybe a search on google for Real time process control programming?

~*Gwar3k1*~
&quot;To the pressure, everything's just like: an illusion. I'll be losing you before long...&quot;
 
A lot of aerospace companies use Ada for safety critical software. That may be a better language to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top