LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with LabVIEW code

I need help with a piece of code in attached files.I'm using several loop structures and want to form a cluster named Client cluster which has client name array,work order numbers per client and position number per work order number. You can modify the code in any way you want to get the desired cluster.I am not getting correct values in Clients array and Work order array.
Thank You
Download All
0 Kudos
Message 1 of 4
(2,838 Views)
What you need to use is a shift register to contain the data that's returned by the subVI. The subVI will return data when the case is true but once the case goes false, what's being output is the default and that's an empty string. To use a single shift register, bundle the subVI outputs together. Your false case would then input the contents of the shift register on the left side and simply pass it through.
Message 2 of 4
(2,838 Views)
Hi Dennis,
I tried putting shift registers wherever i could, but it didn't work. With my code without any shift registers,what i get as output is something like this:
If I enter clients A,B,C and Work orders A1,A2,A3 for Client A, B1,B2,B3, for client B, and C1,C2,C3 for client C, I get B,C,and empty string in clients array as the output and in 2D work order array i get A1,A2,A3,B1 as the 0th row, B2,B3,C1, empty string as the 1st row and C2,C3,empty string,empty string as the 2nd row, assuming each row contains work orders for each client. And then when i put barcode for each products per work order for each client, i get all 0 in the 2D position array. I guess i'm not using loop structures properly or not able to pass the values among loops as required.
I want to get output which will have a 1D array with all clients, a 2D array with all work orders, each row being work orders for clients in Client array, and a 2D array with each element having comma separated positions for each work order, so that each row will have positions corresponding to work orders for a client.
If possible, can you please make changes to my code and give me modified code so that i can understand your solution ?
Thank You
0 Kudos
Message 3 of 4
(2,838 Views)
Here's a very simple example that uses your subVI. From this I hope you can understand the use of shift registers and how using the default from a case statement can get you into trouble.
0 Kudos
Message 4 of 4
(2,838 Views)