I've seen similar to this reported back in 2014.
A loop with a count > 255 needs a word as the index and this indeed now works when using an integer count.
However if using a variable as the loop index then flowcode only assigns a byte variable.
[img] [/img]
Generates (correctly)
Code: Select all
MX_UINT16 FCLV_LOOP1;
.
.
for (FCLV_LOOP1=0; (FCLV_LOOP1)<(1000); (FCLV_LOOP1)++)
[img] [/img]
Where x is greater than 8 bits generates the following C
Code: Select all
MX_UINT8 FCLV_LOOP1;
.
.
for (FCLV_LOOP1=0; (FCLV_LOOP1)<(FCV_X); (FCLV_LOOP1)++)
A workaround is easy - using a user-defined loop variable in a 'for' loop or a 'repeat until' loop.
It can catch the unwary however.....
Martin