Hello Guest it is November 14, 2019, 11:10:41 AM

Author Topic: How to show spindel RPM?  (Read 345 times)

0 Members and 1 Guest are viewing this topic.

How to show spindel RPM?
« on: April 10, 2019, 08:09:17 AM »
Hi,

Mach 4 is controlling the spindle RPM correctly.

But the display (the one above the Spindle speed override) always show 0 RPM.
How to get the display there show the currently set RPM?

Any way to show how much the override really result in to?
Currently this is a slider without showing a number what it is actual set to.


Im using Mach4, ESS and 0-10V output from BOB to Inverter.
« Last Edit: April 10, 2019, 08:12:19 AM by ravencnc3 »
Re: How to shop spindel RPM?
« Reply #1 on: April 10, 2019, 08:17:09 AM »
The DRO above the slider shows "True RPM" which is the actual RPM when you have some sort of Spindle Feedback set up in Mach4.  You can go into the screen editor and change the DRO Code to "Spindle RPM" instead of "Spindle True RPM", this will display the current commanded spindle RPM.

On the slider, do you want it to show a %.  When you click up on the slider or move it, you want to see a percentage of override?
Chad Byrd
Re: How to show spindel RPM?
« Reply #2 on: April 10, 2019, 08:55:31 AM »
Okay,
Here is some code to display Spindle Speed Override Percentage.  I tried to get it to modify the Screed DRO but for some reason wasn't having any luck on my end, I'm not sure why since I have used the scr.SetProperty code before with DROs; maybe someone else can jump on here and tell me what's up.  Either way, I got it to work.

--Place this code in the PLC script
--SSO Percentage Display
local inst = mc.mcGetInstance()
local SSO = mc.mcSpindleGetOverride(inst)
local SSOPercentage = (SSO * 100)
mc.mcCntlSetPoundVar(inst, 500, SSOPercentage)
--scr.SetProperty('droSSOPercent', 'Value', tostring(SSOPercentage));

So, the DRO you place in the Screen needs to be set up correctly.
In this example, I have it looking at #VARS 500.
In the DRO Properties, set the "System VAR"to 500
You can name the DRO:  droSSOPercent     if you want to see if the last commented out section works, but like I said, it didn't work on my end.
But this will display the percentage of the slider.
Chad Byrd
Re: How to show spindel RPM?
« Reply #3 on: April 10, 2019, 10:02:12 AM »
Hi,

Great support thank you.
Exactly what i was looking for.

Will try it asap.
Re: How to show spindel RPM?
« Reply #4 on: April 10, 2019, 11:10:40 AM »
Chad-

I believe there is a DRO Code built into Mach for spindle speed override.

I've had issues setting DRO values with scr.SetProperty in the past. Ended up using using mc API calls for most of them.

-jacob
Re: How to show spindel RPM?
« Reply #5 on: April 10, 2019, 01:37:22 PM »
Thank you for this hint jacob, yes I found a build in DRO. It is even possible to enter a custom number there.
Re: How to show spindel RPM?
« Reply #6 on: April 10, 2019, 01:50:46 PM »
Very cool.   I didn't k ow that was a built in DRO code.   👍
Chad Byrd
Re: How to show spindel RPM?
« Reply #7 on: April 11, 2019, 06:51:33 AM »
In the wx4 screen set this is already done in the field in the upper left of the Spindle ection in the lower left corner of the screen. If you want to display the commanded RPM, set the DRO Code to Spindle RPM.

(edited by moderator to remove unrelated link)
« Last Edit: April 11, 2019, 08:27:22 AM by bryannab »