Support Forums
AND Operator error

Hello,

I'm new to DataTaker programming and need some help with the AND operator:
The next line gives me an error and I can not figure out why:
IF((599CV==93)and(600CV==0)){600CV=1;XB}

Just testing to expressions and if result of both is "1": set 600CV to 1 and execute XB.

Thanks in advance.

Hello, I'm new to DataTaker programming and need some help with the AND operator: The next line gives me an error and I can not figure out why: IF((599CV==93)and(600CV==0)){600CV=1;XB} Just testing to expressions and if result of both is "1": set 600CV to 1 and execute XB. Thanks in advance.

Hi Msmax,

You can have two method of writing AND condition:

  1. directly to conditional statement
    IF(599CV==93)AND IF(600CV==0){600CV=1;XB}

  2. Indirectly by using another channel variable

  3. in two lines
    700CV=((599CV=1)AND(600CV=1))
    IF(700CV==1){600CV=1;XB}

  4. or in one line
    IF((700CV=((599CV=1)AND(600CV=1)))==1){600CV=1;XB}

Notes for point 2: 700CV will have a value of 1 if the condition is true and 0 if it is false,

Best regards,
Rudy Gunawan

Hi Msmax, You can have two method of writing AND condition: 1. directly to conditional statement IF(599CV==93)AND IF(600CV==0){600CV=1;XB} 2. Indirectly by using another channel variable - in two lines 700CV=((599CV=1)AND(600CV=1)) IF(700CV==1){600CV=1;XB} - or in one line IF((700CV=((599CV=1)AND(600CV=1)))==1){600CV=1;XB} Notes for point 2: 700CV will have a value of 1 if the condition is true and 0 if it is false, Best regards, Rudy Gunawan
16
2
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft