[?]: translate this InTouch script

Прочие SCADA: iFix, InTouch, Citect, ...
Christine_1914
Posts: 19
Joined: Mon Aug 22, 2011 7:28 am
Location: Philippines

[?]: translate this InTouch script

Post by Christine_1914 »

Hi Guys!

Need help for this one..

I encountered this script while working with InTouch..Anyone who can help me translate this one?

{Load the steps for this EM}

Code: Select all

FOR i = 0 TO 14
m = INIReadString(InfoInTouchAppDir() + "\Data\Step\EM STEPS.ini", StringRight(EMXXXX.Name, 4), StringFromIntg(i, 10));
EMX_STR.Name = "EMX_STR" + StringFromIntg(i, 10);
IF m <> "" THEN
IF StringLen(StringFromIntg(i, 10)) > 1 THEN
EMX_STR = StringFromIntg(i, 10) + " : " + m;
ELSE
EMX_STR = StringFromIntg(i, 10) + " : " + m;
ENDIF;
ELSE
IF EMX_MAX_STRAT == 0 THEN
EMX_MAX_STRAT = i - 1;
ENDIF;
EMX_STR = "";
ENDIF;
NEXT;
This script is used to call a .ini file written in notepad.
I am wondering how this script uses the values at .ini file for the display in every faceplate used in this InTouch design.
How this random values showed depending on the screen being accessed.
Hope someone could help me to accomplish this project.http://www.plctalk.net/qanda/attachment ... 1318493673 and http://www.plctalk.net/qanda/attachment ... 1318493673
Umencho
Posts: 508
Joined: Mon Jul 16, 2007 12:28 pm
Location: Europe

Re: Help with InTouch..please?

Post by Umencho »

Hello,

Both attached screenshots in plctalk.com are not readable at least for me. Anyway, in m = INIReadString(InfoInTouchAppDir() + "\Data\Step\EM STEPS.ini", StringRight(EMXXXX.Name, 4), StringFromIntg(i, 10)); Intouch goes in in directory where is placed the project and looking folder "Data" then folder "Step" for EM Steps.ini file. In order to understand StringRight function take a look at example StringRight("Hello World",5) returns “World”. About StringtoIntg (This function returns the string value of an integer value and performs a base conversion at the same time. This can be used, for example, to show text together with integer values or for converting integer values to hexadecimal numbers). In your case the base is 10. Like this example: StringFromIntg(26,10) returns “26” (decimal). Because this script is starting with a loop for i=0-14, stringfromintg will return the numbers from 0-14. So you will have 15 rows. Using this description and as you know contents of that ini file I think is clear how is written EMX_STR.Name = "EMX_STR" + StringFromIntg(i, 10); This will be a 15 different names (the differences will be only in numbers). The next lines are just a checking and add another numbers in each name...

BTW you can use inbuilt help in Intouch for more details.

BR
Christine_1914
Posts: 19
Joined: Mon Aug 22, 2011 7:28 am
Location: Philippines

Re: Help with InTouch..please?

Post by Christine_1914 »

Here is the screenshot of the script in InTouch
Image

and this is the notepad contents
Image