找回密码
 注册
LabVIEW+单片机学习套件全套教程资料下载[免费]LabVIEW论坛精华列表贴USB0816数据采集卡《LabVIEW宝典》
LabWindows/CVI论坛精华贴NET0816以太网数据采集卡RC0210远程设备授权系统 关闭关停锁定打开设备 户外分布式数据采集
NET1624低速高精度以太网数据采集卡WIFI0824SD无线WIFI网络数据采集卡脱机运行 SD存储 小尺寸微型 串口采集远程采集 安卓 手持移动采集 纪录仪
查看: 536|回复: 1

如何得到一个簇的首地址?

[复制链接]
wlxinxiang 该用户已被删除
发表于 2009-7-14 14:21:07 | 显示全部楼层 |阅读模式
本帖最后由 wlxinxiang 于 2009-7-14 14:23 编辑

调用dll中遇到一个问题,函数体为:
long ScanInput_Start(long nCardID, PSCANINPUTREQUEST lpScanInputRequest, char *lpDataFileName);
dll中的第二个参数PSCANINPUTREQUEST 为struct :
typedef struct tagSCANINPUTREQUEST {
PSCANINPUTLIST pScanList;
USHORT wScanListCount; // Cannot be bigger than 512
AD_TRIGGER_MODE TriggerMode;
ULONG dwSampleRate; // Number of 0.1us. e.g. 50 means 5us, 100 means 10us
ULONG dwScanRepeatCycle; // Number of cycles of the scan. 0 means infinite
DATA_PROC_MODE DataDeliveryMode;
}SCANINPUTREQUEST, *PSCANINPUTREQUEST;
其中第一个参数为struct指针 :
typedef struct tagSCANINPUTLIST {
INPUT_SOURCE InputSource; // Indicates where the data is input from
ULONG dwChannelNum; // Channel number
AD_GAIN ADGain; // Gain for the specific A/D input channel
POLAR_TYPE PolarType; // Polar type for the specific A/D channel
}SCANINPUTLIST, *PSCANINPUTLIST;


我在labview 中用簇来代替struct,遇到一个问题,就是在获得簇的地址时不知如何搞定?若只获得内容无问题。

附:
vc调用过程:
ScanList[0].InputSource = Source_AD;
ScanList[0].dwChannelNum = 0;
ScanList[0].ADGain = Gain_2;
ScanList[0].PolarType = BiPolar;
//注意这里调用的是ScanList的地址
ScanRequest.pScanList = &ScanList[0];
ScanRequest.wScanListCount = 3;
ScanRequest.pDataFileName = &szDataFile[0];
ScanRequest.DataProcessingMode = Write_To_File_Only;
ScanRequest.dwScanRepeatCycle = 100;
ScanRequest.dwSampleRate = 20000; // 1 second
// m_aryCardIDs(0) is returned from ScanDevice function
nRet = ScanInput_Start(m_aryCardIDs(0), &ScanRequest, &szDataFile[0]);

vb调用:
ScanList(0).InputSource = Source_AD
ScanList(0).wChannelNum = 0
ScanList(0).ADGain = Gain_2
ScanList(0).PolarType = BiPolar
'下面这个函数VarPtr获得的也是个地址
ScanRequest.pScanList = VarPtr(ScanList(0))
ScanRequest.wScanListCount = 3
ScanRequest.sFileName = "c:\Temp\tmp1\ScanData.txt"
ScanRequest.DataProcessingMode = Write_To_File_Only
ScanRequest.dwScanRepeatCycle = 100
ScanRequest.dwSampleRate = 20000 ‘‘ 1 second
‘‘ m_aryCardIDs(0) is returned from ScanDevice function
nRet = ScanInput_Start(m_aryCardIDs(0), VarPtr(ScanRequest))



还有一个小问题·:地址和句柄一样不?
wlxinxiang 该用户已被删除
 楼主| 发表于 2009-7-14 20:06:14 | 显示全部楼层
回复 顶

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cpubbs论坛. ( 粤ICP备09171248号 )

GMT+8, 2026-9-29 12:26 , Processed in 0.027162 second(s), 8 queries , Gzip On, File On.

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表