5.8.1. Additional Functions

IntegraXor comes with a few additional proprietary functions or methods to simplify the programming work, mainly for script to communicate with the server.

setTag( 'TagName', Data) is used to set Tag value, where TagName is the tag in string, and Data is the variable holding value to set into the specific Tag.

getTag( 'TagName') is used to get Tag value, it returns the value in associated data type.

sleep( DELAY) is used to hold the script execution for specified time, DELAY in millisecond. setTimeout() and setInterval() may not work on server side in most conditions.

print('url', DELAY[, PRINTER]) , this function allows a page (url) to be printed without invoking the standard printing dialog hence makes automatic printing possible. There may be scenario whereby certain data needs to be polled and executed which may take out some time, so engineer can introduce some delays (the second parameter, DELAY) in millisecond to ensure the page is ready before printing. The third parameter PRINTER is an optional parameter which refers to printer name, default printer will be selected for printing if printer name is not supplied, or when the specified printer is not found. This function is needed for periodic printing, for instance, daily or hourly report. This print function always print to system default printer.

[Tip] Tip

Using getTag( 'same_tag') to fetch data from same tag can introduce unnecessary overhead on CPU usage that may impact performance especially on large project or slow CPU. A better approach is to create an internal variable to cache the value then use the variable repeatedly.

var max = getTag( 'Tag001');
for (var i=0; i<max; i++) {
  //do something
}