Intouch & Visual Basic

ControlLogix

Member
Join Date
Feb 2003
Location
Southern Ireland
Posts
62
Hi all,

I am in need of some help. I am used to writing code in Intouch and now I find myself writing some VB code. For the most part its ok since it is event driven like Intouch. However, I have a need for some code to be scanned contantly...i.e. not event driven. Where do I put this code in VB. With intouch you just put it in the constantly scanned code with an update time of say 1000msec. How can I do the same in VB?

Something simple has never been so hard!!

Please help...

Rgds,

John
 
A VB program has a start-up Form or a start-up Module, you can see and change it in the "Project Properties"

You would have to write your own main program loop in that Module or Form (something Intouch does for you behind the scenes).

Use "Do...Loop" or similar instruction with loop exit conditions if necessary. Put your continuously executed code within the body of the loop.

Do not forget to include DoEvents() instruction somewhere within the body of the loop! Otherwise, neither your events would fire, nor you would be able to exit the program nicely.

If you care about having your code executed every X milliseconds, make a Form, put Timer control on it, and have your code executed from Timer control's Timer() event.
 
A Timer is the best way.


DoEvents() is a cpu hog. I use it only when I need to process lots of information in a loop and would need to break out if the user clicked a Cancel button to terminate it before it would normally end.

How often do you need to execute your code ?

Initialize your variables in you Main form / module and then set the Timer.Enabled = True (have it False upon startup) to get it going.
 
I agree with JustDaveIII. Use a timer event and set the time interval to the time interval you think you can get away with.
If the code you are running during the timer event takes a long
time then use DoEvents.
 

Similar Topics

Hi all. Customer wants analog faceplates really bad, even if we explained that it doesn't make much sense in his process. What he wants to see...
Replies
5
Views
113
Trying to export a Modern application for an upgrade to Intouch 2020 but I cannot export the application from the 2014 version because the export...
Replies
2
Views
108
Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
142
Currently we have a fat( I think that is what it is called) Intouch application. An application resolution of 3840x1080, and inside that 2x...
Replies
0
Views
90
Hi guys We're in the process of creating a ME runtime to operate on a PC running windows using a InTouch INDT156 touchscreen, and we're having an...
Replies
3
Views
140
Back
Top Bottom