请帮忙看一下这个DLL调用的函数,参数怎么写
pisn_getsnapshots
This function retrieves the most recent values sent to the pi System for an array of points. The snapshot values in engineering units, status codes, times, dates, and errors are returned in the passed parallel arrays. If the point type is not real, the value is returned in istat and the rval argument is returned as 0.
C format
int32 pisn_getsnapshots(
int32 PIPTR * pt
float PIPTR * rval,
int32 PIPTR * istat,
int32 PIPTR * timedate,
int32 PIPTR * error,
int32 count );
Returns
>0
System error
0
Success
-1
Point not found
Arguments
pt (passed)
Array of point numbers
rval (returned)
Array of values in engineering units, undefined for integer and digital points
istat (returned)
Array of statuses for type real points and values for integer and digital points
timedate (returned)
array of time stamps
error (returned)
Array of error codes
count(passed)
Size of the arrays
pi Toolkit Reference
GetSnapshot
以下是VB的定义
Declare Function pisn_getsnapshots Lib "piapi32.dll" (pt&, rval!, istat&, timedate&, piapierror&, ByVal count&) As Long
我是这样定义的
function pisn_getsnapshots(pt:array of Integer;rval:array of single;istat:array of Integer; timedate:array of Integer; error:array of Integer; count: Integer):Integer;stdcall;external 'piapi32.dll';
调用的时候
var
pt:array[0..20] of Integer;
rval:array[0..20] of single;
istat:array[0..20] of Integer;
timedatePt:array[0..20] of Integer;
errorPt:array[0..20] of Integer;
countPt: Integer
i:=getsnapshots(pt[0],rval[0],istat[0],timedatePt[0],errorPt[0],countPt);
i的值为0表示调用成功,但是rval[0]。。rval[20],的值都不正常,我把上面的句函数调用注释掉,rval[0]..ravl[20]的值仍不变,证明rval的数值在函数中没有被赋值,请高手帮忙看一下,是不是我的定义有问题,还是调用方法有问题
This function retrieves the most recent values sent to the pi System for an array of points. The snapshot values in engineering units, status codes, times, dates, and errors are returned in the passed parallel arrays. If the point type is not real, the value is returned in istat and the rval argument is returned as 0.
C format
int32 pisn_getsnapshots(
int32 PIPTR * pt
float PIPTR * rval,
int32 PIPTR * istat,
int32 PIPTR * timedate,
int32 PIPTR * error,
int32 count );
Returns
>0
System error
0
Success
-1
Point not found
Arguments
pt (passed)
Array of point numbers
rval (returned)
Array of values in engineering units, undefined for integer and digital points
istat (returned)
Array of statuses for type real points and values for integer and digital points
timedate (returned)
array of time stamps
error (returned)
Array of error codes
count(passed)
Size of the arrays
pi Toolkit Reference
GetSnapshot
以下是VB的定义
Declare Function pisn_getsnapshots Lib "piapi32.dll" (pt&, rval!, istat&, timedate&, piapierror&, ByVal count&) As Long
我是这样定义的
function pisn_getsnapshots(pt:array of Integer;rval:array of single;istat:array of Integer; timedate:array of Integer; error:array of Integer; count: Integer):Integer;stdcall;external 'piapi32.dll';
调用的时候
var
pt:array[0..20] of Integer;
rval:array[0..20] of single;
istat:array[0..20] of Integer;
timedatePt:array[0..20] of Integer;
errorPt:array[0..20] of Integer;
countPt: Integer
i:=getsnapshots(pt[0],rval[0],istat[0],timedatePt[0],errorPt[0],countPt);
i的值为0表示调用成功,但是rval[0]。。rval[20],的值都不正常,我把上面的句函数调用注释掉,rval[0]..ravl[20]的值仍不变,证明rval的数值在函数中没有被赋值,请高手帮忙看一下,是不是我的定义有问题,还是调用方法有问题
...全文
相关推荐
VB写DLL和调用dll实例
例如,如果你有一个名为`MyFunction`的函数,你可以这样调用它:`MyFunction 参数1, 参数2`3. 请确保参数类型和DLL函数声明的类型相匹配,否则可能会出现类型不匹配的错误。
用易语言写的加密dll
在描述中提到,“关于动态链接库的调用请看源码”,这提示我们应直接查看`pasdll.e`文件来了解如何在易语言环境中调用加密函数。
自己写的文件操作的function和Sub vb.net dll
#### 描述:“自己写的文件操作的function和Sub vb.net dll”描述部分重申了标题的内容,即该DLL包含了作者自行编写的用于文件操作的函数和子程序。
java用JNA调用dll实例,包含各种参数调用
本实例将深入探讨如何使用JNA调用DLL,并涵盖了各种参数类型,包括基本数据类型、指针、结构体、回调函数、字符串以及数组。首先,理解JNA的基本工作原理至关重要。
C# 调用C++DLL(函数参数包含指针)
本篇文章将深入探讨如何在C#中调用一个C++DLL,特别是当DLL函数参数中包含指针时的处理方法。首先,理解C#与C++之间的互操作性是关键。.


非技术区
