06-17-2016 12:58 PM
I have this situation where I have many variables, but when I get through the loop that evaluates the variables in matlab, only the first two pass through. Any idea why my code is doing this?
06-17-2016 01:12 PM
Hi jmaslek,
attaching a VI, which relates on a LVOOP class quite heavily, is senseless when we don't have access to that class…
Why do you need MATLAB nodes to evaluate those functions?
Why are there Matlab nodes which don't create any outputs?
And do you really need 2D arrays of OOP objects?
06-17-2016 01:19 PM
Hello and thanks for the reply. We are using matlab nodes because we have several user defined functions that are stored there. Some have no outputs so that they initialize the variables and their variables.
Honestly, I am not sure where the 2D arrays are, when I control+H and scroll over the wires, they all say 1D arrays.
I am attaching a ZIP with the LVCLass and associated VIs
06-17-2016 01:33 PM
Hi jmaslek,
there are still a lot of (inherited?) classes missing!
And the 2D array is formed at the output of your two stacked FOR loops using autoindeing tunnels: each loop border adds a dimension to the array! (Pretty basic LabVIEW stuff…)
06-17-2016 01:39 PM
I see now. I was only looking at the input of the loops 😐 Those don't seem to be causing an issue, because I am using a property node (unless that is an issue) with the lvclass as a reference.
My issue comes in that my loop only goes through 2 iterations, no matter how many variables I have in my class.
06-17-2016 02:03 PM
Hi jmaslek,
My issue comes in that my loop only goes through 2 iterations, no matter how many variables I have in my class.
The rules for FOR loop iterations are rather simple:
- the value wired to the "N" input of the loop
- the size of arrays (or better: the size in N-th dimension of a N-dimensional array) for autoindexing input tunnels
The smallest number "wins" for all of those input parameters.
So when a FOR loop only iterates twice then one input is limiting this to just 2 iterations!
Ever used probes to find out?
06-17-2016 02:10 PM
I have been probing. I am attaching a couple images that show the probes. At 14, the probe shows 4 variables, (a,b,c,d). But the probe at 13 only alternates between a and b.
06-17-2016 02:16 PM
06-17-2016 02:27 PM
Okay I see now that there is also the error in, which has 2 elements (i.e. the two iterations). That fixed that, but I run into more errors, telling me there is an invalid input parameter at a certain VI (VariableManager.lvclass:Write SequenceValues" but only when the sequence boolean is false.
If I insert a probe, LV crashes immediately without the error message.
06-17-2016 02:28 PM