InTouch window script howto..

ason

Member
Join Date
Oct 2005
Location
Home
Posts
317
Hey, i got a Intouch application running and in a "window script" i have
Code:
IF KONA_R11_I == 1 THEN KONA_R11 = 1;
ELSE KONA_R11 = 0;
ENDIF;

And know i wanna have like this now, but i missing something...
think that i need ELSE IF or something, im new in this kind of stuff :unsure:

Code:
IF KONA_R11_I == 1 THEN KONA_R11 = 1;
IF KONA_R11_I == 3 THEN KONA_R11 = 2;
IF KONA_R11_I == 3 THEN KONA_R11 = 3;
ELSE KONA_R11 = 0;
ENDIF;

Any one that can give me a hint?
Thanks, i wanna try this out to night ;)
 
Yes, i want
KONA_R11_I=KONA_R11
if they is between 0 and 3 if higher it should be 0

how to type it in the script?
 
IF (KONA_R11_I < 1 or KONA_R11_I > 3) THEN KONA_R11 = KONA_R11_I;
ELSE KONA_R11 = 0;
ENDIF;
If this is in a window script, it'll need to be a WHILE_SHOWING script.

If I were to do this in WonderWare, I'd probably move this to a condition script, when KONA_R11 changes. However, I almost always do all calculations in the PLC unless there's a real good reason not to. My WW applications are merely a window into the process -- the process should run without WW (with the possible exception of data collection or recipe-value-entry)
 
OZEE said:
IF (KONA_R11_I < 1 or KONA_R11_I > 3) THEN KONA_R11 = KONA_R11_I;
ELSE KONA_R11 = 0;
ENDIF;
If this is in a window script, it'll need to be a WHILE_SHOWING script.

Thanks trying that out,
it´s for reciept loading, to a Simens 840D machine
I´m geting back and tell how it works, (y)
 
Wonderware scripts are asynchronous... once triggered, they run, period.
So, you should never make a direct assignment in one, if you are going to make a decision about that assignment later. Create a memory tag, use that for evaluation, and make a single assignment...

KONA_R11_TEMP = KONA_R11_I;
IF (KONA_R11_TEMP < 1 or KONA_R11_TEMP > 3);
THEN KONA_R11_TEMP = 0;
ENDIF;
KONA_R11 = KONA_R11_TEMP;

-- edit -- just saw OZEE's solution, and it is equally valid, without using a temp tag.
 
Ozee has the correct code for what you are looking to do, but for future reference if you need to do multiple IF statements you need to use the ELSE statement like –

IF KONA_R11_I == 1 THEN KONA_R11 = 1;​
ELSE IF KONA_R11_I == 3 THEN KONA_R11 = 2;
ELSE IF KONA_R11_I == 3 THEN KONA_R11 = 3;
ELSE KONA_R11 = 0;
ENDIF;
 
Now i have tryied that, and i dont get it to work, the prob. isnt in the wondowscript i think,
was looking at the tag dictory,
KONA_R11_I = I/O integer accessname CPU2 DB37,int0
KONA_R11 = Memory dicrete,
i dont know what Memory dicrete is, but saw something about 0=off 1=on, and that is what i think is the problem, do i need something else there?

KONA_R11 is for upload to a CNC machine,
Communication between PC and CNC controller has been made with Delphi5 and i dont know anything about that application.
 
rdrast said:
"Memory Discrete" is a WonderWare internal digital tag (On/Off, 1/0, True/False).

so if i wanna have one that can handle 0,1,2,3, what should i use then?
 
wildswing said:
Change it to Memory Integer type, the same as the other tag.

Thanks for the tip.
Think that i tried that, last night but it asked for access name (a plc nod) but dont remeber exately.
on the way to work soon and take a better look on it,
 
Been a few years since I played with blunderware but I still have a running copy on my machine at home...could test later...
but...usually with "basic" type code each IF statement has to have it's own complimenting END IF.
Also you may be able to use a SELECT CASE statement easier...although I've slept too many times since using in touch to be sure it supports this.
 

Similar Topics

Hello, since i am starting using intouch, i need some help Actually i want to make in intouch a String input field. The operator has to insert a...
Replies
1
Views
331
Hi guys. I am using Intouch Wonderware. Does anyone know how to enlarge the AlarmViewerCtrl properties window? In my case it is cut off as in the...
Replies
11
Views
1,495
Hi there, Been working adding new pages and features to an existing SCADA and have encountered a strange error when it comes to the sizing of...
Replies
1
Views
1,569
Hi Guys, How can I run full screen on wonder ware Intouch window viewer?
Replies
4
Views
5,822
Hello. I have a window in one Intouch app that I would like to copy/paste to another. Since I can't open two instances of the app, how can I do...
Replies
2
Views
2,688
Back
Top Bottom