Best Place for a script to manipulate Tag values

Where is the best place for “Black Box Script” ?

I would make an expression tag of dataset type that calls the script with runScript() and the input tags as dynamic function args. Have the script return a 1row x 5column dataset with the five output values. Extract the one column to be logged into another expression tag and enable history on that. The Perspective consumer (and any other displays) would bind the dataset tag to a suitable custom property and use expression bindings in your labels to extract the desired columns.

2 Likes

Thanks Phil,
I am new to ignition.
Could you give more details on “hat calls the script with runScript() and the input tags as dynamic function args.” ?

Do I place the script in “Tag Event Scripts” ?

No, the script needs to be a function in a script module in the global scripting project. The expression would be something like:

runScript("myScriptModule.myBlackBoxFunction", 0, {[.]InputTag1} , {[.]InputTag2}, {[.]InputTag3})

Consider going through Inductive University to familiarize yourself with Ignition’s architecture.