Sign in to follow this  
Followers 0
BITS N BYTES

NB Designer Macro

3 posts in this topic

Well I am really stumped on this one. There is a simple macro program that multiplies LW0 by 10 and places the result in LW2. A number input object changes the value of LW0. The number input property for "Triggering Action" is checked and the macro specified. When a new value is entered on the keypad and the enter key is pressed the macro does NOT appear to trigger the macro. Opening the keypad a second time WITHOUT re-entering a new value and exiting the keypad again with the ENTER or red x in top corner now appears to trigger the macro and the values are correct. Just can't figure out how to make this work. ANY IDEAS!!

Share this post


Link to post
Share on other sites
The problem is that the macro is executed when you press the Number Input component, not when a new value is entered. Thus, the macro ends long before the keypad is displayed. One solution would be to run a cyclic macro when given screen is displayed (let's say every 1 second or so), though that would slow down the HMI a little bit (depending on the macro complexity). The other solution would be to design a custom keypad so that every time you press Enter key the macro would be executed. That would require a custom keypad for every numeric input so I don't think that's a reasonable solution in case of multiple inputs. Edited by Eradicated

Share this post


Link to post
Share on other sites
Thanks Eradicated. Yeah that's what I figured. As you point out I had already tried assigning the trigger and macro to the Enter Key of the keypad and that works fine. But as you say having and individual keypad for every macro is not the best solution. Documentation on the NB-Macros is a bit sketchy. If there is any code in the macro instruction set that can monitor the state of the Keypad entry key then this might be used as the trigger for the Numeric Input macro. Any ideas??

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0