DROLabel not updating

Moderators: TomKerekes, dynomotion

Post Reply
BaxEDM
Posts: 11
Joined: Mon Aug 27, 2018 10:15 am

DROLabel not updating

Post by BaxEDM » Wed Aug 29, 2018 9:05 pm

Hi,
I've made an uber simple c program to write something to a DROLabel:

#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"

main()
{
DROLabel(1000, 162, "test");
}

When I run the "Add" example screen I see that the result of the addition turns to the string "test" so my program is ok.

Now, when I add the same DROLabel to my own screen, with the same var 162 and run my simple program, the DRO does not update to "test". I've tried a whole bunch of things, but cannot get it to work. I also tried copying the line of the screen widget that holds the addition result in Add.scr to my own *.scr file to make sure the readout widget settings are the same. I then see the readout in my own screen, but it always gives "??".


Not sure what to try else.

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: DROLabel not updating

Post by TomKerekes » Wed Aug 29, 2018 9:59 pm

Hi BaxEDM,

You might check if there are multiple controls using Var 162. Otherwise post the screen file so we can check it.
Regards,

Tom Kerekes
Dynomotion, Inc.

BaxEDM
Posts: 11
Joined: Mon Aug 27, 2018 10:15 am

Re: DROLabel not updating

Post by BaxEDM » Thu Aug 30, 2018 7:29 pm

Thanks! Did a ctrl+f for "162" in my *.scr file anf found a duplicate. After removing that one it worked.

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: DROLabel not updating

Post by TomKerekes » Thu Aug 30, 2018 7:48 pm

Great. Thanks for posting back.
Regards,

Tom Kerekes
Dynomotion, Inc.

User avatar
cnc_freak
Posts: 55
Joined: Fri Apr 20, 2018 5:36 am

Re: DROLabel not updating

Post by cnc_freak » Fri Feb 01, 2019 9:02 pm

I have a similar issue.
I'm using two screens.One screen is called Main and the other Parameter. When in Parameter screen, via a button i run a c program, which among other things, writes to a DRO variable var:170 a message. I'm using the same DRO variable var:170 in the other screen ,the MAIN, and when i switch to this screen the DRO is cleared.Even when i switch back to the Parameter screen the DRO is also cleared. Why is the DRO label not preserved when i'm switching from the one screen to the other?
Attached are the two screens and a program updating the DRO value.
So my question is. How can i make the DRO holding its value, when i'm switching from the one screen to the other and only updating when i press the button, which is running the c program which is updating the DRO value?
Attachments
Param_2035.c
(1.34 KiB) Downloaded 138 times
2AxisPlasmaOxy_PARAM_1024x768.scr
(47.96 KiB) Downloaded 137 times
2AxisPlasmaOxy_MAIN_1024x768.scr
(47.8 KiB) Downloaded 127 times

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: DROLabel not updating

Post by TomKerekes » Sun Feb 03, 2019 8:11 pm

Hi cnc_freak,

The assumption is that the DROLabels are set to the default text whenever a New Screen is loaded. Someone might not want old text to be displayed. Normally DROLabels are periodically updated anyways.

Here is a Patched KMotionCNC for Test Version 4.35b that allows the text of a DROLabel to be preserved if the Screen Script Text for the DROLabel is set as $KEEP$. Copy to the \KMotion\Release folder.

Note the exact same DROLabel control must be used in all screens. It seems in your posted files you used IDC_But13 on one screen and IDC_But21 in the other.

Please let us know if this works for you.
Regards,

Tom Kerekes
Dynomotion, Inc.

User avatar
cnc_freak
Posts: 55
Joined: Fri Apr 20, 2018 5:36 am

Re: DROLabel not updating

Post by cnc_freak » Mon Feb 04, 2019 9:05 am

Sorry but now it does not update at all.
Please check the new files.
Attachments
Plasma.c
(2.82 KiB) Downloaded 138 times
2AxisPlasmaOxy_PARAM_1024x768.scr
(47.95 KiB) Downloaded 129 times
2AxisPlasmaOxy_MAIN_1024x768.scr
(47.77 KiB) Downloaded 131 times

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: DROLabel not updating

Post by TomKerekes » Mon Feb 04, 2019 7:30 pm

Hi cnc_freak,

You have two DROLabels with the same Var=168. One hidden and one shown. On the Main Screen IDC_But21 and IDC_But28. On the Params Screen IDC_But13 and IDC_But28.

Here is a new Screen Editor with a build in Search/Find function to help with these mistakes. Copy to the \KMotion\Release folder.

The Find function will search all controls if the "Show Hidden" option is selected. It searches for partial matches of ID, Text, Fonts, Scripts, Bitmap Files or exact matches of Vars. See below:

Find.png

Also the Text hasn't been set to $KEEP$

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

User avatar
cnc_freak
Posts: 55
Joined: Fri Apr 20, 2018 5:36 am

Re: DROLabel not updating

Post by cnc_freak » Mon Feb 04, 2019 7:41 pm

Yes this is how i wanted it.
Thanks and sorry for my mistakes.
Regards.

Post Reply