LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getting rid of stack sequence

hello,
i am trying to clean up my code because i have too many local variables.
i need to make it more easier to read. can someone suggest some ways to get rid of the current stack sequence?
i have some pictures.
thank you for your time.








here is what's in the subvi



Message Edited by krispiekream on 07-08-2008 01:22 PM
Best regards,
Krispiekream
0 Kudos
Message 1 of 18
(3,468 Views)
You don't fax a picture of you to your doctor and expect him to diagnose you. So why attach a picture of your code and expect us to troubleshoot? 😄
 
If you want help, attach some real code!
 
Things we cannot tell!
  • In frame 1, what happens in the TRUE case?
  • Why do you need to read the "temp target local twice in a row. Is there a chance it will change?
  • I only see locals. Where are the terminals?
  • You have 3 subVIs, but you only show us one.
  • In the subVI, What happens in the other frames?
  • in the subVI, how many "index array" do you possibly need for the same input? One is typically enough, you can resize it.
  • ...
(Also keep your images less than about 800pixels wide!)


Message Edited by altenbach on 07-08-2008 11:32 AM
0 Kudos
Message 2 of 18
(3,455 Views)
i copied and paste this part of my big code into this.

Best regards,
Krispiekream
Download All
0 Kudos
Message 3 of 18
(3,431 Views)
"I only see locals. Where are the terminals?"
the terminals are somewhere else in the code.
this code has too many stacked sequence and too hard to follow. thats why i am working on making it easier to read

if i do something like this.
would it still be exactly like what i had or will i face race condition?




Message Edited by krispiekream on 07-08-2008 04:08 PM

Message Edited by krispiekream on 07-08-2008 04:12 PM
Best regards,
Krispiekream
0 Kudos
Message 4 of 18
(3,423 Views)
As far as I can tell, that looks similar to the sequence of frames you had above.  I don't see any race conditions within the case structure of code you posted.
 
One possible exception is the writing of the false constant to backporch.  In your previous code, it was guaranteed to happen after the code that occurred in the 2nd frame.  Now it can happen anytime during the execution of that True case, and will likely happen very early.  Whether that is a problem for you will be for you to determine.
 
In your subVI you use 5 different index arrays to index out elements 0-4 of the args array.  You can use just a single index array.  You can expand down the border of the VI to get more outputs, since you are looking for 0 through 4, you won't even need to wire in any constants for the indices for that function.


Message Edited by Ravens Fan on 07-08-2008 05:22 PM
0 Kudos
Message 5 of 18
(3,412 Views)


krispiekream wrote:
if i do something like this.
would it still be exactly like what i had or will i face race condition?

As I said, DON'T embed images that are wider than a typical browser window.
It is almost impossible to read replies, because the wrap ouside the frame and we constantly need to scroll.
 
You can attach them, but don't embed them into the post. Please!
0 Kudos
Message 6 of 18
(3,404 Views)
I tried that out too and i realized everything does work normally except for one thing.
the Stat_data_meas_param value is not coming out right.
the original sequence give me a value of NaN while the new one i did always give me 0
can someone show me how to bring out the Stat_data_meas_param from Meas_Mod subvi
i think thats where my problem is. i dontk now how to work with subvi so well.
what i did was i copied the Stat_data_meas_param global and paste it into Meas_Mod
then i connect the terminal. that is how you do it right?

Best regards,
Krispiekream
0 Kudos
Message 7 of 18
(3,402 Views)
altenbach, sorry about the images being too wide. i thought it would be easier to view.
but i'll wont do that next time

Best regards,
Krispiekream
0 Kudos
Message 8 of 18
(3,399 Views)


krispiekream wrote:
I tried that out too and i realized everything does work normally except for one thing.
the Stat_data_meas_param value is not coming out right.

Where is the "cluster output" on the subVI diagram connected to the output connector? Are you still writing to the global somewhere?
0 Kudos
Message 9 of 18
(3,388 Views)


krispiekream wrote:
hello,
i am trying to clean up my code because i have too many local variables.

Yes..  there were too many Locals..  and Globals..
 
How is the code now?  It is difficult to tell with only some screen captures.
 
R
0 Kudos
Message 10 of 18
(3,377 Views)