Linux平台上的Focas fwlib32 CNC库 [英] Focas fwlib32 CNC library on Linux platform

查看:166
本文介绍了Linux平台上的Focas fwlib32 CNC库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试连接到 fanuc CNC 机器,我得到了 fwlib32 focas dll 及其在 windows 上的工作.我想在 linux 上运行 focas,我​​想在 linux 平台上运行同一个库.(参考通过Fanuc/Focas将PLC连接到Python)

I am trying to connect to fanuc CNC machine, I got fwlib32 focas dll and its working on windows. I want to run focas on linux , I want to run the same library on linux platform. (reference Connect PLC to Python via Fanuc/Focas)

推荐答案

一旦你让它在 windows 上运行,按照步骤让它在 linux 上运行.

Once you got it working with windows, follow the steps to make it work on linux.

从下载的 focas dll cd 提取文件夹(或在线存储库 ex:https://github.com/strangesast/fwlib 请验证许可证相关的东西),复制 fwlib32.h 文件和 arm (for raspberrypi) 版本的 libfw32lib.so.1.0.*,复制文件/home/pi

from downloaded focas dll cd extracted folder( or online repository ex:https://github.com/strangesast/fwlib please verify license related things), copy fwlib32.h file and arm (for raspberrypi) version of libfw32lib.so.1.0.*, copy the files /home/pi

sudo cp ~/libfwlib32.so.1.0.x /usr/local/lib/libfwlib32.so.1.0.0

sudo ldconfig

sudo ln -s /usr/local/lib/libfwlib32.so.1.0.0 /usr/local/lib/libfwlib32.so

现在查找 fwlib32.cs 的行查找所有文本实例

Now find lines of fwlib32.cs find all instances of text

fwlib32.dll"

"fwlib32.dll"

替换为

libfwlib32.so"

"libfwlib32.so"

在 fwlib32.cs 中,添加这些行

In fwlib32.cs , add these lines

[DllImport("libfwlib32.so", EntryPoint = "cnc_startupprocess")]
public static extern void cnc_startupprocess(long level, string filename);

[DllImport("libfwlib32.so", EntryPoint = "cnc_exitprocess")]
public static extern void cnc_exitprocess();

在调用任何其他 fwlib32.cs 库函数之前调用此函数

Call this function before calling any other fwlib32.cs library functions

long level = 3; string filename = "focas.log"; Focas1.cnc_startupprocess(level, filename);

调用之后,你可以使用下面的线连接,接下来你可以调用任何库函数

after that call, you can connect using below line, next you can call any library functions

short statusCode = Focas1.cnc_allclibhndl3(host, (ushort)port, timeout, out pHdl);
    

这篇关于Linux平台上的Focas fwlib32 CNC库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆