I wish to log data (continuously) when a tag is between a range of values.
In my application, a welding process progresses through a number of steps. There is a tag from the controller which tells me the current step.
I wish to log trend data continuously when the welder is, say, between step 7 and step 10.
1. What is the best way to trigger this action?
2. How can I control the rate at which the data is logged?
Steve
Logging Data based on range of tag values
-
- Posts: 13
- Joined: Tue Sep 04, 2018 1:20 am
Re: Logging Data based on range of tag values
Read the documentation, once in a while it has just what youre looking for.
Create a script module and initialise a Timer and declare a TimeSpan on ScriptCreated event
In the Timer tick event we check if the value is in range and set the Log time interval as so :
Create a script module and initialise a Timer and declare a TimeSpan on ScriptCreated event
Code: Select all
private static Timer logTimer = null;
private TimeSpan interval;
void ScriptModule1_Created(System.Object sender, System.EventArgs e)
{
logTimer = new Timer();
logTimer.Interval = 1000;
logTimer.Enabled = true;
logTimer.Tick += Tock;
interval = new TimeSpan(0);
}
Code: Select all
void Tock(System.Object sender, System.EventArgs e)
{
interval = TimeSpan.FromSeconds(Globals.Tags.IntervalVAL.Value);
Globals.DataLogger1.LogInterval = interval;
if(Globals.Tags.Test_VAL1.Value > 7 && Globals.Tags.Test_VAL1.Value < 10)
{
Globals.DataLogger1.Start() ;
}
else
{
Globals.DataLogger1.Stop() ;
}
}
-
- Posts: 13
- Joined: Tue Sep 04, 2018 1:20 am
Re: Logging Data based on range of tag values
There are certain parameters that the iX developer InteliSense doesnt pick up, for example the DataLoger.LogInterval