Why Does Iteration Terminal of While Loop Remain 2,147,483,647?

Updated Oct 23, 2023

Reported In

Software

  • LabVIEW
  • LabVIEW FPGA Module

Issue Details

I am using the iteration terminal of While Loop as a counter in LabVIEW FPGA VI. After running the FPGA VI for a while, at some point it keeps outputting the same value of 2,147,483,647 which caused unintended behavior to my application. I am only using the default 40 MHz Onboard Clock when running the FPGA VI.

Why am I getting this number and how can I resolve this issue?

Solution

You are receiving 2,147,483,647 because While Loop iteration terminal (i) has reached its maximum value. This is because the iteration terminal data type is I32. Since iteration terminal count starts at zero for the first iteration, the maximum value that it can output is 2³¹-1= 2,147,483,647.

The iteration terminal count does not rollover and will keep outputting 2,147,483,647. Besides, It is not possible to change the data type of iteration terminal from I32 to other data types.

With FPGA speeds, it is possible for the While Loop iteration terminal to max out rather quickly. If you need a counter to rollover when it reaches its maximum value, you should programmatically implement your own counter.