Hi All,
I'm facing an error defining a data type as byte to realize a simple counter......
here the ST code:
IF rst THEN
cnt:= 0;
Q0 := 0;
Q1 := 0;
Q2 := 0;
Q3 := 0;
Q4 := 0;
Q5 := 0;
Q6 := 0;
Q7 := 0;
ELSIF clk THEN
cnt:= cnt +1;
Q0 := cnt.0;
Q1 := cnt.1;
Q2 := cnt.2;
Q3 := cnt.3;
Q4 := cnt.4;
Q5 := cnt.5;
Q6 := cnt.6;
Q7 := cnt.7;
END_IF;
Compiling the code , system give the follow error refer to tag call cnt
E1092 different data type ('cnt:BYTE'<->'cnt + 1:ANY_NUM')
If define the tag cnt as INT then no problem to code compile.
Question is how is possible realize a counter using just a byte and not a word???
Thanks in advance
I'm facing an error defining a data type as byte to realize a simple counter......
here the ST code:
IF rst THEN
cnt:= 0;
Q0 := 0;
Q1 := 0;
Q2 := 0;
Q3 := 0;
Q4 := 0;
Q5 := 0;
Q6 := 0;
Q7 := 0;
ELSIF clk THEN
cnt:= cnt +1;
Q0 := cnt.0;
Q1 := cnt.1;
Q2 := cnt.2;
Q3 := cnt.3;
Q4 := cnt.4;
Q5 := cnt.5;
Q6 := cnt.6;
Q7 := cnt.7;
END_IF;
Compiling the code , system give the follow error refer to tag call cnt
E1092 different data type ('cnt:BYTE'<->'cnt + 1:ANY_NUM')
If define the tag cnt as INT then no problem to code compile.
Question is how is possible realize a counter using just a byte and not a word???
Thanks in advance