- Posts: 1947
- Thank you received: 338
CL logic to make LCNC buttons work like industrial machines
- bevins
- Offline
- Platinum Member
-
rodw wrote:
Mike_Eitel wrote:
Its funny, there has barely been a mention of CL for ages and all of a sudden a few people are discussing it.
I use at least a few rungs on every machine I do. There is always something easier to do in CL than HAL.
I once did a point to point Biesse with the zones, photocells pushbuttons and green lites's using CL.
- The Feral Engineer
- Offline
- Senior Member
-
- Posts: 79
- Thank you received: 23
nkp wrote: I10 - ?
I11 - ?
I13 - ?
==============================
When you first start the program, almost always an error:
can't do that (EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with the interpreter paused
Lcnc 2.7 Axis
PS
The scheme needs improvement
net mode:is:auto classicladder.0.in-14 halui.mode.is-auto
I don't get any error messages when I use it (2.8.1). I have made a few changes to it since I posted this, nothing crazy, just centralized the grouping of the physical and gamepad buttons I was using. Pressing cycle start should bring the machine to auto mode, not alarm. I did, however, add halui.mode.is-auto to I6 after posting my file here.
To answer your other question, I10, I11 and I12 (formerly i13) are for a different circuit. Those are assignments to two separate probe circuits, using separate inputs and an internal relay to switch between them.
Long story short, my machines have a hardwired tool setter mounted to the table and a spindle probe. Both setter and probe are NC, so when the spindle probe is disconnected from the machine, the signal is broken, so the probe is in a constant trigger state. I12 is a relay that flags mcodes using sets probe-relay true/false. I12 is tied to both a classicladder input signal as well as spindle inhibit, so when the spindle probe is active, the spindle cannot rotate.
see attached. I commented at the top of each rung section. I make little tutorial videos on basic CL and HAL for youtube, so sometimes my samples get attached to my CL files, but they don't usually get in the way.
- The Feral Engineer
- Offline
- Senior Member
-
- Posts: 79
- Thank you received: 23
nkp wrote: This works fine.
net auto classicladder.0.in-00 pyvcp.run
net feed-hold classicladder.0.in-01 pyvcp.feedhold
net program-idle classicladder.0.in-02 halui.program.is-idle
net single-block classicladder.0.in-03 pyvcp.step
net mode:is:auto classicladder.0.in-04 halui.mode.is-auto
net btn-stop classicladder.0.in-05 pyvcp.stop
net auto-mode-select classicladder.0.out-00 halui.mode.auto
net cycle-start classicladder.0.out-01 halui.program.run
net feed-resume classicladder.0.out-03 halui.program.resume
net single-block-select classicladder.0.out-04 halui.program.step
net program-stop classicladder.0.out-05 halui.program.stop
net feed-hold-select classicladder.0.out-02 halui.program.pause
Hope you find it useful. I've got it working on my machine with no issues after a few minor adjustments
- The Feral Engineer
- Offline
- Senior Member
-
- Posts: 79
- Thank you received: 23
Mike_Eitel wrote: Make's sence to me.
If you are coming from standart automation world, plc programing is the absolute best way to go. C can only be acceptet for specialities. I f.x. dislike C as IT does not prevent me from my typos in concern of theses dam... ; 's. ;-()
Mike
I'm not a C programmer, I work for a machine tool company, so PLC is right up my alley. I actually switched to LCNC because it had an available PLC section (one of many reasons). I never spent much time writing my own logic, but I've had to troubleshoot it in the past, so I had a vague understanding of it - getting into writing my own circuits made it so much clearer
I've found a bit of a useful mid-ground between HAL and CL. The two tie together almost poetically.
as a PS, I find that loadrt toggle is a little easier on the eyes than a set/reset circuit in CL and loadrt multiswitch would be an absolute pain to write as ladder logic. It's very subjective
- Mike_Eitel
- Offline
- Platinum Member
-
- Posts: 1051
- Thank you received: 183
I nearly hatte CL. There are so many easier ways in 61131 to write a Programm.
But you take what you get.. And once you get it running it's stable.
Mike
- The Feral Engineer
- Offline
- Senior Member
-
- Posts: 79
- Thank you received: 23
Mike_Eitel wrote: To be honest:
I nearly hatte CL. There are so many easier ways in 61131 to write a Programm.
But you take what you get.. And once you get it running it's stable.
Mike
I like it. It almost feels like home to me. I cracked open the ladder on a machine at one of my customers the other day and I felt like I was wrapped in a warm blanket of logic. Plus, it kinda reassured me that I was pointed in the right direction. I only started having a crack at it about a month ago, but I learned so much in a very short time due in part to the fact that I wasn't completely green, I had a few ripe splotches to get me going :lol:
I'm going to be undertaking a retrofit project with my old vocational high school on a Fadal VMC15. The students in the pre-engineering and advanced manufacturing technology are learning PLC logic, hydraulics, pneumatics, etc. in the class, so they're going to tackle the electrical end and the students in machine tool tech (where the machine is located) can assist by machining adapter plates for everything once it all gets off the ground. My role is to kinda guide them along, introduce them to LCNC and have them apply their knowledge of AB plc to CL. Gives them a little insight on the similarities and differences of what they learn vs. what they'll apply after graduation. Should be interesting.