LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing a boolean inside an array of clusters ("boolean inside cluster" variation, closest to my problem from 10 years ago post)

On a post from 10 year ago, someone ask how to change "boolean inside cluster".

I want to do something similar, but instead of the boolean part, change the numeric part of the cluster.

 

I used a shift register on a while loop, but the reset of variables is unstable. The countdown either continues where it was (not desired), it resets if I un-check the stop inside the while loop and run it like that twice, or goes bananas (if I stop with the stop button inside the while loop, and then set to run again by cycling such button to ON state again to run the loop until next change).

 

Attached the modified vi

 

Thank you

 

Gaston

0 Kudos
Message 1 of 8
(2,346 Views)

Question in this topic. If you want to make a change in the number instead of the boolean?

Let say that each full cycle, I want to decrease by 1 the number in the numeric portion of the cluster (like making a count down).

 

Help?

 

This is what I made (attached). 

Why I trying to do something like this?

 

I need to make a recursive measurement, where when reach zero (from initial state) in many different positions of a muxed sequence (elements on the array), means that I do not want to make a measurement anymore. BUT cannot stop whole sequence, but to remove channels (will use a case sequence). And while some channels (or elements on my array) still running, make a addition of a new element, while being interlaced in the measurement.

 

As soon as I have the skeleton, I post here.

 

 

0 Kudos
Message 2 of 8
(2,344 Views)

Rather than posting in a 10 year old thread, you would be better served if you created a new message thread.

 

Without knowing exactly what you are trying to do, and not wanting to dig into all these old messages to try to figure out which one your question is based off of, I answer this way.

 

If you have one element of a cluster you want to change, then you use unbundle by name followed by a bundle by name to modify that one element of the cluster.

This is probably covered in one of those free LabVIEW tutorials under Training Resources at the top of the LabVIEW forum.

0 Kudos
Message 3 of 8
(2,336 Views)

This is my last version before going to sleep.

This is my current vi. It is unstable, depending on the moment it is stop, it could continue the countdown from before or start again, or make a mix of them. 

 

How you reset all variables, so there is no content going from one run to the next one?

 

Thank you.

 

Gaston

0 Kudos
Message 4 of 8
(2,331 Views)

I really don't understand what you are trying to do here.

 

It is strange how you delaying your changes in the numeric of a cluster inside one element of an array by one or two iterations through the use of several layers of shift registers.

 

"This is my current vi. It is unstable, depending on the moment it is stop, it could continue the countdown from before or start again, or make a mix of them."

 

One thing I see is that you have an uninitialized shift register on your blue integer value.  So if you stop your VI, and start it again, it will be based on the value in that shift register from your last run.  Is that what you are referring to?

 

Note it is awkward to run your VI.  You are forced to turn the On/Off boolean LED to true before you run it.  And LED's generally mean an indicator, graphically they don't represent something a user would control.  You should use a button with Latch Upon Release action to stop your loop.

 

Try running your code with highlight execution turned on.  Watch the flow of data through it.  That should give you clues at to why it works the say it does.  Particularly pay attention to the values in the shift register.  Simplify this thing if you need to.  You were originally talking about going from changing a boolean to changing a numeric in a cluster.  But now you've put that cluster into a 5 element array which complicates things more in terms of trying to understand how dataflow works in LabVIEW.

0 Kudos
Message 5 of 8
(2,283 Views)

@RavensFan wrote:

Rather than posting in a 10 year old thread, you would be better served if you created a new message thread.

 

Without knowing exactly what you are trying to do, and not wanting to dig into all these old messages to try to figure out which one your question is based off of, I answer this way.

 

If you have one element of a cluster you want to change, then you use unbundle by name followed by a bundle by name to modify that one element of the cluster.

This is probably covered in one of those free LabVIEW tutorials under Training Resources at the top of the LabVIEW forum.


You don't really need to unbundle it, I don't think.  Just bundle the new value into the cluster - that is, unless your goal is to modify the value in the cluster and not replace it.

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 6 of 8
(2,258 Views)

@billko wrote:

@RavensFan wrote:

Rather than posting in a 10 year old thread, you would be better served if you created a new message thread.

 

Without knowing exactly what you are trying to do, and not wanting to dig into all these old messages to try to figure out which one your question is based off of, I answer this way.

 

If you have one element of a cluster you want to change, then you use unbundle by name followed by a bundle by name to modify that one element of the cluster.

This is probably covered in one of those free LabVIEW tutorials under Training Resources at the top of the LabVIEW forum.


You don't really need to unbundle it, I don't think.  Just bundle the new value into the cluster - that is, unless your goal is to modify the value in the cluster and not replace it.


He was talking about decrementing the value in the cluster.  So he needs to unbundle it first to determine what it is, and the bundle it back in once that value is decremented.

Message 7 of 8
(2,251 Views)

@RavensFan wrote:

@billko wrote:

@RavensFan wrote:

Rather than posting in a 10 year old thread, you would be better served if you created a new message thread.

 

Without knowing exactly what you are trying to do, and not wanting to dig into all these old messages to try to figure out which one your question is based off of, I answer this way.

 

If you have one element of a cluster you want to change, then you use unbundle by name followed by a bundle by name to modify that one element of the cluster.

This is probably covered in one of those free LabVIEW tutorials under Training Resources at the top of the LabVIEW forum.


You don't really need to unbundle it, I don't think.  Just bundle the new value into the cluster - that is, unless your goal is to modify the value in the cluster and not replace it.


He was talking about decrementing the value in the cluster.  So he needs to unbundle it first to determine what it is, and the bundle it back in once that value is decremented.


I didn't read it correctly then.  Thanks!

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 8
(2,240 Views)