LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

passing an array out of a case structure

Hello,
 
I'm using Labview 6.1.  My simple test application preforms two task: (1) passes selected listbox items to another listbox (recieving listbox) after a button named "ADD" is pressed  (2) Builds an array of DAQ I/O channels (0,1,2,3,ect) that have a one to one corespondence with  the selected listbox items. The application is composed of a FOR structure inside a case statement.  The FOR structure builds both a string array and a DAQ I/O array.  Everything works ok if I put the receiving listbox (using listbox's property "item names") in the case structure.  However, if the receiving list box (using the listbox's property "item names") is outside the case structure, it doesn't get filled.  Why doesn't the string array get passed outside the case structure?
 
Thanks,
Steve    
0 Kudos
Message 1 of 11
(4,057 Views)
This is something that could be caused by a number of things...  Post your code or a picture of your block diagram where the problem is, and we'll be better able to help solve it!
0 Kudos
Message 2 of 11
(4,046 Views)
See attached file.
0 Kudos
Message 3 of 11
(4,041 Views)
It's probably because the false case is returning an empty array. Do you have the exit tunnel of the case statement "use Default if Unwired"?
If you don't, what do you have wired to the exit tunnel in the other case? One way to fix the problem is to wire the output of the case statement to a shift register and feed the shift register (left side) into the case statement and straight through in the false case. Another way would be to skip the case statement and use an event structure. You would still want to use a shift register to pass the values to another event.
0 Kudos
Message 4 of 11
(4,033 Views)

Your code is working properly but you can not see. When you press "Add" button everything is OK. After that while you are NOT pressing "Add" button your Case structure produces default values for all outgoing tunnels. Default value is empty array. You can check "Synchronous display" for resulting indicators or add Wait VI into loop to see the result.

You could change your algorithm using Event structure and/or Shift register.

Bag your pardon for my english Smiley Sad

Message Edited by EVS on 08-24-2005 07:52 PM


Jack
Win XP
LabVIEW 6.1, 7.0, 7.1, LabWindows/ CVI 7.1
Let us speek Russian 🙂
0 Kudos
Message 5 of 11
(4,029 Views)

I attached a file showing the situation where the listbox property node and daq i/o array are in the case structure (select_inside.vi).

0 Kudos
Message 6 of 11
(4,026 Views)
A small addition to your code. It works 🙂
 
regards,
Jack

Jack
Win XP
LabVIEW 6.1, 7.0, 7.1, LabWindows/ CVI 7.1
Let us speek Russian 🙂
0 Kudos
Message 7 of 11
(4,023 Views)

Thanks guys,

Jack, 

Thanks for the code, however, I'm using Labview 6.1.  Is there a way to convert Labview 7 to Labview 6.1?

Thanks,

Steve

0 Kudos
Message 8 of 11
(4,016 Views)
Hello Jack,
 
Please attach an alt-print screen copy of the code.
 
Thanks,
Steve
0 Kudos
Message 9 of 11
(4,012 Views)
With pleasure 🙂

Jack
Win XP
LabVIEW 6.1, 7.0, 7.1, LabWindows/ CVI 7.1
Let us speek Russian 🙂
0 Kudos
Message 10 of 11
(4,010 Views)