05-15-2017 11:35 AM
Hello,
What would cause data to not pass into a for loop?? I am updating code for a third party DAQ (Model 2000) from QCM Research. I do not have access to the daq, so I am bypassing the DLL's and using the random number generator to send fake data via an array. I can see all data, before it passes into the for loops, using the probe or an indicator. What am I doing wrong?? Could the sequence structure be the problem?? I have attached a zip file that contains the project vi's, but my problem is occurring at the bottom of the Model_2000_System_Mon.vi Block Diagram. Any suggestion are welcomed. Thanks
Solved! Go to Solution.
05-15-2017 12:30 PM
My guess is array2 is empty. Hard to tell with all the local variable abuse going on
05-15-2017 12:39 PM
Yup I was going to say the same thing. A For Loop will run the number of times specified, but if multiple things are telling the loop to run a different number of times, it runs the minimum. In your case you are indexing multiple arrays telling the loop to run potentially different amount of times. If one of those arrays is empty, then it won't run at all. Just like if you wired a 0 to the N terminal.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-15-2017 12:40 PM
Thanks for your input, Jeff. The array isn't empty, because as mentioned .. I probed it, at the entrance to the for loop. I did not place the local variables. According to the engineers from QCM Research, this was written by someone from National Instruments. I am just trying to update it.
05-15-2017 12:48 PM
Okay, thanks Hooovahh. My problem is that I have never had to write code, without the actual hardware for which I am writing the code. So I'm trying to figure out how to trick the software into thinking that it is connected to hardware. I did use a DAQmx simulation once, but this is not NI hardware. I will try something other than arrays. Thanks for your reply. Although it was similar to the last reply, you gave more details for me to better understand.
05-15-2017 12:59 PM
Jeff/Hooovahh,
Array2 is empty in the second for loop and the timer array for the first loop ... thanks.
05-15-2017 01:00 PM
Well, lets look some more
Channel Array is never written anywhere its terminal is hidden and not wired to anything so, when you get to the event Unit Config" Value Change you read the empty value and iterate the for loop inside thee model 2000 unit config sub vi 0 times then autoindex its empty array output to fill Array2 with an empty array (Look right above that write to Array 2 Local and... you see that terminal for Array2? yup- you are also writing Array 2's terminal for every event and---- bingo its wired to nothing!
05-15-2017 01:05 PM
Thanks, Jeff. I did notice that channel array is hidden, but I cannot find any property nodes that could be hiding it. Many things are hidden and I cannot unhide them.
05-15-2017 01:14 PM
Right click the terminal show control, set it via the property browser
05-15-2017 01:21 PM
For the property browser, would I go to View>Class Browser?? How would I get to the property browser from there?? I have never used this feature. Thanks