TestIT:Programming Misc

From Nolek Wiki
Jump to navigation Jump to search

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

LoadProduct

Description:

Loads all program symbols from the given product, this overwrites any loaded symbols for the current product.

Code example: Misc.LoadProduct(_ST01,_B01, _ST02)

Parameters
Parameter Type Description
Product name String or String symbol Product to load values from
Result Bool symbol Result of load [0= Error, 1 = OK]
Result text String Contains any error that happened

QuickTimer

Description:

Perform an action, start a timer when a condition is met, and stop the timer when an end condition is met. This is used for precise measurements and checks the conditions with minimal delay.

Code example: Misc.QuickTimer(_B01,1,_IN01,<,_IN02,_IN01,>=,_IN03,_D01,_B02,_ST01,1000)


Parameters
Parameter Type Description
Symbol to edit Bool symbol Symbol to perform an action on
Action Int Action to perform [0 = Reset, 1 = Set]
Start Criteria1 Int, Double, Int symbol or Double symbol Value to compare with before starting timer
Start sign Sign Comparison sign before starting timer
Start Criteria2 Int, Double, Int symbol or Double symbol Value to compare against before starting timer
End Criteria1 Int, Double, Int symbol or Double symbol Value to compare with before stopping timer
End sign Sign Comparison sign before stopping timer
End Criteria2 Int, Double, Int symbol or Double symbol Value to compare against before stopping timer
Result time Double Time in milliseconds between start and end criterias were met.
Result status Bool symbol Status of the quicktimer [0 = Error, 1 = OK]
Result text String symbol Result text, contains error messages
Timeout ms Int, Int symbol Milliseconds before timing out. Max 10.000


Back to Programming - Commands