This content originally appeared on Level Up Coding - Medium and was authored by Lars Kiefer
In the age of Industry 4.0, access to data is more important than ever. Direct acquiring of data from a CNC machine is often cumbersome due to the used PLC and NC control technology and therefore requires in-depth knowledge in these areas. Existing interfaces from manufacturers usually have to be enabled separately and are very expensive. In this article, Focas and C++ programming are used to show how access to a CNC machine can be achieved.
In summary, the goals of the article are:
• Acquire CNC-data from Fanuc
• Running Focas on Raspberry Pi, as a cheap operating system
How to start?
In the following the individual steps are shown, which are necessary, in order to get access to the CNC machine.
1) Downloading library
The Focas interface is downloadable free of charge after registration: https://www.inventcom.net/support/fanuc/universal-driver
2) Linking of files
The following commands must be executed on the Raspberry Pi for successful linking and your libfwlib32.so.1.0.x should be copied to /usr/local/lib in advance.
sudo ldconfig
sudo ln –s /usr/local/lib/libfwlib32.so.1.0.x /usr/local/lib/libfwlib32.so
3) Setup c++ Code
After the basic installation is completed, you can now start programming. It is important to note that all Focas commands must be declared separately.
4) Loading of the library in C++
In the next step, the library dynamic is loaded and the previously declared commands are initialized.
5) Connecting to Fanuc
The following lines are used to establish the connection between Fanuc and Raspberry Pi.
6) Get axes data
From now on, all commands can be executed so that bytes can be read and written. In this example, the current axis positions are queried.
7) Close connection
After the request is finished, the connection should be closed again and the library loading will be reset.
Conclusion
Thanks for reading. If you have anything to add, please feel free to leave a comment!
This article focuses on the initial creation of access. Further developments offer the possibility of the integration of CMake and the linking to Python.
To summarize this article, with a little programming effort, one can get the possibility to write and read data on a CNC-machine using inexpensive hardware.
Notes: The setup also works under Linux and Windows. The steps of the setup vary slightly.
Data interface CNC machine with Raspberry Pi using Focas was originally published in Level Up Coding on Medium, where people are continuing the conversation by highlighting and responding to this story.
This content originally appeared on Level Up Coding - Medium and was authored by Lars Kiefer
Lars Kiefer | Sciencx (2022-02-22T13:09:14+00:00) Data interface CNC machine with Raspberry Pi using Focas. Retrieved from https://www.scien.cx/2022/02/22/data-interface-cnc-machine-with-raspberry-pi-using-focas/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.