LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting between two numbers

Hello guys and I appreciate your comments on my previous post.

I have a pretty simple question.

 

I have some user prompts for a stepper motor control with arduino. In this case the user will either tick type 1 or type 2 checkbox and then he will enter the speed that he wants the stepper motor to go. As I am still an amateur that's the only way that I think the speed from the user prompts can be moved inside the loop. 

In each case only one number will exist so the number has to go to the stepper write function.

Can you advice of a better way to do the same thing? I believe there must be a better, more efficient one.

 

Thanks in advance

0 Kudos
Message 1 of 6
(3,132 Views)

@tsakitsan wrote:

Hello guys and I appreciate your comments on my previous post.

I have a pretty simple question.

 

I have some user prompts for a stepper motor control with arduino. In this case the user will either tick type 1 or type 2 checkbox and then he will enter the speed that he wants the stepper motor to go. As I am still an amateur that's the only way that I think the speed from the user prompts can be moved inside the loop. 

In each case only one number will exist so the number has to go to the stepper write function.

Can you advice of a better way to do the same thing? I believe there must be a better, more efficient one.

 

Thanks in advance


This kind of question from someone who is trying to SELL their developed software?  I think it's time to show some code so we can at least help you to avoid bankruptcy trying to settle a lawsuit.

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 2 of 6
(3,128 Views)

To pick between two values, only one checkbox is needed. (Two check boxes give you four possibilities: FF, FT, TF, TT). Alternatively, you could use a radiobutton control.

 

We cannot show you a "better" way unless you show us your code. Verbal descriptions are too ambiguous.

0 Kudos
Message 3 of 6
(3,109 Views)

Thanks for helping me guys. I will get better at it.

Message 4 of 6
(3,060 Views)

@tsakitsan wrote:

Thanks for helping me guys. I will get better at it.


THAT's the spirit!  Don't forget to visit the training links on the main forum page.  But don't forget that this forum is an important part of learning, either!  🙂

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 5 of 6
(3,035 Views)

There are a few things in your code that don't make sense or won't work properly. First, there's nothing preventing the user from checking zero or two boxes in the first dialog. A Two Button Dialog would be better suited for this. Second, why have two separate dialog boxes asking for Speed, when one will do regardless of the system being "Type 1" or "Type 2"? If you need different prompts, instead of executing both dialog box Express VIs (albeit with one disabled, hopefully, if the user only checked one box), how about putting the dialog box VIs in a case structure instead, so only one of them executes and you only have one "Speed" output to handle? Third, if a dialog box is disabled, the Speed output won't be NaN, it'll be the default value of zero, so your "Not A Number/Path/Refnum" tests will always be false (unless the user enters "NaN", that is). If they did output NaN then your case structures would have the effect of changing them back to zero anyway. Fourth, adding the two Speed values together while assuming that one will always be zero is not straightforward; if you want to select between two values using a boolean, try the "Select" function instead.

0 Kudos
Message 6 of 6
(3,007 Views)