I want to compare some arrays but what I'm doing is not working.
Here is my code:
VARÂ Â
  i          : INT; Â
  xValueChanged        : BOOL;
  xInitialStatusSensor    : ARRAY [0..5] OFBOOL := [TRUE, FALSE , TRUE, FALSE, FALSE];
  xRunTimeStatusSensor    : ARRAY [0..5] OFBOOL := [TRUE, FALSE , FAlSE, FALSE, FALSE];END_VARFORi:=0TO5DO
 Â
  IFxInitialStatusSensor[i] <>xRunTimeStatusSensor[i] THEN
     Â
    xValueChanged :=TRUE;
  ELSE
     Â
    xValueChanged :=FALSE;
   Â
  END_IFEND_FOR
Any idea?
Thanks in advanced
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the last cycle of your FOR loop the result is determined.
Maybe better to use e.g.:
xValueChanged :=FALSE;FORi:=0TO5DO
  IFxInitialStatusSensor[i] <>xRunTimeStatusSensor[i] THEN
   xValueChanged :=TRUE;
   //EXIToptionally
  END_IFEND_FOR
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I want to compare some arrays but what I'm doing is not working.
Here is my code:
Any idea?
Thanks in advanced
In the last cycle of your FOR loop the result is determined.
Maybe better to use e.g.: