LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using a case structure selector controlled by a cluster of enums

I have attached a couple of files to get input from the gurus of LV.  My problem is that I can't get data from the lower 5 enums from my DAQ vi.  I'll do my best to explain.
 
In the DAQ.vi program, the selector for the case structure is controlled by a cluster of enums that originates in the IO.vi (see the .jpg file IO.jpg)  The 9 enums control the DAQ acquisition.  When I run the DAQ.vi, I can manually select the different enums (from the DAQ.vi front panel called DAQ signal) and I see the data for each case...P1 through Rad6.  This works great.  However, when I run the IO.vi, I only can see the first 4 data values in the Data Out cluster.  Rad1 - Rad6 are NaN.  For some reason, the enum cluster P1 - Rad6, in the IO.vi is not selecting all of the 9 enums...just P1 - T.  Can an enum cluster be used as a selector??  I can't seem to figure out why only the first 4 enums are displaying data but the others below them are not?  Hopefully someone knows whats going on.
 
Thanks,
ProDev
Download All
0 Kudos
Message 1 of 16
(2,819 Views)
It would have helped if you had posted the main VI as well. What are the sizes of all of the other arrays? You've got a number wired to the 'N' terminal of the for loop but you also auto-index all of the input arrays. You nornally do one or the other. The for loop will only iterate for a count equal to the size of the smallest array. So if the smallest array has only 2 elements, the for loop will only run for two iterations.
Message 2 of 16
(2,800 Views)
Do  all of you input arrays to the for loop have enough elements?
 
 
 
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 16
(2,797 Views)
 
 
Thanks Dennis for the reply,
 
I put the number to the N terminal as I was troubleshooting the problem and forgot to remove it.  I have posted the IO.vi.  This vi will run and acquire data.  Where is the smallest array in this vi... the 9 enum constants?  I want to auto-index the input arrays but I'm not sure this is what I am doing.
0 Kudos
Message 4 of 16
(2,794 Views)

Ben,

Yes, each enum has all 9 elements and I add an element in the enum cluster then chose the proper element.

0 Kudos
Message 5 of 16
(2,793 Views)
If you want someone to look at a VI, you need to remove the password protection. I can tell that you don't have all of your arrays the same size. The cal factors array only has 6 rows. When you have multiple arrays auto-indexed, it is the size of the smallest array that determines how many times the for loop iterates. On the image you posted, you have 4 arrays going into the for loop. I can't see 2 of thme on the actual front panel but my guess is that one of them only has 2 elements.
Message 6 of 16
(2,784 Views)
My apologies Dennis,
 
I tried to remove the password but it told me I couldn't leave it blank.  I'm still learning 😛   The password is io  lowercase just like the VI's name. 
 
Thank you again!!
0 Kudos
Message 7 of 16
(2,774 Views)
As I said, the cal factors array on your front panel only has 6 rows so the for loop will only run 6 times. When I ran your program, this is exactly what I saw. Place an indicator on the 'i' terminal and see what it says when you run the program. I was missing a lot of subVIs so all I could do was run the for loop. If you have data missing, maybe it's happening later in the program.
Message 8 of 16
(2,761 Views)
Awesome, that worked.  I increased the array size of Cal Factors  to 10 elements and now I get all of th data EXCEPT the last one...Rad6. I have checked all of the other arrays going into the For loop and they all are 10 elements or more (I think). I've setup a wire value indicator while the for loop is running and it only goes to Rad5.  The for loop is the source of the problem. What am I overlooking?   
 
Boy, if my wife heard some of he words coming out of my mouth during this she'd have me sleeping with the dogs. 
 
No password this time.
 
Thanks Dennis!!!
0 Kudos
Message 9 of 16
(2,729 Views)
The VI you just posted still has only 6 rows in the CalFactors array. When you added the data, did you go to Edit>Make Current Values Default and then save the VI?
0 Kudos
Message 10 of 16
(2,721 Views)