InTouch Scripting Help

DarrenG

Member
Join Date
Dec 2016
Location
London
Posts
74
Hi folks,

We have a second line starting up soon so I am trying to disable the operators from viewing parts of the plant depending on which line the operator is working on. For example if they are on line 1 then I want to disable them viewing the exclusive line 2 pages, I'm just not entirely sure how to do it.

We have two separate navigation footers, one for line 1 and one for line 2 so I was hoping to do an IF statement on the line 2 page links that if line 1's footer is visible then disable that link.

I know there is a disable function so within that I have tried "Title_Line2 ==1" which just disables the link regardless of whether line 1 or line 2's footer is visible and I reckon I know why. I have also tried using "IF WindowState (Title_Line2) ==1;" but I don't know what the THEN part should be. I have only done bits of .net before so very much a newbie at this stage.

Thanks in advance for your help.

Darren
 
http://platforma.astor.com.pl/files/getfile/id/3887

IF Title_Line2 ==1 THEN
Title_Line1 = 1;
ELSE
IF Title_Line1 ==1 THEN
Title_Line2 = 1;
ENDIF;

From the manual above:
Example(s)
With a check box wizard Checkbox1 and a discrete tagname dtag you can control the visibility of the check box with the following script function:
result=SetPropertyD("Checkbox1.visible",dtag);
If you set dtag to 0 and call the script function above, the check box wizard becomes invisible.

Hope this helps you out,
Regards
 
If I understand you correctly then you have a common InTouch application that will be running on multiple computers, one on line 1 and one on line 2?

If so, you can use the GetNodeName() function in a startup script to bring the computer name into a string (message) tag and use this to condition visbility of certain graphics.
 
Hi folks,

My apologies, I read your replies, went straight back to solving the problem and forgot to reply.

Brendan thank you for you response, I will keep your advice for future reference. In this case we still wanted to let the operator have the option to switch between lines but when they are on a particular line the idea was to prevent them clicking on a link to the other line as there were some pages that were common to both.

Glcshortt thank you also for your advice, I used a slightly different version of what you wrote. I used that piece of code on the button that switches between lines and on each link to the exclusive pages I disabled them depending of which line was active. It seems pretty straightforward now that I have been given the answer but now I'll know from now on.

Thank you for your help, greatly appreciated.

Regards,

Darren
 
I use a script to first fire a DOS command to write 'ipconfig > ip.txt' the results of the ipconfig command to a text file, then another script to read that text file, extract the IP address. Then compare that to a custom config.ini file in the app directory. Of course you would need static IP addresses for this to work.

I also remember seeing a script command to get the PC name.
 
Last edited:
I use a script to first fire a DOS command to write 'ipconfig > ip.txt' the results of the ipconfig command to a text file, then another script to read that text file, extract the IP address. Then compare that to a custom config.ini file in the app directory. Of course you would need static IP addresses for this to work.

I also remember seeing a script command to get the PC name.

Much easier to simply execute the GetNodeName function in a startup script.

I've also done systems that look different to the operator based upon whom is logged on, rather than being based upon node name.
 
Much easier to simply execute the GetNodeName function in a startup script.

I've also done systems that look different to the operator based upon whom is logged on, rather than being based upon node name.

I first did that on a system that was Windows 2000 Server and Wonderware thin clients back in 2001. Because of being thin clients GetNodeName would give the same name for every client.

For sure GetNodeName works great on separate PC's.

I use a combination of location and user rights. I also as a standard now use an RFIdeas IP67 reader as well.
 
I first did that on a system that was Windows 2000 Server and Wonderware thin clients back in 2001. Because of being thin clients GetNodeName would give the same name for every client.

For sure GetNodeName works great on separate PC's.

I use a combination of location and user rights. I also as a standard now use an RFIdeas IP67 reader as well.

That is what the function TSEGetClientNodeName() is for...

TseGetClientNodeName() Function
Returns the client node name if the View application is running on a Terminal
Server client assigned a name that can be identified by Windows. Otherwise, the TseGetClientNodeName() function returns an empty string.

Syntax
MessageResult=TseGetClientNodeName();

Example
The client node name is returned as the value assigned to the MsgTag tag.
MsgTag=TseGetClientNodeName();
 

Similar Topics

I am looking for a way to capture keyboard input data and store it in a tag. Something like ‘MessageTag = System.In.NextLine();” From there I can...
Replies
2
Views
2,257
I am new to this line of work so please excuse me if this is extremely simple. I have also Searched the forums and web for answeres and am getting...
Replies
1
Views
1,260
Im trying to allow the user to take a span of dates and copy log files from one folder to another so they can view them without disturbing the log...
Replies
0
Views
3,075
Hi all , i have done some scripting in order to record some values in a csv file...
Replies
1
Views
1,699
Can someone point me in the right direction to find some information on how to learn scripting using Intouch? I need water pumps to turn on/off...
Replies
11
Views
4,547
Back
Top Bottom