Hello Guest it is October 19, 2019, 04:03:15 AM

Author Topic: How do I make a DRO show an input value?  (Read 3824 times)

0 Members and 1 Guest are viewing this topic.

How do I make a DRO show an input value?
« on: September 28, 2011, 08:50:55 PM »
All,

I am a relatively new Mach3 user and I am beginning to customize it for my needs.  I set up an arduino with an open source modbus IO code to read a flow meter and send a value back to Mach3 to display the flow rate.  I created a user DRO to display the result and I got that working fine.  I also wanted to send back a control to set the speed of the pump.  I created another user DRO and used that value and a brain and send back through the modbus to set a PWM value.  I got the functionality that I wanted, but I can't get the user DRO to display the value I set.  When I click on the DRO, it lightens up some and allows me to set a value (it actually displays the value when I type in it), but when I hit enter, the DRO goes back to zero.  It actually transmits the right information through the brain to the arduino and sets the PWM to the right value, but the DRO always says zero.  I would like to set the value and have it say what it is after hitting enter.  What am I missing here?

Offline BR549

*
  •  6,902 6,902
    • View Profile
Re: How do I make a DRO show an input value?
« Reply #1 on: September 28, 2011, 09:02:32 PM »
Normally I would use a button to update the value to the CONTROL. What code are you using to control the "ENTER" function it sounds as thought it is rezeroing the value after the enter keystroke.

Just a thought, (;-) TP
Re: How do I make a DRO show an input value?
« Reply #2 on: September 28, 2011, 09:14:46 PM »
I'm not using any code other than the code that was generated by screendesigner.  In screen designer I set it to be User DRO 1001.  I have a brain set up with an input node that is a DRO set to OEM 1001.  That goes through a pass through lobe to a termination which is set to send the value to the modbus register.

So there isn't any code related to hitting enter.  Should there be?  ::)  :-\ :D

Basically, it behaves the same way that the DRO would behave if I just placed a new user DRO on one of the screens with nothing else behind it.  I can turn the brain off and it behaves the same way.

I want it to behave like the DRO's for the axis when it is not in machine co-ordinate mode.  I can manually set that DRO and the value stays there after hitting enter. 
« Last Edit: September 28, 2011, 09:17:50 PM by dirktheeng »

Offline BR549

*
  •  6,902 6,902
    • View Profile
Re: How do I make a DRO show an input value?
« Reply #3 on: September 28, 2011, 09:36:11 PM »
You may want to use Screen designer and double check that you do NOT have duplicate DROs trying to update each other all the time.
That would be the only reason I know for it to do what you describe.

Normally you would enter the number and press enter and the number stays. IF another process is also using the same dro it may be setting it BACK to that dro's value(ZERO).

Just a thought,(;-) TP
Re: How do I make a DRO show an input value?
« Reply #4 on: September 28, 2011, 10:03:20 PM »
I checked machscreen for any other OEM codes that shared 1001 and didn't find any.  Just to be sure I changed it to 1011 and it had the same behavior.  I cant help but think I have to code the value into some variable and then write it to the DRO, but I don't know how to do that.

Anyhody got any other suggestions?

Offline BR549

*
  •  6,902 6,902
    • View Profile
Re: How do I make a DRO show an input value?
« Reply #5 on: September 28, 2011, 10:46:02 PM »
IF you are formatting the number as an integer then THAT function is broken. AND that is HOW it reacts. You input the number and when you press enter the value is recorded BUT the dro display zeros itself.

Try it as a double that works like you need
Just tested here.  (;-) TP
Re: How do I make a DRO show an input value?
« Reply #6 on: September 28, 2011, 11:02:50 PM »
Great man!!!  ;D ;D ;D  That fixed it!  I would not have thought about that, but it works!