Hi all,
Once I load my job with skinning.job.Load(), I'd like to execute the Cycle Start command programmatically. I've looked in the API docs (and a few forms) but cannot find how to do that. I apologize for my lack of knowledge with this API.
Thank you.
Cycle Start programmatically
Moderator: cnckeith
-
- Posts: 4
- Joined: Sun Nov 19, 2023 3:20 am
- Acorn CNC Controller: No
- Plasma CNC Controller: No
- AcornSix CNC Controller: Yes
- Allin1DC CNC Controller: No
- Hickory CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: 0008DC111213-0815230137
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Cycle Start programmatically
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 43
- Joined: Thu Feb 10, 2022 5:55 pm
- Acorn CNC Controller: No
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: Cycle Start programmatically
I think there are two ways to accomplish a cycle start programmatically through the API.
After you load the job, you can use plc.SetSkinEventState(50, 1), Thread.Sleep() for about 30-50 ms, and then plc.SetSkinEventState(50, 0).
50 is the skin event number for cycle start, setting the value to a 1 and then to a 0 simulates a button press. The 30-50 ms wait is important as the plc needs some time to see that the start button has been pressed. If you "press" the button too quickly, the plc will miss it.
Another way you can go about this, if loading the job is not a requirement, is to use job.RunCommand and use a G65 with your job file. job.RunCommand("G65 C:\\cncm\\ncfiles\\your_job.cnc", "C:\\cncm", false); will start the job immediately, assuming you are on the main screen.
I am obligated to tell you that automatic motion can be very dangerous and if the machine is going to move, the operator should be the one to have commanded it.
After you load the job, you can use plc.SetSkinEventState(50, 1), Thread.Sleep() for about 30-50 ms, and then plc.SetSkinEventState(50, 0).
50 is the skin event number for cycle start, setting the value to a 1 and then to a 0 simulates a button press. The 30-50 ms wait is important as the plc needs some time to see that the start button has been pressed. If you "press" the button too quickly, the plc will miss it.
Another way you can go about this, if loading the job is not a requirement, is to use job.RunCommand and use a G65 with your job file. job.RunCommand("G65 C:\\cncm\\ncfiles\\your_job.cnc", "C:\\cncm", false); will start the job immediately, assuming you are on the main screen.
I am obligated to tell you that automatic motion can be very dangerous and if the machine is going to move, the operator should be the one to have commanded it.
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 4
- Joined: Sun Nov 19, 2023 3:20 am
- Acorn CNC Controller: No
- Plasma CNC Controller: No
- AcornSix CNC Controller: Yes
- Allin1DC CNC Controller: No
- Hickory CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: 0008DC111213-0815230137
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: Cycle Start programmatically
This is great - thank you very much. The user will have full control of the machine via another app that I am developing on top of the centroid API.
Thanks again.
Thanks again.
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Site Admin
- Posts: 8881
- Joined: Wed Mar 03, 2010 4:23 pm
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: Yes
- Oak CNC controller: Yes
- CNC Control System Serial Number: none
- DC3IOB: Yes
- CNC11: Yes
- CPU10 or CPU7: Yes
- Contact:
Re: Cycle Start programmatically
can you share with us your app and its application? would be very interesting to see.
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
(Note: Liking will "up vote" a post in the search results helping others find good information faster)