LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to link on command data transfer from Indicator within loop to control that proceeds loop

Solved!
Go to solution

Hello,

 

I am semi new to using LabVIEW and have been handed down a VI and am stumped on how to incorporate a few things.

I have an indicator within a case structure within an event structure that I want to relay back to a control that precedes the structures upon command, some sort of button.

I.e. Push button, value in control becomes that of the indicator.

 

Secondly I have tab that runs a system and collects max points within a loop.  I am attempting to collect that data in an array in a separate tab using an event structure.  I have been able to transfer the data, but it only collects one data point overriding the previous point.

 

Thanks for any assistance.

Download All
0 Kudos
Message 1 of 11
(1,775 Views)

@Jwells93 wrote:

Hello,

 

I am semi new to using LabVIEW and have been handed down a VI and am stumped on how to incorporate a few things.

I have an indicator within a case structure within an event structure that I want to relay back to a control that precedes the structures upon command, some sort of button.

I.e. Push button, value in control becomes that of the indicator.

 

Secondly I have tab that runs a system and collects max points within a loop.  I am attempting to collect that data in an array in a separate tab using an event structure.  I have been able to transfer the data, but it only collects one data point overriding the previous point.

 

Thanks for any assistance.


 

 Why is your program a State Machine jammed inside the time out case of an Event Driven State Machine?

 

This entire program should be rewritten as an Event Driven State Machine. Then it will be simple to add the indicator you want.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 11
(1,755 Views)

I do not know, it was built by a coworker and handed down to me when I came onboard.

 

I do not have the time or knowledge of LabVIEW to rewrite.

 

Is it possible to still add the indicators I am attempting.

 

Thanks

0 Kudos
Message 3 of 11
(1,748 Views)

I agree that this program is beyond help!

 

You have interactive loops inside event stuctures, inside case structures, inside another event structure, inside a loop. This needs to be tossed and started from scratch. Your coworker did really not do you any favors here.

 

(Also way too many unneeded local variables. The ms data in wrong representation (DBL instead of U32). etc. etc.)

 

Create a clean state machine. One outer loop. one case structure, max of 1 event structure. loop persistent data in shift registers. and so on.

 

altenbach_0-1654277775411.png

 

Message 4 of 11
(1,723 Views)

Thank you all,

I appreciate the replies,

Again I am still fairly new to labVIEW, so more of a course of clarification.

 

I am removing the outer Event structure, is that enough to free up what I am needing to add, or is there stuff that is going over my head.

 

Thanks again,

0 Kudos
Message 5 of 11
(1,711 Views)

@Jwells93 wrote:

I do not know, it was built by a coworker and handed down to me when I came onboard.

 

I do not have the time or knowledge of LabVIEW to rewrite.

 

Is it possible to still add the indicators I am attempting.

 

Thanks


Your coworker did not have the time or knowledge of LabVIEW to write the code in the first place. This code is total garbage. It's unclear exactly what you want to do - I guess that you could use another local variable. As bad as this program is what's another bad choice.

 

If this is code that you're going to have to be continuously responsible for my suggestion is to take the time to rewrite the program. Use a state machine or queued message handler (QMH - your coworker even referred to this in the comments). When done properly your code should easily fit on one computer screen. Stick with it enough and @altenbach can probably give you advice to get it to be the size of a postage stamp (OK, maybe not that small, but way smaller than it is now).

0 Kudos
Message 6 of 11
(1,709 Views)

Thank you,

 

I know I am being a tad repetitive,  I don't have the time to rewrite the code right now and have a deadline to add those fairly soon.  

Is there any way to add the two things I'd wanted to with what I have.

 

I do plan on taking this on myself to a rewrite, but I don't believe I can rewrite everything within my time strait and limited knowledge.

 

Thanks again

0 Kudos
Message 7 of 11
(1,701 Views)

@Jwells93 wrote:

Thank you,

 

I know I am being a tad repetitive,  I don't have the time to rewrite the code right now and have a deadline to add those fairly soon.  

Is there any way to add the two things I'd wanted to with what I have.

 

I do plan on taking this on myself to a rewrite, but I don't believe I can rewrite everything within my time strait and limited knowledge.

 

Thanks again


 

Well... In general, I would use a Shift Register to take a value output by one state and use it as in input in a later state.

 

Don't forget to wire the Shift Register through all of the cases.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 11
(1,697 Views)

Thank you,

 

I will go ahead and attempt that.

Is that suggested for both things I wanted to integrate or just the first configuration.

0 Kudos
Message 9 of 11
(1,685 Views)
Solution
Accepted by topic author Jwells93

@Jwells93 wrote:

Thank you,

 

I will go ahead and attempt that.

Is that suggested for both things I wanted to integrate or just the first configuration.


Just the first question... And my suggestion was very general, as I really don't have the energy to look at that code any further.

 

I know you are under the gun but sometimes we have to put our foot down and tell our managers no, like I had to do when I was told to add more features to this little beauty a predecessor left behind.

JustWrongCapture (1).PNG

========================
=== Engineer Ambiguously ===
========================
Message 10 of 11
(1,661 Views)