dalporto
Lifetime Supporting Member
[reformatted quoted text to make it easier to read]
[I believe there is an extra END_IF; in there.]
Yes, the syntax is okay; ST is just ugly, it can't help looking weird (this unironically from someone who programmed Fortran for decades).
And that should solve the HMI blip for most cases; if you want to be absolutely sure, you can use CPS(NHWL_Hn, GX_NHWL, 1);(cf. here); to ensure asynchronous HMI comm events cannot interrupt the routine mid-assignment (:=); you could also write to the final memory location only once; i.e. this
IF NHWL_Hn >= 68.0 THEN
NHWL_Hn := 68.0;
ELSE IF NHWL_Hn <= 25.0 THEN
NHWL_Hn := 25.0;
ELSE
NHWL_Hn := NHWL_Hn;
END_IF;
CPS(NHWL_Hn, GX_NHWL, 1);
Yes, this works fine, thank you very much sir.
But the second END IF is mandatory.