作者joker0381 (装蒜头)
看板MATLAB
标题[问题] 如何将MATLAB的struct转换到C?
时间Tue Jan 6 02:09:50 2015
As title
小弟目前是个机械所的硕班生,
目标要写出一个跟控制器(FANUC FOCAS)连接的程式,
打算呼叫FANUC附的dll档和h档进入MATLAB执行,
在struct部分遇到了问题:
http://imgur.com/0AHINWX
目前要使用的function为pmc_rdpmcrng
在最右边的输入值有一个voidPtr
根据说明书,那里应该是一个结构,说明如下:
https://www.dropbox.com/s/p6xncst5ep30qdy/pmc_rdpmcrng.xml?dl=0
---------------------------------------------------------------
buf [ out ]
Pointer to the IODBPMC structure.
The IODBPMC structure is as follows.
typedef struct iodbpmc {
short type_a ; /* Kind of PMC address */
short type_d ; /* Type of the PMC data */
short datano_s ; /* Start PMC address number */
short datano_e ; /* End PMC address number */
union {
char cdata[N] ;/* The PMC data(byte type) */
short idata[N] ;/* (word type) */
long ldata[N] ;/* (long type) */
} u ; /* N is the number of read data */
} IODBPMC ;
---------------------------------------------------------------
请问各位大大有何解?
--
Sent from my
CASIO fx-991ES PLUS
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 182.235.149.227
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/MATLAB/M.1420481395.A.E0E.html