Hello,
One way to accomplish this is to use persistent variables in the MathScript Node. A persistent variable will retain its value in-between invocations of the node. Simply declare your variables using the persistent keyword.
persistent ubIndex bHeaderThen, you can pass in an initialize boolean that corresponds to the first iteration of the loop. In your code, you can initialize the variables the first time using
if (init)
ubIndex = 0;
bHeader = 0;
endThe simplest way to pass in the initialize boolean is to wire the Equal To 0? primitive to the loop iteration terminal. Then wire its output to a boolean input variable on the MathScript Node.
Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments