Simple logic

Post Reply
MhDgS
Posts: 2
Joined: Fri Apr 17, 2015 4:34 am

Simple logic

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

User avatar
Kyle W.
Posts: 36
Joined: Wed Apr 09, 2014 3:16 pm

Re: Simple logic

Post 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);
Best Regards,

Kyle W. | Applications Engineer
Beijer Electronics, Inc.

ThatGuy
Posts: 10
Joined: Wed Sep 13, 2017 10:20 pm

Re: Simple logic

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

Post Reply