Nirtec Studio Forum

General Category => EasyPLC v.5 => Tutorials => Topic started by: david.olilveira on March 17, 2023, 05:54:47 PM

Title: Script Programming
Post by: david.olilveira on March 17, 2023, 05:54:47 PM
how do you write an "and" statement
how do you write an "or" statement
Title: Re: Script Programming
Post by: EasyPLC_Master on March 17, 2023, 06:00:42 PM
Using C# syntax:

AND -> &&

OR -> ||

Title: Re: Script Programming
Post by: david.olilveira on March 17, 2023, 07:00:03 PM
ok, ill be more specific, my fault

I am going through the tutorial package again, this time I am attempting to do them all in script instead of ladder.  (maybe not a good idea?) I'm currently on exercise 2.

I am attempting to create an AND statement with 2 inputs,

Example of what I think I need to achieve:

If(StartButton == true) AND if(Lever == false)
{
     Motor = true;
}


thank you,
Title: Re: Script Programming
Post by: EasyPLC_Master on March 17, 2023, 09:09:24 PM
OK not problem to write the logic using the script code.

The syntax is:

if (StartButton && !Lever)
{
     Motor = true;
}

Or also:

if (StartButton == true && Lever == false)
{
     Motor = true;
}