Hi, i am trying to compare a string value in an IF statement
My string value is user defined string called Barcode_String max characters 26. This can not be changed as it is used across the plant.
I pass that barcode string in to my AOI to a parameter called inBarcodeID which is of the same data type.
i want to know if there was a no read and in this case the value would be 00000000
IF inBarcodeID = 00000000 THEN
or
IF inBarcodeID = '00000000' THEN
does not work because of mixing data types, it wont compile.
so I have tried
IF inBarcodeID.DATA[0] = 0 THEN
noRead := 1;
END_IF;
but noRead does not change, i also tried
CASE inBarcodeID.DATA[0] OF
0 : noRead := 1;
END_CASE;
but this also doesn't change, has anyone got experience with trying to do comparisons like this?
My string value is user defined string called Barcode_String max characters 26. This can not be changed as it is used across the plant.
I pass that barcode string in to my AOI to a parameter called inBarcodeID which is of the same data type.
i want to know if there was a no read and in this case the value would be 00000000
IF inBarcodeID = 00000000 THEN
or
IF inBarcodeID = '00000000' THEN
does not work because of mixing data types, it wont compile.
so I have tried
IF inBarcodeID.DATA[0] = 0 THEN
noRead := 1;
END_IF;
but noRead does not change, i also tried
CASE inBarcodeID.DATA[0] OF
0 : noRead := 1;
END_CASE;
but this also doesn't change, has anyone got experience with trying to do comparisons like this?
Last edited: