LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Outputs One Input

Hi,

 

 

I have about four labview files which have outputs that must go into a single VI with only one input. The problem I have is labview will not let you wire multiple sources into a single sink. I have a state machine setup where it goes through a its routine until it reaches the four VIs which must output their value one at a time to another VI (which only accepts source at a time). I can control which output must be sent out first, second etc. But I can't figure out how to wire them.

 

I have attached a sample vi which shows what I am trying to do. Keep in mind that these files are already in a state machine I am not sure how to add a state machine within a state machine without confusing the hell out of myself

0 Kudos
Message 1 of 21
(5,430 Views)

Your question makes no sense at all, maybe you can clarify.

 

You talk about files, but your example shows four scalars. Is each read from a file? Obvously, a single sink cannot deal with multiple sources, so you need to decide how to handle it.

 

  • You could place the file reading and subsequent processing in a loop, one file at a time.
  • You could read all your files into an array of numbers and have the subVI accept arrays for further processing.
  • ...

 

You talk about state machines... Maybe you could attach your toplevel VI so we have a better idea what you're trying to do.

0 Kudos
Message 2 of 21
(5,421 Views)
Within the VI attached I explain that each scaler represents a VI I tried to make it very simple. I will make a new VI to better demonstrate my objective.
0 Kudos
Message 3 of 21
(5,416 Views)

altenbach wrote:

You talk about files, but your example shows four scalars. Is each read from a file? Obvously, a single sink cannot deal with multiple sources, so you need to decide how to handle it.


Each of the scalers represents a file. I will be adding a attachment soon however, you may look at it as if it were being read from a file.

 

 


altenbach wrote:

 

  • You could place the file reading and subsequent processing in a loop, one file at a time.
  • You could read all your files into an array of numbers and have the subVI accept arrays for further processing.
  • ...

 

You talk about state machines... Maybe you could attach your toplevel VI so we have a better idea what you're trying to do.


        I have no issue with that. My only problem is it is a huge file which contains a lot of subvis which do all the work. I can zip if for you and post it on another website or  link it here.  But it will contain a large amount of sub vi's.

Message Edited by MrSafe on 06-16-2009 03:38 PM
0 Kudos
Message 4 of 21
(5,410 Views)

I have attached the files you need so you may look at it. Please be aware you will be missing the subvis for the instrument.

 

The VERY top level VI which you might be interested in is called "Phase to Test"  located in the pre determined folder. However, I feel you should look at "Test Variables.vi" which is also located in the same folder.

 

Inside Test Variables.vi under the "True" statement you should see another conditional case which is the state machine structure. You will want to be in the "Get Value" state which has Numeric 1, 2, 3, and 4. These are the four values must go into "Display Value" one at a time.

 

I have attached a spreadsheet called "sample" the "Phase To test.vi"  will read this spreadsheet and pass what it reads in column 0 to test variables which will read the value it has been passed to check if any of the stored names matchs which it read it will then pass this matched value to the subvis who will then compare it 1 more time to make that it matchs their case at which point it will instruct the instrument to run a command and proceed to the next row and repeat the same procedure until an "END" value is read from the spreadsheet at which point it will hop out of the state machine and move on to the next phase.

 

I hope you are not sucker punched by all of this as it is quite easy to get lost.

Download All
0 Kudos
Message 5 of 21
(5,402 Views)
i have attached the information you requested. Please let me know if there are any questions you need answered. Thank You
0 Kudos
Message 6 of 21
(5,401 Views)

error.PNG

 

Why not wire the error clusters and call the sub vi 4 times?


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 21
(5,394 Views)


Jeff Bohrer wrote:

error.PNG

 

Why not wire the error clusters and call the sub vi 4 times?


 

That would mean for every subvi I add which outputs a value I must add the "Display Value" vi to that that chain you posted. It isn't very effcient in my eyes granted im no labview guru.

0 Kudos
Message 8 of 21
(5,392 Views)

MrSafe wrote:


Jeff Bohrer wrote:

error.PNG

 

Why not wire the error clusters and call the sub vi 4 times?


 

That would mean for every subvi I add which outputs a value I must add the "Display Value" vi to that that chain you posted. It isn't very effcient in my eyes granted im no labview guru.


You would make the four orange wires into an array and autoindex on a FOR loop containing a single instance of the subVI. Use an array indicator for the values if desired.

Message 9 of 21
(5,382 Views)

I understand auto indexing but I am having a hard time visualising your example. Do you mean take all output values from the subvi auto index them send "display value.vi" one value at a time. Could I add a True and false to that auto index? so that I only send values which are true?

 

I ask that because those subvis will not be sending values all the time only when called to send a value.

0 Kudos
Message 10 of 21
(5,379 Views)