调用一个dll文件,没有其他帮助文件,有
labview例程,但要求用c#来编写。
c#对应代码:
[DllImport(("
tio32.dll"), EntryPoint = "tio32_RunMnemo", CharSet = CharSet.Auto,CallingConvention = CallingConvention.StdCall)]
public static extern Int32 tio32_RunMnemo(Int32 addr, string cmd, Int32[] dataLen, Byte[] data, Byte[] Tx, Byte[] Rx, Int32[] resLen, Byte[] res,Int32[] ackLen, Byte[] ack);
调用部分:
Int32 addr = int.Parse(textBox34.Text, System.Globalization.NumberStyles.HexNumber);
string cmd = textBox35.Text;
Int32[] dataLen = new Int32[1];
Byte[] data = new Byte[256];
Byte[] Tx = new Byte[32];
Byte[] Rx = new Byte[32];
Int32[] resLen = new Int32[1];
Byte[] res = new Byte[32];
Int32[] ackLen = new Int32[1];
byte[] ack = new byte[32];
Int32 n = tio32_RunMnemo(addr, cmd, dataLen,data,Tx,Rx,resLen,res,ackLen,ack);
请高手帮帮忙,看看有什么问题?Labview刚接触不久,没什么经验。
vi附件:
tio32_RunMnemo.rar
(22.21 KB, 下载次数: 3)
一周热门 更多>