Hello Guest it is March 29, 2024, 02:17:34 AM

Author Topic: Using registers to control screen gauges  (Read 2016 times)

0 Members and 1 Guest are viewing this topic.

Using registers to control screen gauges
« on: September 25, 2017, 02:07:19 PM »
I am trying to make some changes to my Mach4 screen layout and one of the things I want to do is add a new gauge or meter to display my VFD load. I am getting the data from the VFD via Modbus and I am putting the value into a global persistent register. What I want to do now is have the register value be used to control the gauge. When I edit the gauge properties I only see an option to use a DRO code for controlling the meter. Is it possible to control it with a register? Is there any way to add new DRO Codes to the list so I could use that instead?

Thanks
Keith
Re: Using registers to control screen gauges
« Reply #1 on: September 25, 2017, 03:35:57 PM »
Hi,
could you not write a little code to read the register into a DRO and put the code in the PLC scipt?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Using registers to control screen gauges
« Reply #2 on: September 26, 2017, 08:07:46 AM »
That is actually what I did last night. I was just wondering if there was a more direct solution. In the end I added code to the PLC script that would read the MODBUS register and modify the "Value" field of the specific screen element. This has worked out very nicely and I now have complete control of my spindle via MODBUS
Re: Using registers to control screen gauges
« Reply #3 on: September 26, 2017, 08:44:28 AM »
Hi,
in what way is this not direct?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Using registers to control screen gauges
« Reply #4 on: September 26, 2017, 08:56:14 AM »
You're correct, it wasn't that hard once I figured out the code. I had just assumed that there was going to be a way to directly link the register to the display through the properties of the display. I wasn't complaining, I just wanted toi make sure I didn't overlook a simpler solution.

Thanks
Keith

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Using registers to control screen gauges
« Reply #5 on: September 26, 2017, 10:46:15 AM »
DROs can be linked to Registers......... its one of their properties. Not sure about gauges though. Doing it in the PLC script is a good way to get it done but I would check to see if the register changed values from last check and only update the screen element if it had. Otherwise it will be unnecessarily spamming the gui. The fractional DROs (which are actually labels) in the default router screen work like this from a check in the PLC script which runs a function in the screen load script if needed.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!