Archive Reporter
From SysCAD Documentation
Navigation: User Guide -> Reports -> Archive Reporter
Contents |
Introduction
The Archive Reporter is used for reporting data directly to a database or text file while a project is running. This has some similarities with the SysCAD historian. To use this the Archiver must be switched on. As shown below, on the Archive page for Project Settings dialog, the Archiver should be switched on. Then the SysCAD Archive Configuration (.sac) file is loaded.
Archive Configuration file
The SysCAD Archive Configuration file is a text file defining the location of the archive database. Also, the user can specify how many tables exist within the database. The archive configuration file should be created manually and stored in the project folder.
Please also note that this file is loaded (or reloaded) from the Project Settings Archive tab page, as shown above.
The following explanations refer to steps. The number of steps is usually equal to the number of iterations.
Syntax and Explanation of Options
Syntax
[Table1]
Name = any table name
On = 1
Format = DB/CSV/TXT
Path = $Prj\\Archive
SigDigits = 20
Period = hh:mm:ss
Offset = hh:mm:ss
FieldNN = "FieldName", SysCADTag, Function, MeasurePoint, FirstPoint
TriggerNN = "Description", SysCADTag, TriggerTest
Where NN is a number, for example:
Field1 = "Steps", PlantModel.Stats.Steps, Current
Trigger1 = "Monthly", $Dyn.DateRec.Month, Delta=0.1
Notes:
- All table entries are optional except the Name
- If no Fields are entered then the table will still be created.
- Use Period for reporting at fixed time intervals, OR use Triggers for reporting at irregular time intervals (ie report specified fields based on trigger logic).
- If one or more Triggers are used, a period & offset is not relevant or required.
- If no triggers or period are specified then the table will not accumulate data.
- Comments - Any text between a semicolon(;) and the rest of the line is treated as a comment
Reporting Options
Note: Each table can only have one format but within the same archive file, different tables can have different formats
| Field | Option | Description | Example |
| Format | DB | Access database | Format = DB |
| CSV | CSV file | Format = CSV | |
| TXT | Text file | Format = TXT | |
| Path | A folder name for storing CSV & TXT files (usually with the Project) | Path = $Prj\Archive | |
| SigDigits | 1 .. 20 Number of significant digits written to CSV & TXT files | SigDigits = 10 | |
| Period | Time frequency for reporting fields, where time zero is at start. Note: The period is relative to midnight, not the simulation start time. | Period = 24:00:00 (24 hours) | |
| Offset | Time offset within the specified period. Optional. Zero is the default. This affects when the first set of data is recorded. Note: The offset is relative to midnight, not the simulation start time. | Offset = 02:00:00 (2 hours) | |
Trigger Options
TriggerNN = "Description", SysCADTag, TriggerTest
Note: There can be any number of triggers. If the conditions of any of the triggers are met, then the fields will be reported.
| Term | Option | Description | Example |
| Description | A description of the trigger | "Monthly" | |
| SysCADTag | Any valid SysCAD tag. May have conversions. | $Dyn.DateRec.Month | |
| TriggerTest | Rise [= Value] | The trigger will be true if the value has increased by more than the specified amount since the last recorded value. The last recorded value will either be the first value or the value when the trigger was last true. | Rise = 1.0 |
| StepRise [= Value] | The trigger will be true if the value has increased by more than the specified amount since the last step. | StepRise = 2.0 | |
| Fall [= Value] | The trigger will be true if the value has decreased by more than the specified amount since the last recorded value. The last recorded value will either be the first value or the value when the trigger was last true. | Fall = 3.0 | |
| StepFall [= Value] | The trigger will be true if the value has decreased by more than the specified amount since the last step. | StepFall = 4.0 | |
| Delta [= Value] | The trigger will be true if the value has changed by more than the specified amount since the last recorded value. The last recorded value will either be the first value or the value when the trigger was last true. | Delta = 0.1 | |
| StepDelta [= Value] | The trigger will be true if the value has changed by more than the specified amount since the last step. | StepDelta = 0.2 | |
where [= Value] = Optional Test Value (default = 1.0) – this is used to see where there are sudden changes.
Field Options
FieldNN = "FieldName", SysCADTag, Function, [MeasurePoint, FirstPoint]
| Term | Option | Description | Example |
| FieldName | Report column or field name. Should not contain characters: '.,[] | "Tank1 Level (%)" | |
| SysCADTag | Any valid SysCAD tag. May have conversions. | TNK_1.Lvl (%) | |
| Function | Current/Cur | Returns the current value. | Current |
| CurrentDiff/CurDiff | Only available in SysCAD 9.2. Returns the difference between current value and the current value at the end of the previous reporting period. | CurrentDiff | |
| Minimum/Min | Returns the minimum value for the chosen period. | Min | |
| Maximum/Max | Returns the maximum value for the chosen period. | Max | |
| Average/Avg | Returns the average value for the chosen period. | Avg | |
| Sum | Returns the total of the reported tag for the report period. Note: The SysCAD tag MUST be on a per second basis (eg P_1.Qm (t/s)). | Sum | |
| SumTotal/SumTtl | Only available in SysCAD 9.2. Returns the total of the reported tag since the beginning of the run. Note: The SysCAD tag MUST be on a per second basis (eg P_1.Qm (t/s)). | SumTotal | |
| Time()/Time | Only available in SysCAD 9.2. Returns the number of seconds for the report period. This will be equal to the number of steps in the report period multiplied by the timestep. Any valid SysCAD tag can be specified. | Time() | |
| TimeTotal()/TimeTtl()/TimeTotal/TimeTtl | Only available in SysCAD 9.2. Returns the number of seconds since the beginning of the run. This will be equal to the total number of steps since the beginninig of the run multiplied by the timestep. Any valid SysCAD tag can be specified. | TimeTotal() | |
| Time(operator,value,[timeunit]) | Only available in SysCAD 9.2. Returns the amount of time in the report period that the reported tag meets the condition specified using operator and value. Valid operators are <, <=, ==, <>, >= and >. Value can be any number. Timeunit is optional (default is seconds), options are s, m, h or d. | Time(>,50,m) | |
| TimeTotal(operator,value,[timeunit]) /TimeTtl(operator,value,[timeunit]) | Only available in SysCAD 9.2. Returns the amount of time since the beginning of the run that the reported tag meets the condition specified using operator and value. Valid operators are <, <=, ==, <>, >= and >. Value can be any number. Timeunit is optional (default is seconds), options are s, m, h or d. | TimeTotal(>,50,m) | |
| TimeInRange(low operator,low value,high operator,high value,[timeunit]) | Only available in SysCAD 9.2. Returns the amount of time in the report period that the reported tag is within the range specified. Valid low operators are > and >=. Valid high operators are < and <=. Low value and high value can be any numbers. Timeunit is optional (default is seconds), options are s, m, h or d. | TimeInRange(>,10,<=,90) | |
| TimeInRangeTotal(low operator,low value,high operator,high value,[timeunit]) | Only available in SysCAD 9.2. Returns the amount of time since the beginninig of the run that the reported tag is within the range specified. Valid low operators are > and >=. Valid high operators are < and <=. Low value and high value can be any numbers. Timeunit is optional (default is seconds), options are s, m, h or d. | TimeInRangeTotal(>,10,<=,90) | |
| TimeOutRange(low operator,low value,high operator,high value,[timeunit]) | Only available in SysCAD 9.2. Returns the amount of time in the report period that the reported tag is outside the range specified. Valid low operators are < and <=. Valid high operators are > and >=. Low value and high value can be any numbers. Timeunit is optional (default is seconds), options are s, m, h or d. | TimeOutRange(<=,10,>,90,m) | |
| TimeOutRangeTotal(low operator,low value,high operator,high value,[timeunit]) | Only available in SysCAD 9.2. Returns the amount of time since the beginning of the run that the reported tag is outside the range specified. Valid low operators are < and <=. Valid high operators are > and >=. Low value and high value can be any numbers. Timeunit is optional (default is seconds), options are s, m, h or d. | TimeOutRangeTotal(<=,10,>,90,m) | |
| Count/Cnt | Returns the number of recorded values for the report period. This will be equal to the number of steps in the report period. Any valid SysCAD tag can be specified. | Count | |
| ChangeCount/ChgCnt | Returns the number of times the reported tag changed by more than 0.001 (in SI Units) during the report period. | ChgCnt | |
| String/Str | Returns the current value of a string. Note: the SysCAD tag must be a string. | Str | |
| MeasurePt | StartPt | The value of the SysCAD tag at the beginning of a step. | StartPt |
| EndPt | The value of the SysCAD tag at the end of a step. | EndPt | |
| MidPt | The value of the SysCAD tag halfway through the step. | MidPt | |
| FirstPoint | IgnoreFirst | Ignores the first value at the start of the run. i.e if the first value for the tank is 0 and it goes to 29 at the end of the first step, 29 will be recorded as the first value if the IgnoreFirst option is used. | IgnoreFirst |
| UseFirst | Use the first value at the start of the run. | UseFirst | |
Notes:
- MeasurePt is optional. The default is EndPt.
- FirstPoint is optional. The default is IgnoreFirst.
Example
An example SysCAD Archive Configuration file (text file with the .sac extension) is as follows:
;============================================================= ;===== SysCAD Archive configuration file ===== ;============================================================= [Options] DBFile = $Prj\Archive.MDB AllowAccess= 0 ;============================================================= [Columns] DateTime = 0 Date = 1 Time = 1 ElapsedHMS = 0 ElapsedDbl = s Command = 0 Type = 1 Tag = 1 Source = 1 IDNo = 0 IterNo = 0 CallNo = 0 SeqNo = 0 Message = 1 ;============================================================= [MessageLog] ; System table On = 1 Format = DB ;============================================================= [EventLog] ; System table On = 1 Format = DB ;============================================================= [Table1] Name = Daily On = 1 Format = DB Period = 24:00:00 Field1 = "Steps", PlantModel.Stats.Steps, Current Field2 = "Tank1 Level (%)", TNK_1.Lvl (%), Current Field3 = "Tank1 Level Difference (%)", TNK_1.Lvl (%), CurrentDiff Field4 = "Tank1 Min Level (%)", TNK_1.Lvl (%), Minimum Field5 = "Tank1 Max Level (%)", TNK_1.Lvl (%), Maximum Field6 = "Tank1 Ave Level (%)", TNK_1.Lvl (%), Average Field7 = "Total Tank Feed", TNK_1.QFeed.QMt (kg/s), Sum Field8 = "Total Tank Feed since start", TNK_1.QFeed.QMt (kg/s), SumTotal [Table2] Name = Monthly On = 1 Format = CSV Path = $Prj\Archive Trigger1 = "Monthly", $Dyn.DateRec.Month, Delta=0.1 Field1 = "Steps", PlantModel.Stats.Steps, Current Field2 = "Month", $Dyn.DateRec.MonthDesc, String Field3 = "Tank1 Level (%)", TNK_1.Lvl (%), Current Field4 = "Tank1 Level Difference (%)", TNK_1.Lvl (%), CurrentDiff Field5 = "Tank1 Min Level (%)", TNK_1.Lvl (%), Minimum Field6 = "Tank1 Max Level (%)", TNK_1.Lvl (%), Maximum Field7 = "Tank1 Ave Level (%)", TNK_1.Lvl (%), Average Field8 = "Total Tank Feed", TNK_1.QFeed.QMt (kg/s), Sum Field9 = "Total Tank Feed since start", TNK_1.QFeed.QMt (kg/s), SumTotal
[Table3] Name = Mass Balance for Period On = 1 Format = CSV Path = $Prj\Archive Trigger1 = "1 tonne of Feed", P_001.Qo.Total.QMt (t), Delta=1 Field1 = "Steps", PlantModel.Stats.Steps, Current Field2 = "Simulation Time", PlantModel.Stats.SimulationTime (s), Current Field3 = "Total Feed (t)", TNK_001.QFeed.QMt (t/s), Sum Field4 = "Total Output1 (t)", P_002.Qo.QMt (t/s), Sum Field5 = "Total Output2 (t)", P_003.Qo.QMt (t/s), Sum Field6 = "Tank1 Initial Mass (t)", TNK_001.Content.InitMt (t), Current Field7 = "Spilt from Tank1 (t)", TNK_001.Content.Spill.Rate (t/s), Sum Field8 = "Vented from Tank1 (t)", TNK_001.Content.Vent.Rate (t/s), Sum Field9 = "Tank1 Current Mass (t)", TNK_001.Mt (t), Current ;MassBalance:TotalFeed=TotalOut+SurgeAccumulation+Spilt+Vented ;MassBalance:Field3=(Field4+Field5)+(Field9-Field6)+Field7+Field8
[Table4] Name = Mass Balance from Beginning On = 1 Format = CSV Path = $Prj\Archive Trigger1 = "1 tonne of Feed", P_001.Qo.Total.QMt (t), Delta=1 Field1 = "Steps", PlantModel.Stats.Steps, Current Field2 = "Simulation Time", PlantModel.Stats.SimulationTime (s), Current Field3 = "Total Feed (t)", TNK_001.QFeed.QMt (t/s), SumTotal Field4 = "Total Output1 (t)", P_002.Qo.Total.QMt (t), Current Field5 = "Total Output2 (t)", P_003.Qo.Total.QMt (t), Current Field6 = "Tank1 Total Mass Change (t)", TNK_001.Content.DeltaMt (t), Current Field7 = "Spilt from Tank1 (t)", TNK_001.Content.Spill.Rate (t/s), SumTotal Field8 = "Vented from Tank1 (t)", TNK_001.Content.Vent.Rate (t/s), SumTotal Field9 = "Tank1 Current Mass (t)", TNK_001.Mt (t), Current ;MassBalance:TotalFeed=TotalOut+SurgeAccumulation+Spilt+Vented ;MassBalance:Field3=(Field4+Field5)+Field6+Field7+Field8
[Table5] Name = Monthly Reporting On = 1 Format = CSV Path = $Prj\Archive Trigger1 = "Monthly", $Dyn.DateRec.Month, Delta=0.1 Field1 = "Simulated Time", TNK_001.Lvl (%), Time Field2 = "Total Simulated Time", TNK_001.Lvl (%), TimeTotal Field3 = "Seconds > 50%", TNK_001.Lvl (%), Time(>,50) Field4 = "Minutes > 50%", TNK_001.Lvl (%), Time(>,50,m) Field5 = "Total Minutes > 50%", TNK_001.Lvl (%), TimeTtl(>,50,m) Field6 = "Seconds 10%<Level=<90%", TNK_001.Lvl (%), TimeInRange(>,10,<=,90) Field7 = "Total Seconds 10%<Level=<90%", TNK_001.Lvl (%), TimeInRangeTotal(>,10,<=,90) Field8 = "Minutes Level<=10% or Level>90%", TNK_001.Lvl (%), TimeOutRange(<=,10,>,90,m) Field9 = "Total Minutes Level<=10% or Level>90%", TNK_001.Lvl (%), TimeOutRangeTotal(<=,10,>,90,m)
The above example consists of five tables:
Table 1) "Daily" - Data for the eight fields will be recorded at 24 hour intervals and placed in a table called Daily in the Archive.mdb database file which is stored in the project folder.
Table 2) "Monthly" - Data for the nine fields will be recorded when the month changes and placed in a csv file called Monthly.csv which is stored in the Archive subfolder in the project folder.
Table 3) "Mass Balance for Period" - Data for the nine fields will be recorded every time the flow in pipe P_001 increases by 1 tonne and placed in a csv file called Mass Balance for Period.csv which is stored in the Archive subfolder in the project folder. The two lines at the end of the table in green are comments. This table provides the data required to perform a mass balance around tank 1 for each reporting period.
Table 4) "Mass Balance from Beginning" - Data for the nine fields will be recorded every time the flow in pipe P_001 increases by 1 tonne and placed in a csv file called Mass Balance from Beginning.csv which is stored in the Archive subfolder in the project folder. The two lines at the end of the table in green are comments. This table provides the data required to perform a mass balance around tank 1 from the beginning of the simulation run.
Table 5) "Monthly Reporting" - Data for the nine fields will be recorded when the month changes and placed in a csv file called Monthly Reporting.csv which is stored in the Archive subfolder in the project folder. This table demonstrates the use of the time functions.
Archive Options
To see the Archive Options dialog box, go to Tools\Archive Options (in SysCAD 9.2) or Options\Archive Options (in SysCAD 9.1).
The Archive Options dialog box shows the tables that have been created and their frequency of data recording. The following dialog box is generated using the example described above.



