Hello Guest it is April 19, 2024, 06:50:56 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 - Cbyrdtopper

341
Hey Mcardoso,
I'll answer your questions best I can.
1)  If you download Mach4 there will be a folder in the main Mach4 Directory called Docs.  In here there are manuals, one of which is a LUA scripting manual and there is another API File that has all the Mach Specific Lua Calls.
2)  I don't know anything about ASCII except that it is for communications.  Mach4 has a modbus protocol, RS232 is one of the protocols.  You can utilize the information received over modbus inside LUA functions and scripts. 
3)  The PLC Script is the script that continuously runs in the background, you can change the scan time inside Mach4.  You have other functions that will run from the screen load script only when they are called from another source.  Example, a button press can call a function.  Some functions can lock up, or take over, Mach's GUI so you can make coroutines that will run the functions and keep everything else rolling as well.  There is a video about coroutines on YouTube from another Mach4 user, DaztheGas, go check it out; highly informational.
3.  There are TONS of examples that have been shared and Mach4 comes with several examples from Automatic Tool Change routines, to turning on and off outputs, to advanced file functions. 
This forum is a great place to learn and share your experiences with Mach4.

342
Mach4 General Discussion / Re: SmoothStepper Motor Steps Per Unit
« on: January 15, 2019, 11:41:20 AM »
The status message, "Axis 3 commanded while disabled" is because in the "Go To Work Zero" button, A axis is commanded to go to 0.00 as well as X, Y, and Z. 
There are a couple of ways you can fix this.
1.  Go into the screen editor and edit the goto work zero function in the screen load script to not include the A axis move.
2.  Simply enable motor 3 in mach config.  If you don't have using motor 3 this won't have any adverse effects, it will just be enabled.

I am using the ESS on a mill with Mach4 and I do get a little bit of funny noise while jogging, it messes with my spindle slightly and extremely briefly.  I haven't messed with the ESS Config in a while, but is there a way to reduce noise on it?  Maybe it is getting a false keyboard press? 

343
Mach4 General Discussion / Re: Keep track of OB axis
« on: January 14, 2019, 04:08:51 PM »
Doing the calculations in thr PLC would be easy enough and quick.   I litterally just tensioned the belts on the spindle.   Going to get it going tomorrow and then hopefully start moving the tool carousel.   Going to spend a little time getting the grasp of the OB axis again.

344
Mach4 General Discussion / Re: Keep track of OB axis
« on: January 14, 2019, 03:24:28 PM »
I set up an OB Axis a while back to do some testing (which I am about to implement on a mill).  You can set a DRO to read the OB Axis position. 
I don't know if you can set it to roll over; once I get this the spindle mounted on this mill and get the wires nestled into place then I am going to start messing with the Tool Carousel motor again. I plan on making it an OB axis to prestage my tools.  Having the ability to roll over with it will be nice. 

345
Mach4 General Discussion / Re: Mach4 and Galill DMC 4133 on lathe
« on: January 13, 2019, 09:58:40 AM »
Archie,
Retrofitting a machine means sometimes getting extremely intimate with a machine. Haha.   I know that only too well.   But it depends on the motors and drives amd their compatibility with the motion controller you choose, whether you replace them or not.

346
Mach4 General Discussion / Re: Mach4 and Galill DMC 4133 on lathe
« on: January 12, 2019, 10:36:58 AM »
I'm using the Click PLC on 4 machines and rhe BRX PLC on one machine.   Both PLCs are from automation direct.   The Click is less expensive and is still very powerful.   Now that you cam search on the forum, you can search for "Click PLC" and get a few hits on this forum.   

I learned a few basics from YouTube.  Just searching for PLC ladder logic.   But mostly by just opening the software and digging in.

347
Mach4 General Discussion / Re: LUA, repeat until
« on: January 11, 2019, 05:41:41 PM »
Here is the code I'm using on a lathe at work.
This bit of code is the mc.mcSignalWait. 
I have it waiting 20 seconds, that's about 4 times as long as it takes to change a tool.  If it doesn't finish in that time, I want to shut the motor off on the tool changer so it doesn't burn up.  So, if rc does not equal 0 (which is no error) then message, error, stop my functions.   

--Wait for the signal from the CLick.         
         mc.mcCntlSetLastError(inst, "Wait for Click to complete tool change.")
         rc = mc.mcSignalWait(inst, mc.ISIG_INPUT0, mc.WAIT_MODE_HIGH, 20)--Time in seconds the Click has to complete the tool change.
         --Error check.  If the Click took too long.  Alarm out Mach4.
         if (rc~= 0) then
             wx.wxMessageBox("The Click did not complete the tool change in time.  Check for malfunction.")
             local Alarm = mc.mcSignalGetHandle(inst,mc.OSIG_ALARM)
             mc.mcSignalSetState(Alarm,1)
             mc.mcSignalSetState(TurretMotor, 0)
             CycleStop()
         else
             mc.mcCntlSetLastError(inst, "Current tool == " .. tostring(Requested))
             mc.mcToolSetCurrent(inst, Requested)
             mc.mcCntlSetLastError(inst, "Tool Change Complete.")
         end


NOTE:  This is just the middle of the code, I have more code above that gets the instance, sets output handles, etc... and more at the end to complete the tool change.

348
Mach4 General Discussion / Re: LUA, repeat until
« on: January 11, 2019, 05:31:31 PM »
You can use this:  mc.mcSignalWait

Look it up in the API.  I use this for a few things at the shop, a few of which are tool changers.

rc = mc.mcSignalWait(inst, mc.ISIG_INPUT1, 1, 0)

the call will look for the specified signal to go High or Low.  The "1" that is after the ISIG_INPUT1 means this line is waiting for the signal to go High, a "0" will mean that the call will wait for the signal to go low.

The "0" on the end is the timeout.  You can set how long you want it to wait before moving on in the script.  0 makes it wait indefinitely.
if you want to make sure it gets finished in a certain amount of time, then you can use the rc, one of them is for the timeout.  If it doesn't finish in the alotted time you specify then you can finish the script:
if rc == MERROR_TIMED_OUT then turn off your ac motor, error message, end macro.

349
Mach4 General Discussion / Re: Mach4 and Galill DMC 4133 on lathe
« on: January 11, 2019, 09:14:16 AM »
Pretty nice looking lathe. 
Hopefully you will be able to use the existing motors and drives. 
The first PLC I used, we programmed a Tool Change Routine for a Hurco VMC; so it won't be too bad. 
Luckily, on your lathe, you have a nice control panel that already has the handwheels and buttons on it, we had to make ours.

350
Mach4 General Discussion / Re: Mach4 and Galill DMC 4133 on lathe
« on: January 10, 2019, 11:15:58 PM »
One lathe has Servos and Drives from Automation Direct, one lathe has GSK Servos and Drives, and another is just running steppers.  All with the HiCON Integra.
We have an SL3 that me and my brother want to get the closed loop feature added on to just to see what kind of difference it makes, but we have really had great success with all 3 lathes without the closed loop feature.

Most of our I/O is being controlled through a PLC.  Much more stable signal and if I have any random ideas for the machine, I can run them through the PLC and not have to worry about Mach taking care of trivial things, like the lube pump or chip conveyor.