Difference between revisions of "TestIT:Programming Functions"
NolekAdmin (talk | contribs) |
NolekAdmin (talk | contribs) |
||
| Line 912: | Line 912: | ||
|Int | |Int | ||
|Select Icon (0 = None, 1 = Info, 2 = Error, 3 = Success, 4 = Warning) | |Select Icon (0 = None, 1 = Info, 2 = Error, 3 = Success, 4 = Warning) | ||
| + | |} | ||
| + | |||
| + | ===UpShowYesNo=== | ||
| + | '''Description:''' <br /> | ||
| + | It will display the user prompt with Yes/No buttons. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Display.UpShowYesNo(_B01,_ScannedValue,"Header","Text for info",1)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |UP Result | ||
| + | |Bool symbol | ||
| + | |True when command is done | ||
| + | |- | ||
| + | |Question Result | ||
| + | |Bool symbol | ||
| + | |Symbol receive result of the question | ||
| + | |- | ||
| + | |Header | ||
| + | |String or String symbol | ||
| + | |Header to display | ||
| + | |- | ||
| + | |Text | ||
| + | |String or String symbol | ||
| + | |Text to display | ||
| + | |- | ||
| + | |Icon | ||
| + | |Int | ||
| + | |Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) | ||
| + | |} | ||
| + | |||
| + | ===TestCountShow=== | ||
| + | '''Description:''' <br /> | ||
| + | It will show test count. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Display.TestCountShow()</code> | ||
| + | |||
| + | ''No parameters'' | ||
| + | |||
| + | ===TestCountReset=== | ||
| + | '''Description:''' <br /> | ||
| + | It will reset test counter. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Display.TestCountReset()</code> | ||
| + | |||
| + | ''No parameters'' | ||
| + | |||
| + | ===TestCountAddOK=== | ||
| + | '''Description:''' <br /> | ||
| + | It will add one to OK test counter. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Display.TestCountAddOK()</code> | ||
| + | |||
| + | ''No parameters'' | ||
| + | |||
| + | ===TestCountAddNOK=== | ||
| + | '''Description:''' <br /> | ||
| + | It will add one to NOK test counter. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Display.TestCountAddNOK()</code> | ||
| + | |||
| + | ''No parameters'' | ||
| + | |||
| + | ==5.3.4 Image== | ||
| + | |||
| + | ===UpImageShow=== | ||
| + | '''Description:''' <br /> | ||
| + | It will display the user image prompt. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Display.UpImageShow(_B01,"Verify parts","Verify all parts - when ready press OK",1,ImageFolder,Parts)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Bool symbol | ||
| + | |True when command is done | ||
| + | |- | ||
| + | |Header | ||
| + | |String or String symbol | ||
| + | |Header to display | ||
| + | |- | ||
| + | |Text | ||
| + | |String or String symbol | ||
| + | |Text to display | ||
| + | |- | ||
| + | |Icon | ||
| + | |Int | ||
| + | |Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) | ||
| + | |- | ||
| + | |Device name | ||
| + | |String or String symbol | ||
| + | |Image folder device name | ||
| + | |- | ||
| + | |Image name | ||
| + | |String or String symbol | ||
| + | |Image name | ||
| + | |} | ||
| + | |||
| + | ===UpImageShowIO=== | ||
| + | '''Description:''' <br /> | ||
| + | It will display the user image prompt with I/O connection. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Display.UpShowYesNo(_B01,"ConnectIT","Select number 1020 in ConnectIT box",5,ImageFolder,200,B201,AlwON)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Bool symbol | ||
| + | |True when command is done | ||
| + | |- | ||
| + | |Header | ||
| + | |String or String symbol | ||
| + | |Header to display | ||
| + | |- | ||
| + | |Text | ||
| + | |String or String symbol | ||
| + | |Text to display | ||
| + | |- | ||
| + | |Icon | ||
| + | |Int | ||
| + | |Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) | ||
| + | |- | ||
| + | |Device name | ||
| + | |String or String symbol | ||
| + | |Image folder device name | ||
| + | |- | ||
| + | |Image name | ||
| + | |String or String symbol | ||
| + | |Image name | ||
| + | |- | ||
| + | |IO symbol | ||
| + | |Bool symbol | ||
| + | |Can be used to accept with an IO eg. a button | ||
| + | |- | ||
| + | |Show button | ||
| + | |String or String symbol | ||
| + | |Show button on prompt if true | ||
| + | |} | ||
| + | |||
| + | ===UpImageShowScan=== | ||
| + | '''Description:''' <br /> | ||
| + | It will display the user scan prompt. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Display.UpImageShowScan(_B01,"ConnectIT","Select number 1020 in ConnectIT box",5,ImageFolder,200,_ScannedValue)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Bool symbol | ||
| + | |True when command is done | ||
| + | |- | ||
| + | |Header | ||
| + | |String or String symbol | ||
| + | |Header to display | ||
| + | |- | ||
| + | |Text | ||
| + | |String or String symbol | ||
| + | |Text to display | ||
| + | |- | ||
| + | |Icon | ||
| + | |Int | ||
| + | |Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) | ||
| + | |- | ||
| + | |Device name | ||
| + | |String or String symbol | ||
| + | |Image folder device name | ||
| + | |- | ||
| + | |Image name | ||
| + | |String or String symbol | ||
| + | |Image name | ||
| + | |- | ||
| + | |Scanned Value | ||
| + | |String symbol | ||
| + | |Receive the scanned value | ||
| + | |} | ||
| + | |||
| + | ===UpImageShowYesNo=== | ||
| + | '''Description:''' <br /> | ||
| + | It will display the user image Yes/No prompt. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Display.UpImageShowScan(_B01,"ConnectIT","Select number 1020 in ConnectIT box",5,ImageFolder,200,_ScannedValue)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Bool symbol | ||
| + | |True when command is done | ||
| + | |- | ||
| + | |Header | ||
| + | |String or String symbol | ||
| + | |Header to display | ||
| + | |- | ||
| + | |Text | ||
| + | |String or String symbol | ||
| + | |Text to display | ||
| + | |- | ||
| + | |Icon | ||
| + | |Int | ||
| + | |Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) | ||
| + | |- | ||
| + | |Device name | ||
| + | |String or String symbol | ||
| + | |Image folder device name | ||
| + | |- | ||
| + | |Image name | ||
| + | |String or String symbol | ||
| + | |Image name | ||
| + | |- | ||
| + | |Question Result | ||
| + | |Bool symbol | ||
| + | |Receive the result of the question | ||
| + | |} | ||
| + | |||
| + | ==5.3.5 Math== | ||
| + | |||
| + | ===Add=== | ||
| + | '''Description:''' <br /> | ||
| + | It will add two numbers. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Math.Add(_D01,1,3)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol or Double symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value1 | ||
| + | |Int, Double, Int symbol or Double symbol | ||
| + | |Value or symbol to use | ||
| + | |- | ||
| + | |Value2 | ||
| + | |Int, Double, Int symbol or Double symbol | ||
| + | |Value or symbol to use | ||
| + | |} | ||
| + | |||
| + | ===Subtract=== | ||
| + | '''Description:''' <br /> | ||
| + | It will subtract one number from another. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Math.Subtract(_IN01,4,3)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol or Double symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value1 | ||
| + | |Int, Double, Int symbol or Double symbol | ||
| + | |Value or symbol to use | ||
| + | |- | ||
| + | |Value2 | ||
| + | |Int, Double, Int symbol or Double symbol | ||
| + | |Value or symbol to use | ||
| + | |} | ||
| + | |||
| + | ===Divide=== | ||
| + | '''Description:''' <br /> | ||
| + | It will divide two numbers. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Math.Divide(_D01,4,2)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol or Double symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value1 | ||
| + | |Int, Double, Int symbol or Double symbol | ||
| + | |Value or symbol to use | ||
| + | |- | ||
| + | |Value2 | ||
| + | |Int, Double, Int symbol or Double symbol | ||
| + | |Value or symbol to use | ||
| + | |} | ||
| + | |||
| + | ===Multiply=== | ||
| + | '''Description:''' <br /> | ||
| + | It will multiply two numbers. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Math.Multiply(_D01,2,2)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol or Double symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value1 | ||
| + | |Int, Double, Int symbol or Double symbol | ||
| + | |Value or symbol to use | ||
| + | |- | ||
| + | |Value2 | ||
| + | |Int, Double, Int symbol or Double symbol | ||
| + | |Value or symbol to use | ||
| + | |} | ||
| + | |||
| + | ===Average (Avg)=== | ||
| + | '''Description:''' <br /> | ||
| + | It will get the average of an array of numbers. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Math.Avg(_D01,1;2,3;5;90)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Double symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Number Symbols | ||
| + | |Symbol array | ||
| + | |Array of numbers to get average from | ||
| + | |} | ||
| + | |||
| + | ===Minimum (Min)=== | ||
| + | '''Description:''' <br /> | ||
| + | It will return the minimum/lowest value from an array. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Math.Min(_D01,1;2,3;5;90)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Double symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Number Symbols | ||
| + | |Symbol array | ||
| + | |Array of numbers to get minimum from | ||
| + | |} | ||
| + | |||
| + | ===Maximum (Max)=== | ||
| + | '''Description:''' <br /> | ||
| + | It will return the maximum/highest value from an array. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Math.Max(_D01,1;2,3;5;90)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Double symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Number Symbols | ||
| + | |Symbol array | ||
| + | |Array of numbers to get maximum from | ||
| + | |} | ||
| + | |||
| + | ==5.3.6 DateTime== | ||
| + | |||
| + | ===Now=== | ||
| + | '''Description:''' <br /> | ||
| + | It will return the current date and time (yyyy/MM/dd HH:mm:SS,fff). | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>DateTime.Now(_ST01)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |String symbol | ||
| + | |Symbol to receive result | ||
| + | |} | ||
| + | |||
| + | ===Date=== | ||
| + | '''Description:''' <br /> | ||
| + | It will get the current date. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>DateTime.Date(_ST01)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |String symbol | ||
| + | |Symbol to receive result | ||
| + | |} | ||
| + | |||
| + | ===DayOfWeek=== | ||
| + | '''Description:''' <br /> | ||
| + | It will get the number of the current day of the week (1-7). | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>DateTime.DayOfWeek(_ST01)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol, double symbol or String symbol | ||
| + | |Symbol to receive result | ||
| + | |} | ||
| + | |||
| + | ===WeekNumber=== | ||
| + | '''Description:''' <br /> | ||
| + | It will return the current week of the year (1-52). | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>DateTime.WeekNumber(_ST01)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol, double symbol or String symbol | ||
| + | |Symbol to receive result | ||
| + | |} | ||
| + | |||
| + | ===Month=== | ||
| + | '''Description:''' <br /> | ||
| + | It will return the current month of the year (1-12). | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>DateTime.Month(_ST01)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol, double symbol or String symbol | ||
| + | |Symbol to receive result | ||
| + | |} | ||
| + | |||
| + | ===Year=== | ||
| + | '''Description:''' <br /> | ||
| + | It will return the current year. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>DateTime.Year(_ST01)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol, double symbol or String symbol | ||
| + | |Symbol to receive result | ||
| + | |} | ||
| + | |||
| + | ===DateDiff=== | ||
| + | '''Description:''' <br /> | ||
| + | It will get the difference between two dates in either days, hours, minutes, seconds, or milliseconds. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>DateTime.DateDiff (_ST01,_Start,_End,S)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol, double symbol or String symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |From | ||
| + | |String symbol | ||
| + | |Symbol value to set as start | ||
| + | |- | ||
| + | |To | ||
| + | |String symbol | ||
| + | |Symbol value to set as end | ||
| + | |- | ||
| + | |Interval | ||
| + | |String | ||
| + | |Select Interval eg. D = Day, H = Hour, M = minute, S = seconds, MS = milliseconds | ||
| + | |} | ||
| + | |||
| + | ===Hour=== | ||
| + | '''Description:''' <br /> | ||
| + | It will return the current hour of the day (0-23). | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>DateTime.Hour(_ST01)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol, double symbol or String symbol | ||
| + | |Symbol to receive result | ||
| + | |} | ||
| + | |||
| + | ===Minute=== | ||
| + | '''Description:''' <br /> | ||
| + | It will return the current minute of the hour (0-59). | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>DateTime.Minute(_ST01)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol, double symbol or String symbol | ||
| + | |Symbol to receive result | ||
| + | |} | ||
| + | |||
| + | ===Second=== | ||
| + | '''Description:''' <br /> | ||
| + | It will return current second of a minute (0-59). | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>DateTime.Second(_ST01)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Result | ||
| + | |Int symbol, double symbol or String symbol | ||
| + | |Symbol to receive result | ||
| + | |} | ||
| + | |||
| + | ==5.3.7 Text== | ||
| + | |||
| + | ===StringClear=== | ||
| + | '''Description:''' <br /> | ||
| + | It will set symbol value to empty string. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Text.StringClear(_ST01)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Symbol | ||
| + | |String symbol | ||
| + | |Symbol to clear | ||
| + | |} | ||
| + | |||
| + | ===StringMove=== | ||
| + | '''Description:''' <br /> | ||
| + | It will move text value to symbol. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Text.StringMove(_ST01,"New text")</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Symbol | ||
| + | |String symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value | ||
| + | |String or String symbol | ||
| + | |Value or symbol to move | ||
| + | |} | ||
| + | |||
| + | ===StringConcatenate=== | ||
| + | '''Description:''' <br /> | ||
| + | It will combine two symbol values to one text string. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Text.StringConcatenate(_ST01,"New ","text")</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Symbol | ||
| + | |String symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value | ||
| + | |String or String symbol | ||
| + | |Value or symbol to move | ||
| + | |- | ||
| + | |Value | ||
| + | |String or String symbol | ||
| + | |Value or symbol to move | ||
| + | |} | ||
| + | |||
| + | ===StringMid=== | ||
| + | '''Description:''' <br /> | ||
| + | It will return a part of a text value. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Text.StringMid(_ST01,"New text", 5, 3)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Symbol | ||
| + | |String symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value | ||
| + | |String or String symbol | ||
| + | |Value or symbol to move | ||
| + | |- | ||
| + | |Start character | ||
| + | |Int or Int symbol | ||
| + | |Start character | ||
| + | |- | ||
| + | |Number of characters | ||
| + | |Int or Int symbol | ||
| + | |Number of characters | ||
| + | |} | ||
| + | |||
| + | ===StringRemove=== | ||
| + | '''Description:''' <br /> | ||
| + | It will remove part of a text value. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Text.StringRemove(_ST01,"New text", 4, 3)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Symbol | ||
| + | |String symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value | ||
| + | |String or String symbol | ||
| + | |Value or symbol to move | ||
| + | |- | ||
| + | |Start Index | ||
| + | |Int or Int symbol | ||
| + | |Start character | ||
| + | |- | ||
| + | |Number of characters | ||
| + | |Int or Int symbol | ||
| + | |Number of characters | ||
| + | |} | ||
| + | |||
| + | ===StringReplace=== | ||
| + | '''Description:''' <br /> | ||
| + | It will replace every occurrence of a value with another. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Text.StringReplace(_ST01,"New text", "e", "o")</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Symbol | ||
| + | |String symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value | ||
| + | |String or String symbol | ||
| + | |Value or symbol to move | ||
| + | |- | ||
| + | |From | ||
| + | |String or String symbol | ||
| + | |From character | ||
| + | |- | ||
| + | |To | ||
| + | |String or String symbol | ||
| + | |To character | ||
| + | |} | ||
| + | |||
| + | ===StringLength=== | ||
| + | '''Description:''' <br /> | ||
| + | It will measure the length of the string. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Text.StringLength(_IN01,"New text")</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Symbol | ||
| + | |Int symbol or Double symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value | ||
| + | |String or String symbol | ||
| + | |Value or symbol to move | ||
| + | |} | ||
| + | |||
| + | ===StringToVal=== | ||
| + | '''Description:''' <br /> | ||
| + | It will convert a text value to a number. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Text.StringToVal(_IN01,"9")</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Symbol | ||
| + | |Int symbol or Double symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value | ||
| + | |String or String symbol | ||
| + | |Value or symbol to use | ||
| + | |} | ||
| + | |||
| + | ===StringValueToString=== | ||
| + | '''Description:''' <br /> | ||
| + | It will convert a number value to a text value. | ||
| + | |||
| + | '''Code example:''' | ||
| + | :<code>Text.StringValueToString(_ST01,9)</code> | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !colspan="3"|Parameters | ||
| + | |- | ||
| + | |'''Parameter''' | ||
| + | |'''Type''' | ||
| + | |'''Description''' | ||
| + | |- | ||
| + | |Symbol | ||
| + | |String symbol | ||
| + | |Symbol to receive result | ||
| + | |- | ||
| + | |Value | ||
| + | |Int, Double, Bool, Int symbol, Double symbol or Bool symbol | ||
| + | |Value or symbol to use | ||
|} | |} | ||
Revision as of 15:13, 14 August 2019
The function window encompasses all the codes, which can be inserted in the program. To get information about the function, then, press on the wanted line and use the info button. When a function is going to be created, the wanted function can be selected, or if the code is known then it is possible to write it. To get help with filling in the function, the Config button can be selected and it will show the parameters. In symbol handler, it is possible to add a symbol, and it is also possible to insert a symbol in the function. To insert a symbol, just double-click on the wanted symbol.
Contents
- 1 5.3.1 Functions
- 2 5.3.2 Misc (Miscellaneous)
- 2.1 Move
- 2.2 Set
- 2.3 Reset
- 2.4 SetUniqueID
- 2.5 GetUniqueID
- 2.6 AddResult
- 2.7 AddResultValidate
- 2.8 ValidateObject
- 2.9 IsNewProduct
- 2.10 IsDeviceActive
- 2.11 GetBatchNumber
- 2.12 GetProductName
- 2.13 GetCurrentLanguage
- 2.14 GetTestCountOK
- 2.15 GetTestCountNOK
- 2.16 GetUserName
- 2.17 GetGuideObjectID
- 2.18 StartFlash
- 3 5.3.3 Display
- 4 5.3.4 Image
- 5 5.3.5 Math
- 6 5.3.6 DateTime
- 7 5.3.7 Text
5.3.1 Functions
If
Description:
Evaluates a statement and continues if true and skips if it is not true. It compares two values and is always used together with EndIf.
Code example:
Function.If(_B01,=,1)'Code will only be executed if _B01 = 1
Function.EndIf()
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Criteria1 | Number or number symbol | Value 1 |
| Sign | Sign | Select sign to use for comparison. Must be (<,>, <>,=, >=, ⇐) |
| Criteria2 | Number or number symbol | Value 2 |
IfMinMax
Description:
Evaluates a value against a min. and max. It continues if the value is between the min. and max, and skips if it is not.
Code example:
Function.IfMinMax(_IN01,1,5)'Code will only be executed if _IN01 is between 1 and 5
Function.EndIf()
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Value/Symbol to compare | Number or number symbol | Value 1 |
| Min value | Number or number symbol | Minimum value |
| Max value | Number or number symbol | Maximum value |
EndIf
Description:
It is used together with If or IfMinMax. It will stop the if code.
Code example:
Function.If(_B01,=,1)'Code will only be executed if _B01 = 1
Function.EndIf()
No parameters
Wait
Description:
It will wait until the time has run out or criteria is met.
Code example:
Function.Wait(_D01,>,10,30,S,_TO01)Function.If(_TO01, =, 1)'Code will enter if wait times out
Function.EndIf()
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Criteria1 | Number or number symbol | Value 1 |
| Sign | Sign | Select sign to use for comparison. Must be (<,>, <>,=, >=, ⇐) |
| Criteria2 | Number or number symbol | Value 2 |
| Timeout | Int or Int symbol | Time before command times out |
| Time unit | String | Select the time unit from the list |
| Timeout active | Bool symbol | True if wait command times out |
Sub
Description:
It is used to split the program up in smaller programs. The main sub is the sub which TestIT always starts in. The program cannot run if there is no main sub. It must always end with an EndSub.
Code example:
Function.Sub(1000)'Execute this sub routine
Function.EndSub()
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Sub name | String | Name of the sub. Must be unique in the program |
EndSub
Description:
It is the end mark of a sub.
Code example:
Function.Sub(1000)'Execute this sub routine
Function.EndSub()
No parameters
GoSub
Description:
It will jump to a specific sub.
Code example:
Function.GoSub(1000)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Sub name | String | Name of the sub. |
Label
Description:
It will set a fix point to jump to.
Code example:
Function.Label(startLoop)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Label name | String | Name of the label. Must be unique within the sub |
GoLabel
Description:
It will jump to a specific label.
Code example:
Function.GoLabel(startLoop)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Label name | String | Name of the label |
Delay
Description:
It will delay the program, for a specified time.
Code example:
Function.Delay(30,S)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Delay time | Int or Int symbol | Delay time |
| Time unit | String | Time unit |
StopTest
Description:
It will go to EndSub() in main sub.
Code example:
Function.StopTest()
No parameters
NewPart
Description:
It will clear the production window, the results, and prepare the production to run a new product.
Code example:
Function.NewPart()
No parameters
The command is often used together with a label that jumps to the beginning of the program.
Code example:
Function.NewPart()Function.GoLabel(lbl_newPart)
IsValue
Description:
It will convert a symbol to a numeric value if it is possible.
Code example:
Function.IsValue(_D01,_B01,_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Double symbol | Value or symbol to use |
| IsValue | Bool symbol | Time unit |
| ValueToTest | String or String symbol | String value to test |
5.3.2 Misc (Miscellaneous)
Move
Description:
It will move a value into a symbol.
Code example:
Misc.Move(_IN01,2)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol | Int symbol or Double symbol | Symbol to move value to |
| Value | Int, Double, Int symbol or Double symbol | Value to move into symbol |
Set
Description:
It will set symbols in symbol array to true.
Code example:
Misc.Set(_B01;_B02;_B03)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Bool Symbols | Symbol array | Bool symbols to set |
Reset
Description:
It will reset symbols in symbol array to false.
Code example:
Misc.Reset(_B01;_B02;_B03)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Bool Symbols | Symbol array | Bool symbols to reset |
SetUniqueID
Description:
It will set the Unique ID to the value. The Unique ID will be logged together with results in the database.
Code example:
Misc.SetUniqueID(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Unique ID | String symbol | Unique ID |
GetUniqueID
Description:
It will return a Unique ID for the Unique ID Device. The Unique ID will be logged together with results in the database.
Code example:
Misc.GetUniqueID(Unique,_ST01,_B01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Device name | String or String symbol | The device name |
| Unique ID | String symbol | Receive the unique ID from the device |
| Set as Object ID | Bool symbol | If true, the Object ID in the production will be set to this unique ID. If Object ID is selected, max length is 50 |
AddResult
Description:
It will add a result to the production window. If LogToDB is set to true, the result will be logged to the database as well.
All the results which are logged in the database can be found in Report/Results.
Code example:
Misc.AddResult(1010,"Leak result","Result from S9",_ST01,LeakResult,"Pa",0,2,3,ObjectStatus,AlwON)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Number | Int or Int symbol | Result number |
| Result name | String or String symbol | Result name (Max 50 char) |
| Description Short | String or String symbol | Description Short (Max 50 char) |
| Description Long | String or String symbol | Description Long (Max 250 char, is not shown on screen) |
| Result Symbol | Number symbol | Symbol value will be logged as result |
| Unit | String or String symbol | String to describe the unit |
| Min | Int, Double, Int symbol or Double symbol | Minimum value |
| Max | Int, Double, Int symbol or Double symbol | Maximum value |
| Icon | Int | Select Icon (0 = None, 1 = Info, 2 = Error, 3 = Success, 4 = Warning) |
| Object Status | Bool symbol | Symbol value will be logged as overall result |
| LogToDB | Bool symbol | Log to database if true |
AddResultValidate
Description:
It will add a result to the production window and validate OK/NOK. If LogToDB is set to true, the result will be logged to the database as well. It will show the OK/NOK icon according to the validation and set the object status as well.
All the results which are logged in the database can be found in Report/Results.
Code example:
Misc.AddResultValidate(1010,"Leak result","Result from S9",_ST01,LeakResult,"Pa",0,2,3,2,ObjectStatus,AlwON)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Number | Int or Int symbol | Result number |
| Result name | String or String symbol | Result name (Max 50 char) |
| Description Short | String or String symbol | Description Short (Max 50 char) |
| Description Long | String or String symbol | Description Long (Max 250 char, is not shown on screen) |
| Result Symbol | Number symbol | Symbol value will be logged as result |
| Unit | String or String symbol | String to describe the unit |
| Min | Int, Double, Int symbol or Double symbol | Minimum value |
| Max | Int, Double, Int symbol or Double symbol | Maximum value |
| IconOK | Int | Select Icon (0 = None, 1 = Info, 2 = Error, 3 = Success, 4 = Warning) |
| IconNOK | Int | Select Icon (0 = None, 1 = Info, 2 = Error, 3 = Success, 4 = Warning) |
| Object Status | Bool symbol | Symbol value will be logged as overall result |
| LogToDB | Bool symbol | Log to database if true |
ValidateObject
Description:
It will validate the status of the actual object and show the Icons Good or Bad in the production window.
Code example:
Misc.ValidateObject(ValidationResult,ObjectResult,3,Retest,Lamp01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol | Symbol to receive result [1:Retest,2:Can retest,3:Max retest,4:Failed,5:TestOK] |
| Object result | Bool symbol | Symbol representing the object status |
| Max retest | Int or Int symbol | Max retest count |
| Actual test count | Int symbol | Symbol to hold actual retest count |
| Object Failed | Bool symbol | Set true if failed. Can turn on indicator if failed |
IsNewProduct
Description:
It will return a Boolean whether the current product is running for the first time or not
Code example:
Misc.IsNewProduct(_B01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| IsNewProduct | Bool symbol | Symbol for is new product |
IsDeviceActive
Description:
It will check if the device is set to active.
Code example:
Misc.IsDeviceActive(_B01, _ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Bool symbol | True if device is active |
| Device name | String or String symbol | Name of the device |
GetBatchNumber
Description:
It will return the current batch number.
Code example:
Misc.GetBatchNumber(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | String symbol | Receive current batch number |
GetProductName
Description:
It will return the current product name.
Code example:
Misc.GetProductName(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | String symbol | Receive current product name |
GetCurrentLanguage
Description:
It will return the language TestIT is set to.
Code example:
Misc.GetCurrentLanguage(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | String symbol | Get current language code |
GetTestCountOK
Description:
It will return the current OK test count.
Code example:
Misc.GetTestCountOK(_IN01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol | Receive current OK test count |
GetTestCountNOK
Description:
It will return the current NOK test count.
Code example:
Misc.GetTestCountNOK(_IN01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol | Receive current NOK test count |
GetUserName
Description:
It will return the username of the active user.
Code example:
Misc.GetUserName(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | String symbol | Receive current user name |
GetGuideObjectID
Description:
It will return the object ID from the current guide.
Code example:
Misc.GetGuideObjectID(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | String symbol | Receive current guide objectID |
StartFlash
Description:
It will start flashing a bool symbol, and continues the code.
Code example:
Misc.StartFlash(_B01,500,1000,MS,_B02)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol to flash | Bool symbol | Symbol to flash |
| On time | Int or Int symbol | Length of on/set state |
| Off time | Int or Int symbol | Length of off/reset state |
| Time unit | String | Time unit |
| Stop flash symbol | Bool symbol | Set symbol to stop flash |
5.3.3 Display
OpAddSymbol
Description:
It will add a symbol or symbols to the operator display.
Code example:
Display.OpAddSymbol(_ST01;_B01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol Array | Symbol array | Symbol or symbol array to add to the operator display |
OpRemoveSymbol
Description:
It will remove symbol or symbols to operator display.
Code example:
Display.OpRemoveSymbol(_ST01;_B01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol Array | Symbol array | Symbol or symbol array to remove from the operator display |
OpClear
Description:
It will clear operator display.
Code example:
Display.OpClear()
No parameters
UpAddButton
Description:
It will add a button to the user prompt.
Code example:
Display.UpAddButton(_B01;_B02)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Bool Symbols | Symbol array | Bool symbols to add to the user prompt |
UpShow
Description:
It will display the user prompt.
Code example:
Display.UpShow(_B01,"Header","Text for info",1)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Bool symbol | True when command is done |
| Header | String or String symbol | Header to display |
| Text | String or String symbol | Text to display |
| Icon | Int | Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) |
UpScanShow
Description:
It will display the user scan prompt.
Code example:
Display.UpScanShow(_B01,_ScannedValue,"Header","Text for info",1)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Bool symbol | True when command is done |
| ScannedValue | String symbol | Symbol to hold the scanned value |
| Header | String or String symbol | Header to display |
| Text | String or String symbol | Text to display |
| Icon | Int | Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) |
Message
Description:
It will set a text message in the production window.
Code example:
Display.Message(1010,"Pressure OK",3)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Message number | Int or Int symbol | Message number |
| Message | String or String symbol | Symbol or string message to display |
| Icon | Int | Select Icon (0 = None, 1 = Info, 2 = Error, 3 = Success, 4 = Warning) |
UpShowYesNo
Description:
It will display the user prompt with Yes/No buttons.
Code example:
Display.UpShowYesNo(_B01,_ScannedValue,"Header","Text for info",1)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| UP Result | Bool symbol | True when command is done |
| Question Result | Bool symbol | Symbol receive result of the question |
| Header | String or String symbol | Header to display |
| Text | String or String symbol | Text to display |
| Icon | Int | Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) |
TestCountShow
Description:
It will show test count.
Code example:
Display.TestCountShow()
No parameters
TestCountReset
Description:
It will reset test counter.
Code example:
Display.TestCountReset()
No parameters
TestCountAddOK
Description:
It will add one to OK test counter.
Code example:
Display.TestCountAddOK()
No parameters
TestCountAddNOK
Description:
It will add one to NOK test counter.
Code example:
Display.TestCountAddNOK()
No parameters
5.3.4 Image
UpImageShow
Description:
It will display the user image prompt.
Code example:
Display.UpImageShow(_B01,"Verify parts","Verify all parts - when ready press OK",1,ImageFolder,Parts)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Bool symbol | True when command is done |
| Header | String or String symbol | Header to display |
| Text | String or String symbol | Text to display |
| Icon | Int | Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) |
| Device name | String or String symbol | Image folder device name |
| Image name | String or String symbol | Image name |
UpImageShowIO
Description:
It will display the user image prompt with I/O connection.
Code example:
Display.UpShowYesNo(_B01,"ConnectIT","Select number 1020 in ConnectIT box",5,ImageFolder,200,B201,AlwON)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Bool symbol | True when command is done |
| Header | String or String symbol | Header to display |
| Text | String or String symbol | Text to display |
| Icon | Int | Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) |
| Device name | String or String symbol | Image folder device name |
| Image name | String or String symbol | Image name |
| IO symbol | Bool symbol | Can be used to accept with an IO eg. a button |
| Show button | String or String symbol | Show button on prompt if true |
UpImageShowScan
Description:
It will display the user scan prompt.
Code example:
Display.UpImageShowScan(_B01,"ConnectIT","Select number 1020 in ConnectIT box",5,ImageFolder,200,_ScannedValue)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Bool symbol | True when command is done |
| Header | String or String symbol | Header to display |
| Text | String or String symbol | Text to display |
| Icon | Int | Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) |
| Device name | String or String symbol | Image folder device name |
| Image name | String or String symbol | Image name |
| Scanned Value | String symbol | Receive the scanned value |
UpImageShowYesNo
Description:
It will display the user image Yes/No prompt.
Code example:
Display.UpImageShowScan(_B01,"ConnectIT","Select number 1020 in ConnectIT box",5,ImageFolder,200,_ScannedValue)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Bool symbol | True when command is done |
| Header | String or String symbol | Header to display |
| Text | String or String symbol | Text to display |
| Icon | Int | Select Icon (Icon: 1 = Message; 2= Alert; 3 = Question) |
| Device name | String or String symbol | Image folder device name |
| Image name | String or String symbol | Image name |
| Question Result | Bool symbol | Receive the result of the question |
5.3.5 Math
Add
Description:
It will add two numbers.
Code example:
Math.Add(_D01,1,3)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol or Double symbol | Symbol to receive result |
| Value1 | Int, Double, Int symbol or Double symbol | Value or symbol to use |
| Value2 | Int, Double, Int symbol or Double symbol | Value or symbol to use |
Subtract
Description:
It will subtract one number from another.
Code example:
Math.Subtract(_IN01,4,3)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol or Double symbol | Symbol to receive result |
| Value1 | Int, Double, Int symbol or Double symbol | Value or symbol to use |
| Value2 | Int, Double, Int symbol or Double symbol | Value or symbol to use |
Divide
Description:
It will divide two numbers.
Code example:
Math.Divide(_D01,4,2)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol or Double symbol | Symbol to receive result |
| Value1 | Int, Double, Int symbol or Double symbol | Value or symbol to use |
| Value2 | Int, Double, Int symbol or Double symbol | Value or symbol to use |
Multiply
Description:
It will multiply two numbers.
Code example:
Math.Multiply(_D01,2,2)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol or Double symbol | Symbol to receive result |
| Value1 | Int, Double, Int symbol or Double symbol | Value or symbol to use |
| Value2 | Int, Double, Int symbol or Double symbol | Value or symbol to use |
Average (Avg)
Description:
It will get the average of an array of numbers.
Code example:
Math.Avg(_D01,1;2,3;5;90)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Double symbol | Symbol to receive result |
| Number Symbols | Symbol array | Array of numbers to get average from |
Minimum (Min)
Description:
It will return the minimum/lowest value from an array.
Code example:
Math.Min(_D01,1;2,3;5;90)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Double symbol | Symbol to receive result |
| Number Symbols | Symbol array | Array of numbers to get minimum from |
Maximum (Max)
Description:
It will return the maximum/highest value from an array.
Code example:
Math.Max(_D01,1;2,3;5;90)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Double symbol | Symbol to receive result |
| Number Symbols | Symbol array | Array of numbers to get maximum from |
5.3.6 DateTime
Now
Description:
It will return the current date and time (yyyy/MM/dd HH:mm:SS,fff).
Code example:
DateTime.Now(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | String symbol | Symbol to receive result |
Date
Description:
It will get the current date.
Code example:
DateTime.Date(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | String symbol | Symbol to receive result |
DayOfWeek
Description:
It will get the number of the current day of the week (1-7).
Code example:
DateTime.DayOfWeek(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol, double symbol or String symbol | Symbol to receive result |
WeekNumber
Description:
It will return the current week of the year (1-52).
Code example:
DateTime.WeekNumber(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol, double symbol or String symbol | Symbol to receive result |
Month
Description:
It will return the current month of the year (1-12).
Code example:
DateTime.Month(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol, double symbol or String symbol | Symbol to receive result |
Year
Description:
It will return the current year.
Code example:
DateTime.Year(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol, double symbol or String symbol | Symbol to receive result |
DateDiff
Description:
It will get the difference between two dates in either days, hours, minutes, seconds, or milliseconds.
Code example:
DateTime.DateDiff (_ST01,_Start,_End,S)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol, double symbol or String symbol | Symbol to receive result |
| From | String symbol | Symbol value to set as start |
| To | String symbol | Symbol value to set as end |
| Interval | String | Select Interval eg. D = Day, H = Hour, M = minute, S = seconds, MS = milliseconds |
Hour
Description:
It will return the current hour of the day (0-23).
Code example:
DateTime.Hour(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol, double symbol or String symbol | Symbol to receive result |
Minute
Description:
It will return the current minute of the hour (0-59).
Code example:
DateTime.Minute(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol, double symbol or String symbol | Symbol to receive result |
Second
Description:
It will return current second of a minute (0-59).
Code example:
DateTime.Second(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Result | Int symbol, double symbol or String symbol | Symbol to receive result |
5.3.7 Text
StringClear
Description:
It will set symbol value to empty string.
Code example:
Text.StringClear(_ST01)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol | String symbol | Symbol to clear |
StringMove
Description:
It will move text value to symbol.
Code example:
Text.StringMove(_ST01,"New text")
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol | String symbol | Symbol to receive result |
| Value | String or String symbol | Value or symbol to move |
StringConcatenate
Description:
It will combine two symbol values to one text string.
Code example:
Text.StringConcatenate(_ST01,"New ","text")
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol | String symbol | Symbol to receive result |
| Value | String or String symbol | Value or symbol to move |
| Value | String or String symbol | Value or symbol to move |
StringMid
Description:
It will return a part of a text value.
Code example:
Text.StringMid(_ST01,"New text", 5, 3)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol | String symbol | Symbol to receive result |
| Value | String or String symbol | Value or symbol to move |
| Start character | Int or Int symbol | Start character |
| Number of characters | Int or Int symbol | Number of characters |
StringRemove
Description:
It will remove part of a text value.
Code example:
Text.StringRemove(_ST01,"New text", 4, 3)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol | String symbol | Symbol to receive result |
| Value | String or String symbol | Value or symbol to move |
| Start Index | Int or Int symbol | Start character |
| Number of characters | Int or Int symbol | Number of characters |
StringReplace
Description:
It will replace every occurrence of a value with another.
Code example:
Text.StringReplace(_ST01,"New text", "e", "o")
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol | String symbol | Symbol to receive result |
| Value | String or String symbol | Value or symbol to move |
| From | String or String symbol | From character |
| To | String or String symbol | To character |
StringLength
Description:
It will measure the length of the string.
Code example:
Text.StringLength(_IN01,"New text")
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol | Int symbol or Double symbol | Symbol to receive result |
| Value | String or String symbol | Value or symbol to move |
StringToVal
Description:
It will convert a text value to a number.
Code example:
Text.StringToVal(_IN01,"9")
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol | Int symbol or Double symbol | Symbol to receive result |
| Value | String or String symbol | Value or symbol to use |
StringValueToString
Description:
It will convert a number value to a text value.
Code example:
Text.StringValueToString(_ST01,9)
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
| Symbol | String symbol | Symbol to receive result |
| Value | Int, Double, Bool, Int symbol, Double symbol or Bool symbol | Value or symbol to use |