[問題] 如何將MATLAB的struct轉換到C?

看板MATLAB作者 (裝蒜頭)時間9年前 (2015/01/06 02:09), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
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://www.ptt.cc/bbs/MATLAB/M.1420481395.A.E0E.html
文章代碼(AID): #1KgjDpuE (MATLAB)