Development of PCI board driver in XPC environment

1 view (last 30 days)
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.

Answers (2)

maotong zhang
maotong zhang on 27 Aug 2018
I also encountered the same problem,help me

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

Tags

Community Treasure Hunt

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

Start Hunting!