Development of PCI board driver in XPC environment

2 ビュー (過去 30 日間)
lai Tian
lai Tian 2018 年 4 月 16 日
回答済み: Xiaohu Li 2021 年 6 月 5 日
My purpose is to implement PCI1706's board driver in XPC environment.
According to an article on the Baidu library that introduced the PCI card driver (https://wenku.baidu.com/view/f625485dbe23482fb5da4c01.html), the driver can be realized by c-mex S-function.
Main steps: 1. write the c-mex S-function; 2. mex the c-mex S-function and get the mexw32 file; 3. invoke the mexw32 file according to S-function module in simulink environment.
XPC has provided rl32getpciinfo rl32einpb rl32outpb functions to get PCI board information, write/read registers.
But I found some problems when realizing the driver function.
That is, the codes realizing the driver or calling the xpc functions are wrapped by "#ifndef matlab_mex_file #end if", so it won't actually excute if the S-function is built by "mex". I used the "printf" in the codes wrapped by "ifndef matlab_mex_file" and it didn't output anything, which validates that the codes realizing the driver or calling the xpc functions didn't excute.
If I deleted the "ifndef matlab_mex_file", there will be errors.
So how to realize the PCI board driver in XPC environment?
The codes are as the attach file.

回答 (2 件)

maotong zhang
maotong zhang 2018 年 8 月 27 日
I also encountered the same problem,help me

Xiaohu Li
Xiaohu Li 2021 年 6 月 5 日
请问您解决了吗?如果可以的话,可以分享以下您的驱动文件吗?谢谢!
我的邮箱lixiaohu@cumt.edu.cn

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by