Page 1 of 1

Simple logic

Posted: Fri Apr 17, 2015 4:57 am
by MhDgS
Dear experts,

I am new in iX Developer and C# and I need to write a simple logic script like this:

IF Bit0 == 1 THEN
Bit1 = 1;
END_IF;

This is what I tried to do in iX, but in my understanding there is something missing, because IF statement doesn't execute.

Code: Select all

    public partial class ScriptModule1
    {
		void Test()
		{
			if (Globals.Tags.BIT0.Value == 1)
				Globals.Tags.BIT1.Value = 1;
		}
    }
Would be very glad if someone could help.

Re: Simple logic

Posted: Wed Jun 10, 2015 3:07 pm
by Kyle W.
Do you still need help with this?

What is the code that is calling the script module? Usually you have some kind of trigger (iX is event driven), so something like a button press or a tag value change and then you call the script module like this:

Globals.[name of script module].[name of method](any parameters);

Re: Simple logic

Posted: Thu Oct 22, 2020 5:53 pm
by ThatGuy
I know this is a really old post but its always nice to have an answer when looking through old forum posts.

the method you have created "void Test()" is never called in this script. You will need some event to call it such as a value change or button press.

I hope this helps someone one day.