Mastering Fanuc Focas: Programming Techniques for CNC Machines – Part 2 (Mode and Status)
This is the second video in the Fanuc Focas Tutorial series. In this episode, we learn about what a Fanuc Focas handle is, and how we use it in the context of the Fanuc Focas API. Using the Focas API, we obtain a handle from the Fanuc controller and use it to ask the Fanuc for information regarding the mode and status of the controller.
If you have any questions or comments please leave a comment below or contact me. I will be more than happy to help however I can.
We also have a Forum where people can post their questions. Help us build a Fanuc Focas community where we can share our knowledge with others.
If you are looking for someone to build your Focas app for you, be sure to fill out the Contact Form. Here at Hier Thinking we offer many services including software development for your new Focas application, training for your employees to get up to speed on the Focas API, and even CNC security consulting, to make sure you keep your most important assets out of the hands of malicious hackers.
Email: matthew@hierthinking.com
Focas Resources:
Fanuc Documentation: https://www.inventcom.net/fanuc-focas-library
GitHub: https://github.com/versex799/FanucFocasTutorial
Fwlib32.cs: https://github.com/versex799/FanucFocasTutorial/blob/master/FanucFocasTutorial/fwlib32.cs
Also Check out:
Fanuc Focas Pt. 3 (PMC Signals): https://hierthinking.com/2023/03/17/fanuc-focas-tutorial-part-3/
Fanuc Focas Pt 1 (Introduction): https://hierthinking.com/2022/07/14/fanuc-focas-tutorial-part-1/
6 thoughts on “Mastering Fanuc Focas: Programming Techniques for CNC Machines – Part 2 (Mode and Status)”
Leave a Reply
You must be logged in to post a comment.
[…] We have a newer up to date video version of this tutorial here! […]
Hello,
Can you share sample code for Fanuc Focas connectivity with Python Code.
Hi Praveen,
We talked about this already, but I wanted to post here as well just in case anyone else comes across this and has the same question. Unfortunately, Fanuc does not provide Python hooks for their API. In order to use the API, you will either need to use C/C++/C#.Net/VB.net. You could potentially find someone to convert the dll calls to python for you, or you could do it yourself, but I do not know of anyone who has already done this.
I found a small and very incomplete Python library on GitHub that reverse-engineers the wire protocol instead of wrapping the Fanuc C libraries as the C# bindings do. (I’m impressed with the C# wrapper. That’s no small amount of editing to get the linkage directives in there and adapt the C/C++ syntax to C#. Kudos.)
I know there are automated tools to wrap C/C++ APIs in Python, although it’s likely one would need to clean the result up to be properly Pythonic. I’m just learning Python but I’ve done this kind of thing with other languages and have looked at the source for some Python wrappers so maybe I’ll tackle this someday. Check out Adafruit’s GitHub for some good examples where they wrap their C/C++ drivers for their own hardware.
[…] Fanuc Focas Pt 2 (Mode/Status): https://hierthinking.com/2022/08/02/fanuc-focas-tutorial-part-2/ […]
I wanted read temperature and current of the 0i-F controller. I have tried reading CNC_SDTREAD1SHOT, cnc_loadtorq and cnc_rdcurrent it was giving some assembly reference issues, CNC_ADCNV was a function to read directly analog values for current but i am reading some negative values and there is a unknown parameter No.2086 mentioned in the https://www.inventcom.net/fanuc-focas-library/misc/cnc_adcnv. It would be a great addition.