Page 1 of 1

disable datalogger

Posted: Mon Apr 15, 2013 3:17 am
by hans gerritsen
Hi,

I want to be able to disable a datalogger at runtime/via a tag.
Is there a way to do this in a script?
Else is it possible to change the logInterval parameter via scripting?

regards

Hans

Re: disable datalogger

Posted: Mon Apr 15, 2013 8:56 am
by mark.monroe
This will disable the datalogger:

Code: Select all

Globals.DataLogger1.IsEnabled = false;

Re: disable datalogger

Posted: Mon Apr 15, 2013 2:12 pm
by hans gerritsen
Thanks a lot!

Re: disable datalogger

Posted: Tue Apr 16, 2013 1:48 am
by hans gerritsen
I've tried "Globals.DataLogger1.IsEnabled = false;"
but is shows a syntax error with the '='.

Re: disable datalogger

Posted: Tue Apr 16, 2013 8:00 am
by mark.monroe
That code works on iX Dev 2.0.463. You may not have a datalogger named Datalogger1. Best to consult with a C# programmer that can help you figure out what the error means.

Re: disable datalogger

Posted: Wed Apr 17, 2013 1:53 pm
by hans gerritsen
With an existing trend "TrendLoggingKort_T2" I tried the following.

namespace Neo.ApplicationFramework.Generated
{
using System.Windows.Forms;
using System;
using System.Drawing;
using Neo.ApplicationFramework.Tools;
using Neo.ApplicationFramework.Common.Graphics.Logic;
using Neo.ApplicationFramework.Controls;
using Neo.ApplicationFramework.Interfaces;


public partial class Logging
{
public void SwitchTrendlogginOff()
{
Globals.TrendLoggingKort_T2.IsEnabled = false;
}
}
}

When compiling I get the message: Property or indexer 'Neo.ApplicationFramework.Tools.Datalogger.IsEnabled' cannot be assigned to -- it is read only.