SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Moderators: TomKerekes, dynomotion

Post Reply
NOELNOG
Posts: 177
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Tue Feb 08, 2022 4:55 pm

Hi Tom

how can i execute multiple functions in the same line of code, i am trying to use this: SetBit(1135); to activate one output, but if i want to activate more than one output in a single line of code? it's that posible, instead of use a repetitive column?

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

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by TomKerekes » Tue Feb 08, 2022 6:41 pm

In general no you can't do this.

Why does it matter?
Regards,

Tom Kerekes
Dynomotion, Inc.

NOELNOG
Posts: 177
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Tue Feb 08, 2022 8:07 pm

ok, i just was wonder, it doesn't matter

thanks

NOELNOG
Posts: 177
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Tue Feb 15, 2022 3:40 pm

Hi Tom

I am trying to create a C program for conditions, example: if the program read low air pressure, the program should halt and show a box message indicating "LOW AIR PRESSURE" also keep the program halted or disabled if the air pressure sensor still active ,and let the program to continue or anabled when the air reached it's required pressure, it's there any sample c program that i can edit and use for this and other similar conditions?

thanks

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

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by TomKerekes » Tue Feb 15, 2022 4:57 pm

Hi NOELNOG,

You would need a forever loop to monitor the pressure. You might see the ExternalButtons.c Example for this.

To display a MessageBox see the MessageBox.c Example.

One approach might be to check if a Job is running by checking the JOB_ACTIVE flag. If running, issue a Halt to come to a controlled Stop. Wait until fully stopped by monitoring the Job_ACTIVE flag. Then to prevent any motion remove all axes from the Coordinated Motion System with:

DefineCoordSystem(-1, -1, -1, -1);

Then display the Message Box.

After the Operator responds to the Message Box check if the pressure is ok, if so, restore the Coordinate System. The operator would be then able to Cycle Start to resume.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

NOELNOG
Posts: 177
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Tue Feb 15, 2022 5:49 pm

where i can get in the JOB_ACTIVE flag?

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

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by TomKerekes » Tue Feb 15, 2022 5:52 pm

The JOB_ACTIVE flag is defined in KMotionDef.h with other functions, defines, and variables. You can just use it as in:

Code: Select all

if (JOB_ACTIVE)
{
    // Job is active
}
else
{
    // Job is inactive
}
Regards,

Tom Kerekes
Dynomotion, Inc.

NOELNOG
Posts: 177
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Wed Feb 16, 2022 4:31 pm

Hi Tom

I edited the external buttons c program to use Halt when Low air pressure, it works ok just i couldn't compile the message box that i want to display after perform the halt, i don´t know how to embed it in the program, there is a copy of the c program.
ExternalBttns.c
(3.21 KiB) Downloaded 81 times
thanks

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

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by TomKerekes » Wed Feb 16, 2022 4:48 pm

I don't understand what you are asking.

That's not a program there isn't any main function.

You can't identify the code that displays the message box?
Regards,

Tom Kerekes
Dynomotion, Inc.

NOELNOG
Posts: 177
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Wed Feb 16, 2022 5:33 pm

oh i'm sorry yes i copied the program and pasted in new file and miss the main function.
in the program where Handle Halt function is, i added some code to do Halt when the air low pressure is detected by the bit 1158, then after Halt waits two seconds to let the machine stop completely, then it desable the axis to prevent any motion, everything to this point is working ok, but i need a message pop up that show LOW AIR PRESSURE, that's what i can't make it work, you can see it below Handle Halt in the program, i know something is wrong in the way i am embeding that message code. i already add the main function :roll:
Attachments
ExternalBttns.c
(3.21 KiB) Downloaded 76 times

Post Reply