From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-28-2013 12:12 PM
I'm trying to create two buttons with values (-1, 1). These values have to do with my motor I'm trying to run. -1 means to move up and 1 means to move down. I've attached my VI. I'm refering to the Revolution loop in my VI. How could I make a two buttons that have the value of -1 and 1 that will replace the Num Rev control?
05-28-2013 12:29 PM
Radio buttons. Enumerated control. Ring Control. Slider. Data entry limits on any numeric control. Boolean plus a bit of math.
I am not sure exactly what you want but I think there are probably several ways to get it.
Your block diagram is way too large. It is recommended to keep the diagram to one screen. Yours is about 3x4 (large) screens. Sequence structures and local variables should also be avoided.
Lynn
05-28-2013 03:46 PM - edited 05-28-2013 03:49 PM
I'm trying to have two buttons with -1 and 1 values. I can't replace the Num Rev but have an additional two buttons. I try using a Enum, but it doesn't have negative values. How would I create two buttons with true being 1 and false being -1 and i could rename as Up and Down and also be wired together to replace the Num Rev? Doesn't have to be true or false, just need two buttons with two seperate values could be link together and replace my Num Rev.
05-28-2013 04:18 PM
@iinWill wrote:
I'm trying to have two buttons with -1 and 1 values. I can't replace the Num Rev but have an additional two buttons. I try using a Enum, but it doesn't have negative values.
Create a lookup array diagram constant and index into it using the enum.
05-28-2013 06:16 PM
@altenbach wrote:
@iinWill wrote:
I'm trying to have two buttons with -1 and 1 values. I can't replace the Num Rev but have an additional two buttons. I try using a Enum, but it doesn't have negative values.
Create a lookup array diagram constant and index into it using the enum.
Would you be able to help me out on this? I am not able to remove Num Rev, as it is used throughout my VI, but could I create two different buttons with numeric values that could act similar to the Num Rev? I am not sure how to setup an array to enum.
05-28-2013 06:33 PM
@iinWill wrote:
@altenbach wrote:
@iinWill wrote:
I'm trying to have two buttons with -1 and 1 values. I can't replace the Num Rev but have an additional two buttons. I try using a Enum, but it doesn't have negative values.
Create a lookup array diagram constant and index into it using the enum.
I agree with Altenbach, I just used a lookup array and a case structure. See attached.
05-28-2013 06:51 PM - edited 05-28-2013 06:55 PM
@LukeTEI wrote:
@iinWill wrote:
@altenbach wrote:
@iinWill wrote:
I'm trying to have two buttons with -1 and 1 values. I can't replace the Num Rev but have an additional two buttons. I try using a Enum, but it doesn't have negative values.
Create a lookup array diagram constant and index into it using the enum.
I agree with Altenbach, I just used a lookup array and a case structure. See attached.
Could you attach as 2010 labview instead of 2012? Can't open it.
05-28-2013 06:56 PM - edited 05-28-2013 06:57 PM
@LukeTEI wrote:
See attached.
That seems a bit convoluted. 😮
Here's one possible solution (since the buttons are latch action, only zero or one can be TRUE at any given time).
05-29-2013 08:11 AM
@altenbach wrote:
@LukeTEI wrote:
See attached.That seems a bit convoluted. 😮
- Your "select" constructs should be replaced by boolean to 0,1
- A 2D LUT is not scaleable. What if the next program requires five buttons, would you do a 5D array diagram constant?
- There should NOT be anything orange when dealing with integers (look at all the coercion dots!)
- Your VI uses 100% CPU of one core when no button is pressed.
Here's one possible solution (since the buttons are latch action, only zero or one can be TRUE at any given time).
I will agree, it was not the best solution and I should have used a wait constant at the very least. I'm also fairly new to Labview and its good to learn some new tricks.
05-29-2013 08:16 AM
Here is the picture of my block diagram so iinWill can see what altenbach was talking about. I did add the wait constant, although I'm not certain this fixes the processor issue.