disable datalogger

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
hans gerritsen
Posts: 26
Joined: Fri Jan 20, 2012 12:55 pm

disable datalogger

Post 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

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: disable datalogger

Post by mark.monroe »

This will disable the datalogger:

Code: Select all

Globals.DataLogger1.IsEnabled = false;
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

hans gerritsen
Posts: 26
Joined: Fri Jan 20, 2012 12:55 pm

Re: disable datalogger

Post by hans gerritsen »

Thanks a lot!

hans gerritsen
Posts: 26
Joined: Fri Jan 20, 2012 12:55 pm

Re: disable datalogger

Post by hans gerritsen »

I've tried "Globals.DataLogger1.IsEnabled = false;"
but is shows a syntax error with the '='.

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: disable datalogger

Post 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.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

hans gerritsen
Posts: 26
Joined: Fri Jan 20, 2012 12:55 pm

Re: disable datalogger

Post 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.

Post Reply