Page 1 of 1

Dynamic datalogger

Posted: Mon Nov 12, 2012 6:08 am
by sunks75
Hi, I'm working with iX Developer 2.0 and the T10A HMI.

Is there a way to dynamically create and initiate dataloggers under runtime?
..or maybe enable/disable some of the items in a datalogger?

Also, can report names be accessed and edited during runtime?

My application reads from 10+ devices via modbus and I'm using dataloggers and pre-defined report templates to export the data to .xls files.
Instead, I would like for the user to be able to select which devices should be logged, the sample frequency and provide a file name.

(Frequency I know I can achieve from logging on an event and setting that event to fire at t=x(ms))

Thanks

Stuart

Re: Dynamic datalogger

Posted: Mon Nov 12, 2012 9:15 am
by mark.monroe
You can not dynamically create or change a datalogger. You would have to create 10+ dataloggers and then a different tag in each one to trigger a logging event.

In iX SP1, you should be able to start/stop a datalogger. This will not work in version 2.0.356. But if you want to change the logging frequency, then you might as well use a trigger tag for each data logger and then only trigger the dataloggers that you want to log data for.

Code: Select all

        void btnLog_Click(System.Object sender, System.EventArgs e)
        {
            if (Globals.Tags.LogState.Value == 1)
            {
                Globals.DataLogger1.Stop();
                Globals.DataLogger1.Clear(false);
            } else {
                Globals.DataLogger1.Start();
                Globals.Tags.LogState.Value=1;
            }
        }
There is no way to change the name of the report when it is generated.

Re: Dynamic datalogger

Posted: Wed Nov 14, 2012 2:25 am
by sunks75
OK, thanks Mark!
That was something I would never have thought of - using one data logger for each device.
My next question is about the export possibilities of this data.
Can I export from multiple data loggers to a single report?
What would be the syntax in the template?

Re: Dynamic datalogger

Posted: Wed Nov 14, 2012 8:49 am
by mark.monroe
Each datalogger is referenced via its name. The Sample_Report project, which is a sample project included with iX, references a data logger called Datalogger1, because that is its name.

If you want to reference Datalogger2, then just use that name. All the dataloggers are stored in the same database file, so you just need to change the name of the table you are referencing.