LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stacked sequence to flat sequence

hi there...
i am trying to cut down the usage of my stacked sequences and flat sequence..
i have this vi. can someone tell me what i can do in order to keep the same data flow?

Best regards,
Krispiekream
0 Kudos
Message 1 of 15
(3,577 Views)
First thing: Create your subVIs using error clusters. Then you can do it.

Second thing: None of your local variables are necessary. How many times have you been told about this now? 9, 10, 20?
0 Kudos
Message 2 of 15
(3,569 Views)
you mean the subvi i already have, should have error in and error out to them?

oh yeah..the local variables. sorry about those..
i didnt want to break my other STACKED OF SEQUENCES...thats why i just left them the way there are by previous programmer.
i dont see any other way to make this code earlier. i want to avoid the stacked sequences, but i feel like i have to use them because i dont know other way to go from frame 1 to frame 2 to frame 3 without breaking any codes..

note:------the attached vi is not the whole program.


Message Edited by krispiekream on 05-07-2008 05:49 PM
Best regards,
Krispiekream
0 Kudos
Message 3 of 15
(3,562 Views)

you mean the subvi i already have, should have error in and error out to them?

Yes.

i dont see any other way to make this code earlier. i want to avoid the stacked sequences, but i feel like i have to use them because i dont know other way to go from frame 1 to frame 2 to frame 3 without breaking any codes..

As I said, if you have the error clusters you won't need the sequence structures. Try it.
0 Kudos
Message 4 of 15
(3,536 Views)
oh yeah..that works...
just one more question..
does all subvi HAVE TO HAVE error in and error out?

On one of them, i dont have error in and error out becuase that subvi, i am having it print front panel. i dont want to have the
error in and error out be printed as well.




Message Edited by krispiekream on 05-08-2008 12:29 PM
Best regards,
Krispiekream
0 Kudos
Message 5 of 15
(3,505 Views)

does all subvi HAVE TO HAVE error in and error out?

Technically, no. But it's a good idea to get into the habit of this. In fact, I have a subVI on my palette set up as a "Merge VI" with the basic error in/error out structure. Also, it is customary to have the error in be in the lower-left and the error out to be on the lower right, and to use a 4-2-2-4 connector pane, and to have inputs wired to the left, and output on the right. You may want to peruse the LabVIEW Style Guide, which is contained with the LabVIEW documentation.

4-2-2-4 pane:



On one of them, i dont have error in and error out becuase that subvi, i am having it print front panel. i dont want to have the
error in and error out be printed as well.

You can make the control/indicator not visible. On the block diagram, right-click on the control/indicator and select "Hide Control"/"Hide Indicator".


Aside: It looks like you have 2 copies of the "Exit State" VI, with one sitting on top of the other. I say this because there seems to be an offset border on it.



Message Edited by smercurio_fc on 05-08-2008 12:39 PM
0 Kudos
Message 6 of 15
(3,498 Views)


krispiekream wrote:
On one of them, i dont have error in and error out becuase that subvi, i am having it print front panel. i dont want to have the
error in and error out be printed as well.

You can hide any controls that should not be printed, they will continue to function.


krispiekream wrote:




Some general issues:
  • The first case was once controlled by a diagram constant and is thus always the same.
  • You can delete it and (if the constant was true!) wire the output of the wait to the second case structure to creat a data dependency.
  • The 1000 diagram constant should be U32 (notice the coercion dot?)
  • The controls inside the second case should be outside the case. ("File dest", "SN files") for better code readability!
  • Use a more reasonable connector for the error in of the SN files subVI.
  • The error cluster should follow a single horizontal line across the entire diagram. No bends!
Message 7 of 15
(3,491 Views)
Christian wrote;
 
"
Some general issues:
  • ...
  • The error cluster should follow a single horizontal line across the entire diagram. No bends!

"
Sorry to hair split Christian but your words are often taken as amendments to the Ten Commandments. I agree with the erro cluster wire being straight under many cicumstances because the successful completion of a previous step governs how code should proceed.
 
BUT
 
There are often situations were the error cluster is not the focus of the work being done so laying out the code to make the error cluster wires straight can be mis-leading. If the code is doing a sequence of operations on an array, parsing a string, etc, I find it easier to read the code if the "main data wire" is straight and let the error wires bend. Yes its a matter of taste. Smiley Wink
 
Just sharing ideas,
 
Ben 


Message Edited by Ben on 05-08-2008 01:28 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 15
(3,485 Views)
Great, thanks again!



Message Edited by krispiekream on 05-08-2008 01:43 PM
Best regards,
Krispiekream
0 Kudos
Message 9 of 15
(3,476 Views)


Ben wrote:
Sorry to hair split Christian but your words are often taken as amendments to the Ten Commandments. I agree with the erro cluster wire being straight under many cicumstances because the successful completion of a previous step governs how code should proceed.

Yes, I should have ben more specific. "In this simple example of linear code as shown, the error cluster should not have any bends". 🙂
 
In more complex cases, the general rule is to keep related "trains" logically aligned horizontally, e.g. all AI on one line and all AO on another line and not all over the place. Simply keep the related parts of the programs nicely grouped for readability. 
Message 10 of 15
(3,469 Views)