1 out of 1 members found this post helpful.
Did you find this post helpful?

|
Re: How to detect variable going below zero, without using PBPL ?
Code:
ADCIN Baseline
ADCIN Reference
IF Reference < Baseline THEN
'Sign = negative
'Use subtraction in calculation
'Denote a reduction
ELSE
'Sign = positive
'Use addition in calculation
'Denote an increase
ENDIF
Another possibility is use 128 = 0. If ADC Value < 128, treat as negative... I've created my own positive/negative methods that don't follow the standardized Signed Variable format. The math was easier my way for what I was doing. Just some thoughts that might spur ideas.
Bookmarks