SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT
Moderators: TomKerekes, dynomotion
Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT
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?
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?
- TomKerekes
- Posts: 2741
- Joined: Mon Dec 04, 2017 1:49 am
Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT
In general no you can't do this.
Why does it matter?
Why does it matter?
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT
ok, i just was wonder, it doesn't matter
thanks
thanks
Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT
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
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
- TomKerekes
- Posts: 2741
- Joined: Mon Dec 04, 2017 1:49 am
Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT
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
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.
Tom Kerekes
Dynomotion, Inc.
Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT
where i can get in the JOB_ACTIVE flag?
- TomKerekes
- Posts: 2741
- Joined: Mon Dec 04, 2017 1:49 am
Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT
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.
Tom Kerekes
Dynomotion, Inc.
Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT
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. thanks
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. thanks
- TomKerekes
- Posts: 2741
- Joined: Mon Dec 04, 2017 1:49 am
Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT
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?
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.
Tom Kerekes
Dynomotion, Inc.
Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT
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
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

- Attachments
-
- ExternalBttns.c
- (3.21 KiB) Downloaded 76 times