Problem 1: I'm trying to execute a file based on a trigger. It is to accomplish something another SCADA software could do. It will run a batch file that combines csv files into 1 csv file. I am using a trigger tag to change an analog value. Then use that analog value to execute a script tag. The new SRC file (SpawnFile.SRC) and variable was declared in the AppRoot.SRC file per the help documentation and does run. I can tell because at the end of this script, the returned value to the script tag does change per this code.
However, using Spawn function anywhere in my script will not import (invalid function). Using \system.spawn allows the import but does nothing. Any advice appreciated.
{============================ Spawn Module ===================================}
(
PointObj { object value of Analog Status to monitor (input) };
ScriptObj { Script tag object (output) };
)
[ { Local variable }
]
SpawnFile [
\System.Spawn("c:\reports\helloworld.txt");
ScriptObj\Value = PointObj\Value + 1.0;
]
Problem 2: The other issue I have is in the report tag type, I want the file destination to change during runtime. Without user intervention. That way, reports can be organized into a folder structure based on the date.
I select csv file as the output, right click the file path field, and select parameter expression. I select a string tag that represents the file path. The "C" gets cut off from the string value and the field blue color goes away and is no longer dynamic. I'm guessing this is not possible?