Internet PLC Forum

General => General Discussions => Topic started by: artkraft on April 03, 2021, 12:34:52 PM

Title: comparing value of two DM
Post by: artkraft on April 03, 2021, 12:34:52 PM
I have DM[1] witch is the current position on a linear encoder. I want to know if DM[1] is = to or not greater than+ or- 4 cnts when at rest. If statement is true set Home flag.
Title: Re: comparing value of two DM
Post by: support on April 23, 2021, 08:12:43 AM
You should post this question at the Tech Support board.

It is simple IF THEN ELSE statement

#DEFINELOCAL  targetCount = 1000

IF DM[1] < (targetCount + 4) AND DM[1] >= (targetCount - 4) THEN
    ...
ELSE
   ....
ENDIF