Trying to learn PLC

All things related to Centroid Oak, Allin1DC, MPU11 and Legacy products

Moderator: cnckeith

Post Reply
TD-4242
Posts: 23
Joined: Sun Apr 12, 2020 11:03 am
Acorn CNC Controller: No
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: KI04039
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Contact:

Trying to learn PLC

Post by TD-4242 »

Trying to learn some PLC code to control my tool changer and wanted to try to do an InfoMsg of what tool it thinks it selected but the message is never written to the console like I would expect. To attempt to log based on a button press that also turns on the tool carousel motor and is supposed to log out "Tool Carousel manual unlock"

Code: Select all

IF ZToolCarouselRelease_I && ToolCarouselLockReleased_I && ToolCarouselManualOverride_I THEN
  SET ToolCarouselMotor_O,
  InfoMsg_W = MANUAL_CAR_OVERRIDE_C
the constant is set to:

Code: Select all

MANUAL_CAR_OVERRIDE_C           IS 43778;(2+256*171)
and 171 in the plcmsg.txt

Code: Select all

171 5171 Tool Carousel manual unlock
When I press the button the ToolCarouselMotor_O starts spinning but the message is never logged. It looks like the ShowInfoStage should display that message for me. Am I missing something in how InfoMsg_W is supposed to work?



Attached is hte plc code, very early stages and just trying to get the logic right.
Attachments
Centroid-Standard-Mill-ALLIN1DC-r7.src
(135.26 KiB) Downloaded 4 times
TD-4242
Posts: 23
Joined: Sun Apr 12, 2020 11:03 am
Acorn CNC Controller: No
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: KI04039
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Contact:

Re: Trying to learn PLC

Post by TD-4242 »

Every freaking time. Give up and post a question then figure it out right after.

Looking through the ctrl-alt-i I noticed that ShowInfoStage was never enabled. I added a SET ShowInfoStage and now the messages show up.
cncsnw
Posts: 3763
Joined: Wed Mar 24, 2010 5:48 pm

Re: Trying to learn PLC

Post by cncsnw »

That should not be necessary. Note that MessageStage is activated in InitialStage; and that MessageStage will activate ShowInfoStage if there is an informational message to be displayed, and it is not superseded by a fault message or error message.

With your previous version, when the message was not appearing, was there some unresolved message in FaultMsg_W (W51) or ErrorMsg_W (W52), preventing the informational message from being displayed?
TD-4242
Posts: 23
Joined: Sun Apr 12, 2020 11:03 am
Acorn CNC Controller: No
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: KI04039
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Contact:

Re: Trying to learn PLC

Post by TD-4242 »

I don't think so. I'll remove the SET ShowInfoStage and check thos word values.
TD-4242
Posts: 23
Joined: Sun Apr 12, 2020 11:03 am
Acorn CNC Controller: No
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: KI04039
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Contact:

Re: Trying to learn PLC

Post by TD-4242 »

On a side not I have gotten the logic in place now that identifies the tool locations as they go by. This old Acroloc has a very different style of tool changer along with it's own propritary tool holders. I'll be working on the pneumatic carousol lock this weekend and replacing a microswitch in it and I should be able to finish off the TC logic. Then I'll just need to learn how to tie it to M6 tool change commands.
TD-4242
Posts: 23
Joined: Sun Apr 12, 2020 11:03 am
Acorn CNC Controller: No
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: KI04039
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Contact:

Re: Trying to learn PLC

Post by TD-4242 »

So I've got everything working. Able to select the 12 tools using AUX1-12 like so:

Code: Select all

IF DoAux1Key_SV THEN ChangeToTool_W = 1, SET ATCStage, SET AUX1LED_O
One for each Aux key.

What I'm a little confused on is how I tie it to an M command. I haven't found great documentation on it yet so if its there please point me in the right direction. I have found:

Code: Select all

M6_SV                            IS SV_M94_M95_8 ;Tool change request
and I think the SV_TOOL_NUMBER system var is supposed to be set,

Code: Select all

IF M6_SV THEN ChangeToTool_W = SV_TOOL_NUMBER, SET ATCStage
but if I run an M6T5 in MDI it asks me to change the tool manually. So I'm not 100% on how I get from the M command to the PLC stage.

* I am licensed for ATC
** mostly asking because Murphy's Law states I'll figure it out 10 minutes after I hit submit
Attachments
Centroid-Standard-Mill-ALLIN1DC-r7.src
current PLC src file My ATC logic is around 2780
(139.62 KiB) Downloaded 3 times
TD-4242
Posts: 23
Joined: Sun Apr 12, 2020 11:03 am
Acorn CNC Controller: No
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: KI04039
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Contact:

Re: Trying to learn PLC

Post by TD-4242 »

Murphy's law strikes again. Found the macro portion of the documentation. Going to put that off then for now and get the Axis al moving.
Post Reply