System::Call 'F:\Ds40xxSDK::InitDSPs() i().r0' ;初始化芯片,函数: int __stdcall InitDSPs() System::Call 'F:\Ds40xxSDK::GetBoardCount() i().r1' ;获取板卡信息,函数:int __stdcall GetBoardDetail(UINT boardNum,DS_BOARD_DETAIL *pBoardDetail) StrCpy $2 1 ;传入通道号 System::Call 'F:\Ds40xxSDK::ChannelOpen(i r2) i.r3' ;打开通道,函数:HANDLE __stdcall ChannelOpen(int ChannelNum) ${NSD_CreateLabel} 0 0 100% 12u '通道数$0,板卡数$1,通道句柄$3' ;输出到自定义界面的label上 Pop $Label System::Alloc 1024 ;分配内存 Pop $R1 ;地址 System::Call "*$R1(i,i,i,i,i,i,i,i,i,i,i,i,i)" ;创建结构体 Dumpstate::debug ;debug工具,查看变量及栈数据 StrCpy $5 0 System::Call 'F:\Ds40xxSDK::GetBoardDetail(i r5,i $R1) i .r6' ;获取板卡信息,函数:int __stdcall GetBoardDetail(UINT boardNum,DS_BOARD_DETAIL *pBoardDetail) ,传入板卡号($5)及结构体地址($R1),返回的信息保存到结构体中 messagebox MB_OK $6 ;函数返回值,判断是否成功 ;返回结构体:typedef struct{BOARD_TYPE_DS type;板卡型号BYTE sn[16];序列号........} System::Call "*$R1(i,&i1 .r0,&i1 .r1,&i1 .r2,&i1 .r3,&i1 .r4,&i1 .r5,&i1 .r6,&i1 .r7,&i1 .r8,&i1 .r9)" ;把数组中的序列号,按1字节(&i1)取出 StrCpy $R0 "$0$1$2$3$4$5$6$7$8$9" System::Call "*$R1(i .r2,&i1,&i1,&i1,&i1,&i1,&i1,&i1,&i1,&i1,&i1,&i1 .r0,&i1 .r1)" StrCpy $R0 "$R0$0$1" ;序列号1组12位,只是取最前面12位 Dumpstate::debug ${NSD_CreateText} 0 13u 100% 12u "板卡类型$2 序列号为 $R0" ;输出到Text控件上 Pop $Text
NSIS插件System.dll官方介绍地址:http://nsis.sourceforge.net/Docs/System/System.html