LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview floating point and decimal differentiation

Solved!
Go to solution
Solution
Accepted by topic author tan99323

Hi tan,

 


@tan99323 wrote:

Keydown event : Can I know why I only can input single number from numpad?


Because you have it programmed this way!

What's wrong here?

Why do you need to convert the "Char" to U32?

Why do you check for "equal to ´0´"? Isn't it allowed to input a zero somewhere in the numeric input?

When the char is <> "0" then you use the char - but you don't use the previously typed chars (as should be available by the "User input" shift register)!

When the char is =="0" then you even get rid of older "User input" and still use the "Operation" input instead. Didn't I mention this problem before???

 


@tan99323 wrote:

how to have more input ? like 13


Don't forget to use the previous user input…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 21 of 35
(551 Views)

And how to let the backspace button work ? because when i press backspace it appear as a square symbol instead of delete the entry.

 

0 Kudos
Message 22 of 35
(525 Views)

Hi tan,

 


@tan99323 wrote:

And how to let the backspace button work ?


How should the backspace key behave?

When you answer that question then you also should know how to handle that key!

 


@tan99323 wrote:

because when i press backspace it appear as a square symbol instead of delete the entry.


Any other key will also produce an unwanted result with your current implementation!

What about filtering the user input to only use allowed keys?

 

Again: the VI works as programmed (by you)!

When you want some other/different behaviour then you need to define the required behaviour and to change the code of your VI accordingly: this process is called "programming"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 23 of 35
(516 Views)

How to set for true case for delete key press so only last data entry ill be deleted ? For example, previous data is 1234 and I want to delete the number 4 after press delete.

0 Kudos
Message 24 of 35
(502 Views)

Hi tan,

 


@tan99323 wrote:

How to set for true case for delete key press so only last data entry ill be deleted ? For example, previous data is 1234 and I want to delete the number 4 after press delete.


So you want to delete the last char in a string of several chars?

Which function of the string palette might be used for this?

What about StringLength and StringSubset? Or what about ReverseString, StringSubset, ReverseString?

What have you tried and where are you stuck?

 

Most part of "programming" involves thinking about (or developing) algorithms - before starting to code…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 25 of 35
(497 Views)

I have figured out with reverse string . How about let the vi perform add function as i press + in keyboard. Should I add new event case of just perform it in the same keypress event ? Or any possibility that I just bind the + in keypress direct to the Add boolean button ?

0 Kudos
Message 26 of 35
(486 Views)

Hi tan,

 


@tan99323 wrote:

How about let the vi perform add function as i press + in keyboard. Should I add new event case of just perform it in the same keypress event ?


This depends on your design decision. You made a decision, did you?

As said before: "programming" contains a lot of "planning what to do" - before starting to code…

 


@tan99323 wrote:

Or any possibility that I just bind the + in keypress direct to the Add boolean button ?


Did you try to set a "key navigation" for that "Add" button? Which keys are allowed here?

Does that fit your requirements?

 

After all those messages you should maybe start from scratch.

Learn about state machines and/or producer/consumer schemes (like QMH). Right now you have a producer (your event structure handling all user input) and you need a consumer, which does some actions based on that user input.

As said before: plan/develop your algorithm before starting to code!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 27 of 35
(483 Views)

I mean to link the + - * /  from the keyboard to their respective arithmetic boolean button. So is there any way to link those keyboard entry directly to the boolean button ? Means it choose Add operator as I press + from keyboard. I have declare all those arithmetic function in other event.

0 Kudos
Message 28 of 35
(431 Views)

Hi tan,

 


@tan99323 wrote:

I mean to link the + - * /  from the keyboard to their respective arithmetic boolean button. So is there any way to link those keyboard entry directly to the boolean button ? Means it choose Add operator as I press + from keyboard. I have declare all those arithmetic function in other event.


Have you tried what I wrote in my last message? Then you should know by now!

 

Handling the +-*/ keys is the same as with 0123456789 keys: you already have that Keypress event case, so all you need to do is to implement some more key handling…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 29 of 35
(428 Views)

I have tried the key navigation but the +-/* from keyboard is not listed at there. 

0 Kudos
Message 30 of 35
(425 Views)