Forum
Input data
Quote from Micheal Iacono on September 29, 2021, 3:40 amHi Matthew, thank you for your blog post about Focas connection.
I have a question, there is a method i can use in focas to send data to the CNC? something like command to stop, or change the program or something else?
I read the documentation on inventcom.net but i've found nothing
Thank you
Micheal
Hi Matthew, thank you for your blog post about Focas connection.
I have a question, there is a method i can use in focas to send data to the CNC? something like command to stop, or change the program or something else?
I read the documentation on inventcom.net but i've found nothing
Thank you
Micheal
Quote from Versex on September 30, 2021, 2:12 pmHi Micheal,
Sorry, it took me a while to get back to you. I have been rather busy lately.
When it comes to commands being sent to the CNC, these are going to vary depending on the model of CNC you have and the specific logic in the CNC controller. So take for instance a command to start the CNC. There is a Focas call cnc_start() and it takes a Focas handle as the only argument. This will start the program running so long as the CNC is in Auto mode. Otherwise, the call will fail. Note that for some reason this call is not in the inventcom.net documentation.
cnc_reset() will cause a reset to occur on the CNC and in essence it will stop the running job.
Now, a lot of stuff will require you to scour the Fanuc manual and locate specific G and F addresses. For instance, reading Feed Rate and Spindle Speed Overrides will require you to use pmc_rdpmcrng() with the appropriate arguments specifying the type of address (G, F, X, Y, etc...) as well as the number of the address and some other information.
Other stuff will require that you have things implemented in the Ladder. So for instance, if you want to mimic a button press which uses either the X or Y address (I forget which without looking it up) you will not be able to do so with additional logic being added to the ladder. The reason for this is that Fanuc does not allow you to command X or Y addresses through software by default. So a workaround is to link the X/Y address to a relay and just trigger the relay in the software and let the ladder take care of the X/Y address.
I hope this was helpful. If you have questions about any specific calls you want to make, let me know and I will try my best to help you out.
Hi Micheal,
Sorry, it took me a while to get back to you. I have been rather busy lately.
When it comes to commands being sent to the CNC, these are going to vary depending on the model of CNC you have and the specific logic in the CNC controller. So take for instance a command to start the CNC. There is a Focas call cnc_start() and it takes a Focas handle as the only argument. This will start the program running so long as the CNC is in Auto mode. Otherwise, the call will fail. Note that for some reason this call is not in the inventcom.net documentation.
cnc_reset() will cause a reset to occur on the CNC and in essence it will stop the running job.
Now, a lot of stuff will require you to scour the Fanuc manual and locate specific G and F addresses. For instance, reading Feed Rate and Spindle Speed Overrides will require you to use pmc_rdpmcrng() with the appropriate arguments specifying the type of address (G, F, X, Y, etc...) as well as the number of the address and some other information.
Other stuff will require that you have things implemented in the Ladder. So for instance, if you want to mimic a button press which uses either the X or Y address (I forget which without looking it up) you will not be able to do so with additional logic being added to the ladder. The reason for this is that Fanuc does not allow you to command X or Y addresses through software by default. So a workaround is to link the X/Y address to a relay and just trigger the relay in the software and let the ladder take care of the X/Y address.
I hope this was helpful. If you have questions about any specific calls you want to make, let me know and I will try my best to help you out.
Quote from Micheal Iacono on October 4, 2021, 9:01 amThank you Matthew, cnc_start and cnc_reset should work.
I'm also looking for the possibility to load a program from a path in the cnc memory, i founded this method cnc_upstart do you think it could do this?
Thank you Matthew, cnc_start and cnc_reset should work.
I'm also looking for the possibility to load a program from a path in the cnc memory, i founded this method cnc_upstart do you think it could do this?