LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ring constant numeric output

Solved!
Go to solution

Hey guys I have a pretty simple question. How can I extract the numeric value assigned to a ring constant into something like a numeric indicator?

 

0 Kudos
Message 1 of 10
(4,809 Views)

Just wire it to a numeric indicator.

 

They are the same data type, so it will wire up just fine.

0 Kudos
Message 2 of 10
(4,802 Views)

That's what I thought but when I'm running the program it always show 0 on the indicator.

0 Kudos
Message 3 of 10
(4,762 Views)

Well if it's a ring constant the output will always be the same until you change it. Try changing the item in the ring. If you are having problems with that, attach your code so we can take a look at what you are doing.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 10
(4,757 Views)

@Caleb963 wrote:

That's what I thought but when I'm running the program it always show 0 on the indicator.


That's not the behavior I see.

 

Post your VI so we can see how you are doing things.

0 Kudos
Message 5 of 10
(4,755 Views)

The program itself is quite messy with lots of Sub-VIs but the one of interest is "MFC controller main."

Not sure why but when the ring constant is used on an independent VI it operates flawlessly but causes issue in this one.

0 Kudos
Message 6 of 10
(4,731 Views)

I think you are only reading the ring control and writing to the indicator only ONCE in you program. Try changing the ring constant to something else BEFORE you hit the run button and see if the indicator changes to the other value.

0 Kudos
Message 7 of 10
(4,725 Views)

@Jacobson-ni wrote:

Well if it's a ring constant the output will always be the same until you change it. Try changing the item in the ring. If you are having problems with that, attach your code so we can take a look at what you are doing.


Is that why they call it a "constant"?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 10
(4,717 Views)
Solution
Accepted by topic author Caleb963

@Caleb963 wrote:

The program itself is quite messy with lots of Sub-VIs but the one of interest is "MFC controller main."

Not sure why but when the ring constant is used on an independent VI it operates flawlessly but causes issue in this one.


When I strip out all the extra code, or at least a large amount of it, it works for me.  Why it doesn't with the other code in I can't say.  It could be tied to several architecture problems with your code.  You have several while loops where the stop condition is controlled by a boolean wire entering through a tunnel.  That means that loop will either run one time if the value happens to be True.  Or will run forever if that value happens to be false.

 

Also, the while loops are greedy meaning there is no wait function in them to keep them from burning up your CPU.

 

Numerous feedback nodes that really don't look correct, and will never actually execute because the while loops feeding them data are likely to run forever.  But even if they did get data from the while loops, they would never execute more than once because they are on the top level of the main block diagram.  They aren't in a while loop that would allow them to execute again.

 

I see subVI's that have event structures, while loops, and stop buttons that can never be pressed because the front panels aren't ever opened.  How do you press a stop button to stop a while loop if you can't press the stop button?  The event cases are set to lock front panel until completed, but the event structures are likely to be a freeze point in your code because there is no way for the event to ever be fired.

 

Probably numerous other issues.

I suggest reading:

Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2016 Help

 

and also

LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

 

I'm sorry, but this code is an absolute mess and needs to be thrown out and re-coded with a much cleaner architecture.  The ring constant value being shown as a numeric is the least of your problems.

Message 9 of 10
(4,710 Views)

Very well, I'll read more into it and will see what I can do. 

0 Kudos
Message 10 of 10
(4,646 Views)