External Button Set-Up

Moderators: TomKerekes, dynomotion

Post Reply
cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

External Button Set-Up

Post by cemoa9 » Mon Aug 30, 2021 2:53 pm

Hello Tom,

Another simple lovely topic which I couldn't solve by myself :/

I have external buttons connected and physically working (checked in Kmotion IO) and I try to make them operate the machine, I followed the instructions here (archive/attachments/Adding%20External%20Buttons.pdf) as much as I could but without success.

Compiler does not give any error but when clicking init the DRO gets yellow and stay yellow.

Please help !

Cordially

Francois
Attachments
Init.c
(10.35 KiB) Downloaded 62 times

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: External Button Set-Up

Post by TomKerekes » Mon Aug 30, 2021 4:00 pm

Hi Francois,

You should be able to debug things like this yourself. My guess would be ESTOP is being triggered. Add printfs to determine what is happening.
Regards,

Tom Kerekes
Dynomotion, Inc.

cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

Re: External Button Set-Up

Post by cemoa9 » Tue Aug 31, 2021 7:42 am

Morning Tom,

Crap you were right for both...

Image

Modified the code, now works properly, thank you Tom !

Ibzan
Posts: 16
Joined: Thu Sep 22, 2022 9:03 pm

Re: External Button Set-Up

Post by Ibzan » Sun Aug 06, 2023 4:31 am

Hello Tom.
I am trying to add an E-stop (emergency) button, as indicated in this document.
Do I assign it to the M code (Stop) as shown in the figure below. Is that correct?

Another question, when I press the Estop button, it executes the C code and disables the axes, if for some reason the communication between the PC and Kflop were to be lost, this method would not work.
Is there a way to make the E-stop button work in Hardware?
Thank you very much, regards.
Attachments
imagen_2023-08-05_221744864.png
imagen_2023-08-05_221744864.png (8.12 KiB) Viewed 381 times
imagen_2023-08-05_221138493.png

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: External Button Set-Up

Post by TomKerekes » Sun Aug 06, 2023 5:37 pm

Hi Ibzan,
Do I assign it to the M code (Stop) as shown in the figure below. Is that correct?
No. Add it at he end of your Init C Program.
Is there a way to make the E-stop button work in Hardware?
Yes. Add C Code to do whatever you want EStop to do. ie disable axes or turn off contactor relay.
Regards,

Tom Kerekes
Dynomotion, Inc.

Ibzan
Posts: 16
Joined: Thu Sep 22, 2022 9:03 pm

Re: External Button Set-Up

Post by Ibzan » Mon Aug 07, 2023 8:23 pm

TomKerekes wrote:
Sun Aug 06, 2023 5:37 pm
Hi Tom,
It already loads the code to my INIT program. I hope this is the correct way
If I understood correctly, would I have to add code in c to activate or deactivate relays in this part of the code?
Attachments
imagen_2023-08-07_142146701.png
imagen_2023-08-07_141354335.png
imagen_2023-08-07_141354335.png (11.01 KiB) Viewed 356 times
MotomanSK16.c
(10.33 KiB) Downloaded 13 times

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: External Button Set-Up

Post by TomKerekes » Mon Aug 07, 2023 9:14 pm

Yes within the 'if' condition.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply