Hello Guest it is April 25, 2024, 10:58:04 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rrc1962

91
Mach4 General Discussion / Writing to machine.ini
« on: May 26, 2016, 11:48:00 PM »
I'm writing to the ini file for saving persistent DRO's and it works great.  I'm setting up some check boxes using toggle buttons and images and I'm trying to save the state of the button to the ini file on screen unload.  It doesn't work.  It should be saving the button state in the Preferences section, but it's not.  I inserted a message box and it is capturing the button state, just not writing it to the ini.  Code is below.  What am I doing wrong?

inst = mc.mcGetInstance()
val = scr.GetProperty('togCheck1', 'Button State')
mc.mcProfileWriteString(inst, "Preferences", "togCheck1", string.format (val))

92
Mach4 General Discussion / Re: How do I do this?
« on: May 26, 2016, 09:48:19 PM »
There's an industrial version? 

93
Mach4 General Discussion / Re: Random Fixture Offsets
« on: May 25, 2016, 06:17:28 PM »
OK...So I moved the script above from the left up event to the clicked event and it's once again working as it should.  It must have been calling another script somewhere in the system.

94
Mach4 General Discussion / Re: Random Fixture Offsets
« on: May 25, 2016, 06:07:37 PM »
I thought I had this figured out.  Today when I hit my "Zero All" button with all axes zero'd and homed, it actually moves the machine to X1 Y1.  Here's the code.  Hitting the individual zero buttons works as it should.

inst = mc.mcGetInstance()
rc = mc.mcAxisSetPos(inst, 0, 0)
rc = mc.mcAxisSetPos(inst, 1, 0)
rc = mc.mcAxisSetPos(inst, 2, 0)

95
Mach4 General Discussion / Re: Random Fixture Offsets
« on: May 24, 2016, 10:41:02 PM »
Motors are enabled and configured.  rc = mc.mcAxisSetPos(inst,0,0) zeros the X current position.  rc = mc.mcAxisSetMachinePos(inst,0,0) does nothing at all.  Here is the code.  The message box was just so I could see if the code was executing.

local inst = mc.mcGetInstance()
wx.wxMessageBox(tostring(inst))
rc = mc.mcAxisSetMachinePos(inst, 0, 0)
rc = mc.mcAxisSetMachinePos(inst, 1, 0)
rc = mc.mcAxisSetMachinePos(inst, 2, 0)
rc = mc.mcAxisSetMachinePos(inst, 3, 0)

96
Mach4 General Discussion / Re: Random Fixture Offsets
« on: May 24, 2016, 09:49:28 PM »
Errrr.  It helps to put the function parameters in the correct order.  Still would like to find a way to set machine zero to current position...or zero...with a button press.  mc.mcAxisSetMachinePos(inst,0,0) doesn't do it.

If I hit Reference All, it 0's out the machine coordinates without moving an axis. IE: references in place, but I don't have motors connected either.  Axes are enables so DRO's will move, but mo motors or motion controller connected.  Seems like there should be a function to set machine zero to current position.

97
Mach4 General Discussion / Random Fixture Offsets
« on: May 24, 2016, 09:08:24 PM »
So I set out to make a zero all button and came up with this code....

local inst = mc.mcGetInstance()
rc = mc.mcAxisSetPos(inst,0,0)
rc = mc.mcAxisSetPos(inst,0,1)
rc = mc.mcAxisSetPos(inst,0,2)
rc = mc.mcAxisSetPos(inst,0,3)

What happens is after I make sure that everything is zero and machine is referenced (IE: current pos and machine coord = 0), I run this code and it sets a work offset on X at -3.000 and does not affect Y, Z or A at all.  If I repeat without making sure machine coord is at zero, it will set random numbers as offsets for all axes. 

Anyone seen anything like this?  I don't ever use offsets.  When I run mc.mcAxisSetPos(inst,0,0) it should set current position on X to zero.  Why does it always set X current pos to 3.000 and also set a fixture offset on X to -3.000?  Strange part is that this seems to work on my M4 PC at work, which is licensed, but not here at home, which is in demo mode.

What I want to do is create a button to set current position on all axes to zero, then another button the set machine zero to the same point.

Thanks

98
General Mach Discussion / Re: How does spindle output work?
« on: May 24, 2016, 06:24:24 PM »
Basically, all I need is a PWM output from Mach3 into a DAC, like a spindle control board.  The PWM output would be scaled from 0 - 100 and as I change the spindle speed, the voltage should change.  0 = 0V and 100 = 10V.  Looks like to do this I would go to Config -> Spindle Pulleys and set up pulley 1 as min Speed = 0, max speed = 100.  Then go to Config -> Ports & Pins -> Motor Outputs and set the port and pin for spindle step.  I'm not using a direction control, so I left the dir pin and port at 0.  The Config -> Ports & Pins -> Spindle Setup and check "Use spindle motor output" and check "PWM Control".  Base Freq. is set to 5 and min PWM% is set to 0.

Now it's possible that the process that starts the PWM pulse train is not happening.  I thought DoSpinCW() and DoSpinCCW() start the PWM output and DoSpinStop() stops it.  When I execute DoSpinCW() from a macro, I read .5V from the spindle board regardless of the spindle speed setting.  The board is a CNC4PC C41.  I have 24V connected to where it says to connect 24V.  5V connected to power in.  The only other connection is the analog output.


99
General Mach Discussion / How does spindle output work?
« on: May 24, 2016, 05:16:42 PM »
I'm setting up the spindle output for something other than a spindle and just need a user variable PWM output to the spindle step pin.  

What triggers Mach3 to begin the PWM pulse train?  

Once the pulse train is started, would I change it using the S word or by entering a value in the spindle speed DRO?

Thanks

100
Mach4 General Discussion / Re: Persistent DRO's
« on: May 24, 2016, 02:36:06 PM »
Switched to using the PLC script and it's working great now.  Thanks