求助 关于VB中 错误代码为48的 问题

cauczhyang 2013-09-21 11:16:07
大家好,我在工作中遇到了一个VB程序开发的问题,现将问题描述如下,希望能在咱们论坛里面找到高手点拨我一二,或提供解决问题的思路:
开发的这个程序主要是一套加载系统的控制软件,通过这个软件实现试验数据的采集和加载系统的控制,前者是通过外围的PCI板卡实现的,而加载系统的控制主要是通过一款USB的波形发生器生成脉冲波实现,这两中控制均有厂家提供的DLL动态链接库。也就是说,这款软件主要是实现两个目的:第一,通过DLL提供的函数来生成所需要的脉冲,第二,通过DLL提供的函数来控制数据采集卡来实现数据采集。
我在程序的标准模块中声明了程序所使用的函数,并且声明了DLL所在的位置路径,并保证在指定的路径下DLL文件存在。(这样就避免了因为找不到DLL文件而出现错误)
在程序中我定义了DLL文件所规定的变量,并保证变量的类型正确;
可是在调试程序的过程中,波形发生器的控制函数位置却提示有“实时错误:48”即 DLL未能成功载入的错误,为了测试DLL文件是否有效,我编了一个简易的程序来测试波形发生器的DLL,结果没有出现48的错误,并成功运行了。
现在比较纠结的无法确定程序的问题所在?
附:
波形发生器的DLL函数解释(仅供交流):

DDS-3005 USB SDK manual
DDS-3005 USB offers the agile interface of second time development for users, and offers examples for many languages and the editor .Users can use the functions interface in DDSCON.DLL to implement all functions of DDS-3005 USB, and to be inserted into other auto-measuring systems.
Let’s explain every function interface using VC. Interface of any language implement complete same functions. It’s used to reference. The declaration of interface can reference second time development that our company offers for you. Users pay attention to the questions of the variable type and address’s transfer.
1 Control memory setting
设置波形发生器控制参数
//Optional parameters
可选参数
第零位(bit0)为控制循环模式
#define SINGLE_WAVE 0x01 //Single waveform 单次模式
0x01代表十进制1,转换成二进制为0000 0001,亦即代表第零位为1时,为单次模式
#define CONSTANT_WAVE 0x00 //Constant waveform 循环模式
0x00代表十进制0,转换成二进制为0000 0000,亦即代表第零位为0时,为循环模式
第一位(bit1)控制外部触发还是内部触发

#define EXT_RAISING_TRIG 0x02 //External raising trigger 外触发,上升沿
0x02代表十进制2,转换成二进制为0000 0010,亦即代表第一位为1时,为外部触发,上升沿

#define EXT_FALLING_TRIG 0x00 //External falling trigger外触发,下降沿
0x00代表十进制0,转换成二进制为0000 0000,亦即代表第一位为0时,为外部触发,下降沿

#define EXT_TRIG_EN 0x04 //External trigger 外触发使能
0x04代表十进制4,转换成二进制为0000 0100,亦即代表第二位为1时,为外部触发
#define INT_TRIG_EN 0x00 //Intramural trigger 内触发使能
0x00代表十进制0,转换成二进制为0000 0000,亦即代表第二位为0时,为内部触发

第三位(bit3)预留

第四位(bit4)控制外部触发还是内部触发

#deine STOP_OUTPUT 0x10 //Stop output 停止输出(在一个波结束时停止)
0x10代表十进制16,转换成二进制为0001 0000,亦即代表第四位为1时,为停止输出

#define START_OUTPUT 0x00 // Start output 启动输出 (在一个波开始时启动)
0x00代表十进制0,转换成二进制为0000 0000,亦即代表第四位为0时,为开始输出波形

第五位(bit5)预留

第六位(bit6)控制是否设置锁存器
#define COUT_NOT LATCH 0x40 //Output latch(门闩?)
0x40代表十进制64( ),转换成二进制为0100 0000,亦即代表第六位为1时,为计数器状态
#define COUT_LATCH 0x00 //F
0x00代表十进制0,转换成二进制为0000 0000,亦即代表第六位为0时,为计数器状态

第七位(bit7)控制工作状态

#define COUNTER 0x80 //Counter state 计数器状态
0x80代表十进制128( ),转换成二进制为1000 0000,亦即代表第七位为1时,为计数器状态

#define FRQ_TEST 0x00 //Frequency test state 频率检测状态
0x00代表十进制0,转换成二进制为0000 0000,亦即代表第七位为0时,为频率检测状态


__declspec(dllimport) BOOL WINAPI SetCON(unsigned char d int, index);

Parameters introduction:
d :unsigned 8 bits integer
d为8位无符号整形数据,即d由所设置的状态进行位或计算
Index :device number to operate
index为欲操作设备号
Return value:If return true, it express successful setup, else express failing setup.
如果返回值为TRUE,则表示设置成功,否则表示设置失败
Example:BOOL Flag;
BOOL 是函数返回类型,一般说明函数 调用是否成功等判断的;
WINAPI 说明该函数是标准的C语言调用方式,为统一不同编译器的命名规则。
Flag=SetCON(CONSTANT_WAVE|
EXT_FALLING_TRIG|
INT_TRIG_EN|
FRQ_TEST|
COUT_NOT LATCH,0);
|为VC中的位操作运算符,参与运算的量,按二进制位进行运算。包括位与(&)、位或(|)、位非(~)、位异或(^)、左移(<<)、右移(>>)六种。

Note:The hardware of signal controls the state of signal set by 8 bits control memory(Bit7 to Bit0).
信号源硬件是通过内存中的8位(Bit7至Bit0)数据控制输出信号状态的
Bit0:
第0位:
If return 1, it express output waveform is single waveform,The trigger touch off one single waveform every time. If isn’t single, the voltage will hold the state of last sample.
如果返回值为1,则表示输出波形为单次输出模式,这一“开关”每次触发产生单个波形。如果不是单个波形,电压值将会保持在最后一个样本的状态。
If return 0, it express output continuous. If be touched off (From inside or exterior), it will output periodic waveform hour after hour.
如果返回值为0,则表示为持续输出状态,如果触发波形发生器后(无论是内触发还是外触发),其将持续不地输出周期波形。
综上:八位2进制数的第0位即为单次波形或循环波形的控制开关。
Bit1:
第1位:
If return 1, it express to appear raising trigger.
如果返回值为1,则表示出现上升沿触发
If return 0, it express to appear falling trigger.
如果返回值为0,则表示出现下降沿触发
综上:八位2进制数的第1位可以用来控制是上升沿触发还是下降沿触发。

Bit2:
第2位
If return 1, it express to external trigger work.
如果返还值为1,则表示外部触发工作模式
If return 0, it express to intramural trigger work.
如果返还值为0,则表示内部触发工作模式
综上:八位2进制数的第2位可以用来选择内触发还是外部触发工作模式。

Bit3:hold ?
第3位:预留
Bit4:
第4位
If return 0, it express to start wave output.
如果返回值为0,则表示开始产生波形
If return 1, it express to stop waveform output and wait for trigger.
如果返回值为1,则表示停止生成波形,并等待下次触发
综上:八位2进制数的第4位可以用来控制产生或停止波形的生成。

Bit5:hold ?
第5位:预留

Bit6:
第6位:
If return 0, it express to frequency counter’s output latch then counter signal.
如果返回值为0,则表示频率计数器输出(数值)锁存并且开始对信号进行计数(这个翻译有待验证?)
If return 0, it express to connect directly. If the counter works, it should first be latch then read, last latch.
如果返回值为0(根据上文的参数定义,推测此处应该为1),则表示直接连接,如果计频率计数器继续工作,计数器首先锁存,然后再读取数据,最后再次锁存(这部分翻译有待验证?)
综上:八位2进制数的第6位可以用来控制频率计数器的工作模式(这部分翻译有待验证?)

Bit7:
第7位
If return 0, it express state that the frequency test, reset frequency counter.
如果返回值为0,则表示频率测试的状态,并且重置频率计数器。
If return 1, it express the counter works , being not effected by intramural gating signal.
如果返回值为1,则表示频率计数器工作,未被内部的门(界限)信号所影响。
综上:八位2进制数的第7位可以用来控制频率计数器的工作模式(这部分翻译有待验证?)

2 8 bits digital I/O control
二、八位数字I/O控制
__declspec(dllimport) BOOL WINAPI DigitalInOut(unsigned char d,unsigned char *o,int index);

Parameters:d: 8 bits unsigned integer,express 8 bits output I/O
d为8位无符号整型变量,表示8位的I/O输出
Index: device number to operate
Index为待操作的设备号
Value:
O point to 8 bits unsigned integer pointer, saving the 8 bits I/O result to the address.

Return value:If return true ,it express successful operation,else express failing operation.
Example:BOOL Flag;
Unsigned char OutVal=0xaa;
Unsigned char InVal;
Flag= DigitalInOut(OutVal,&InVal,0);

3 Set frequency of output sample point
设置D/A时钟(即设置数字量转换成模拟量时,输出样本点的频率)
__declspec(dllimport) BOOL WINAPI SetAD9850(unsigned long d,int index);
Parameters:d :unsigned long integer.
d为无符号长整型变量
Index: device number to operate
Index为待操作的设备号

Return value:If return true ,it express successful operation,else express failing operation.
如果返回值为TRUE,则表示成功进行了操作,否则操作失败
Example:BOOL Flag;
Unsigned Long FrqVal=10000;
//定义无符号长整型变量FrqVal=10000
Flag= SetAD9850 (FrqVal ,0);
//调用SetAD9850函数
Note: Set out frequency of sample point is F, d is 32 bits parameter, then:、
F是D/A转换的频率,F的倒数是相邻两点之间的时间间隔。
设置样本点的输出频率为F,即单位时间内输出的样本点的个数,1/F表示输出每个样本点所需要的时间,也即相邻两点之间的时间间隔。通过下式反算d。
F=100 * d / 4294967296 (MHz)
计算d
...全文
2381 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
笨狗先飞 2013-09-22
  • 打赏
  • 举报
回复
我觉得在调用dll前做个断点,单步运行一下这段代码,会不会是参数类型错误之类的情况.
笨狗先飞 2013-09-22
  • 打赏
  • 举报
回复
引用 4 楼 worldy 的回复:
MSDN上找不到编号为48的错误
加载 DLL 时的错误(错误 48) 动态链接库 (DLL) 就是在 Declare 语句的 Lib 子句中所指定的库。此错误有以下的原因和解决方法: 此文件并非可执行的 DLL。 如果此文件是正文源文件,它必须编译并链接成可执行的 DLL 形式。 此文件并非 Microsoft Windows DLL。 取得此文件相应的 Microsoft Windows DLL 版。 此文件是早期的 Microsoft Windows DLL,而且和 Microsoft Windows 保护方式不兼容。 取得更新的版本。 此 DLL 引用到其他不存在的 DLL。 取得此被引用的 DLL 并让它能提供其他 DLL 使用。 此 DLL 或所引用的 DLL 并不在所指定的目录中。 移动 DLL 到所引用的目录或将 DLL 所在的目录添加到路径中。 详细信息,可选取有问题的项目,并按下 F1 键。
笨狗先飞 2013-09-22
  • 打赏
  • 举报
回复
不知道,一般要么和程序放在一起,要么放到system32下,添加路径应该是改Path变量吧,没搞过
cauczhyang 2013-09-22
  • 打赏
  • 举报
回复
引用 6 楼 bakw 的回复:
[quote=引用 4 楼 worldy 的回复:] MSDN上找不到编号为48的错误
加载 DLL 时的错误(错误 48) 动态链接库 (DLL) 就是在 Declare 语句的 Lib 子句中所指定的库。此错误有以下的原因和解决方法: 此文件并非可执行的 DLL。 如果此文件是正文源文件,它必须编译并链接成可执行的 DLL 形式。 此文件并非 Microsoft Windows DLL。 取得此文件相应的 Microsoft Windows DLL 版。 此文件是早期的 Microsoft Windows DLL,而且和 Microsoft Windows 保护方式不兼容。 取得更新的版本。 此 DLL 引用到其他不存在的 DLL。 取得此被引用的 DLL 并让它能提供其他 DLL 使用。 此 DLL 或所引用的 DLL 并不在所指定的目录中。 移动 DLL 到所引用的目录或将 DLL 所在的目录添加到路径中。 详细信息,可选取有问题的项目,并按下 F1 键。 [/quote] 后来发现DDSCON.dll必须和另外一个EASYZusbmulti.dll合起来使用,但是如何"将DLL所在的目录添加到路径中“?
of123 2013-09-22
  • 打赏
  • 举报
回复
Error in loading DLL (Error 48) A dynamic link library (DLL) is a library specified in the Lib clause of a Declare statement. This error has the following causes and solutions: • The file isn't DLL-executable. If the file is a source-text file, it must be compiled and linked to DLL executable form. • The file isn't a Microsoft Windows DLL. Obtain the Microsoft Windows DLL equivalent of the file. • The file is an early Microsoft Windows DLL that is incompatible with Microsoft Windows protect mode. Obtain an updated version of the DLL. • The DLL references another DLL that isn't present. Obtain the referenced DLL and make it available to the other DLL. • The DLL or one of the referenced DLLs isn't in a directory specified by your path. Move the DLL to a referenced directory or place its current directory on the path.
cauczhyang 2013-09-21
  • 打赏
  • 举报
回复
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Dim F As Single, AMP As Single Private Sub Cmd_Close_Click() RESULT = SetRelay(&H4, 0) End Sub Private Sub Cmd_Open_Click() RESULT = SetRelay(&H8, 0) '开启信号源输出 End Sub Private Sub Cmd_DownLoad_Click() Dim WDATA(2000) As Single, Buf(4000) As Byte, Temp As Long '若用2000个点来描述脉冲波,则需要4000个字节分别来存储波形点 '定义波形数据 RESULT = SetAD9850(F, 0) 'SetAD9850 (1000000) 设置输出刷新率 For I = 0 To 499 WDATA(I) = 1 Next I For I = 500 To 1999 WDATA(I) = 0 Next I For I = 0 To 1999 Temp = 8192 - 8191 * AMP * WDATA(I) / 10.4 '计算一个周期的正弦波 Buf(2 * I) = Temp Mod 256 Buf(2 * I + 1) = Temp / 256 Next I RESLUT = SetEndAddr(1999, 0) '设置地址计数器末地址 Temp = SendDataPackage64(Buf(0), 4000, 0) '将波形数据送入信号源RAM FrameNegtivePulse '地址计数器清零并开始工作 End Sub Private Sub Form_Load() Dim addr(127) As Integer Dim Length As Integer Dim Res As Integer Res = GetItemNum(addr(0), Length) '启动设备 If (Res <> 0) Then MsgBox "USB设备启动失败", , "警告" End If AMP = Text1.Text '定义幅值AMP,AMP需要输入 F = Text2.Text '定义频率F,需要输入 RESULT = SetCON(&H0, 0) '设置为连续波形,内触发,下降沿触发,频率测量门控使能,计数器数值不锁存 RESULT = SetRelay(&H80, 0) '设置频率计计数器为直流耦合输入 RESULT = SetRelay(&H4, 0) '设置信号源输出为高阻态 RESULT = SetRelay(&H10, 0) '设置波形幅度为正常幅度 RESULT = SetRelay(&H1, 0) '使信号源通过滤波器后输出 RESULT = SetFir(&H0, 0) '设置输出滤波器截至频率为10kHz End Sub
cauczhyang 2013-09-21
  • 打赏
  • 举报
回复
10 Read the value of the counter 读计数器结果 __declspec(dllimport) unsigned long WINAPI GetFrqMeasureResult(int index); Parameter: Index :device number to operate Result:The value of the counter. 函数的调用结果为计数器的值 example:Long CounterVal; //定义长整型数据 CounterVal CounterVal= GetFrqMeasureResult (0); Note:When you are testing frequency ,the function should be use after starting one time frequency test for 1000ms,When the counter is working, the function should be use after enable the flip-latch of the counter. Then Unable the flip-latch of the counter. 注释:进行频率测试时,当开始单次频率测试持续时长1000ms(for 1000ms的翻译有待验证???)必须调用该函数。当计数器工作时,在启动计数器的锁存器之后也必须调用该函数,随后计数器的锁存器功能关闭。 11 Transfers Waveform data to the signal fountain 给缓存写数据 将信号数据输入信号源 __declspec(dllimport) BOOL WINAPI SendDataPackage64(unsigned char *d,unsigned int n,int index ); Parameter:d: waveform buffer the first pointer. d为波形缓存器的第一个指针,为无符号字符串类型 n :the number of bits in the waveform buffer. n为波形缓存器中点的个数 Index: device number to operate Index为待操作设备号 Result : If return true ,it express successful operation,else express failing operation. 结果,如果返回值为true,这表示操作成功,反之,表示操作失败 Example : Unsigned char Buf[200]; //定义无符号字符串Buf[200] FlagSetAD9850 (1000000); //Set the rate of renovation //设置数据点更新的速率,怀疑这个有问题,调用的函数应该是 SetAD9850,该语句是不是应该是Flag=SetAD9850(1000000,0)呢? for(int i=0;i<100;i++) //Compute one cycle sine waveform //计算一个周期的波形数据 { unsigned int Temp = (unsigned int)(8192 + 8000 * sin(i * 3.14159265 * 2 / 100)); Buf[2 * i] = Temp % 256;//256为 ,该步的计算结果为确定某点数据的后八位,并将该值赋给Buf数组的Buf[2 * i ] Buf[2 * i + 1] = Temp / 256;//该步的计算结果是确定了某点数据的前八位(其实是前六位,有高2位是空),并且将该值赋给Buf数组的Buf[2 * i + 1] } SetEndAddr (99,0); //Setting the last address of the address counter //设置地址计数器的末地址 SendDataPackage64(Buf, 200,0); //Transfers Waveform data to RAM of the signal fountain. //将波形数据传输至信号源的RAM中,即调用了该函数 FrameNegtivePulse(0); //Clear the address counter and start work. 启动波形 //调用了FrameNegtivePulse函数,清除了地址计数器并开始产生波形 Note:One sample point has two bytes,but the efficiency width are 14 bits. The value is relation of linearity with the output voltage. 0000H is correspond with -10V,3FFFH is correspond with +10V.The low 8 bits of every sample point are save at low address of the buffer.The high 8 bits of every sample point are save at high address of the buffer. The samples give us a program that transfers 100 points to the signal fountain. 注释:一个样本点占用两个字节,但是有效宽度为14位。样本点数值与输出电压呈线性关系。0000H对应于-10V,0000H表示十进制的0,3FFFH对应于+10V,3FFFH表示十进制的16383,即16383代表+10V,8192代表0V。每个样本点的低八位保存在缓存区地址的低位 ;每个样本点的高八位(实际为高六位)保存在缓存区地址的高位 。上例提供的程序将100个点传输给了信号发生器。 If the return of the interface function is False, it express the communication with USB interface is failed. User can use the interface functions reference the samples of many languages. 如果交互函数的返回值为False,这表示与USB接口交互失败,用户可以参考并使用其他计算机语言的交互函数。 12 Read Address 读地址函数 __declspec(dllimport) BOOL WINAPI Read24C01(unsigned char Addr,unsigned int *Dat,int index); Parameters: addr: the pipe number to operator addr为操作设备的通道数目 Dat :the buffer for receive data. Dat为接收数据的缓存数组 Index :device number to operate Index为所操作设备号 Result : If return true ,it express successful operation,else express failing operation. 结果:如果返回值为True,则表示操作成功,否则表示操作失败 Example : unsigned int temp; //定义无符号整型变量temp If(!Read24C01(0,&temp,0)) MessageBox(“Read Error!”); Else MessageBox(“Read OK!”); //如果调用该函数的结果为FALSE,则!FALSE为TRUE,即如果!Read24C01为TRUE,则显示“Read Error”,即“读地址错误”提示。反之,则提示“Read OK!”即“读地址正确”。 Note: Read Address. 13 Write Address 写地址 __declspec(dllimport) BOOL WINAPI Write24C01(unsigned char Addr,unsigned int Dat,int index) Parameters: addr:the pipe number to operate Dat :the buffer for sending out data. Index :Device number to operate Result : If return true ,it express successful operation,else express failing operation. Example : Unsigned int buf; If(Read24C01(0,buf,0)) MessageBox(“Write OK”); Else MessageBox(“Write Error!”) Note: Write Address. 14 Initialize USB Device 启动USB装置 __declspec(dllimport) int WINAPI GetItemNum(int *addr,int &len); Parameters: addr :array for device index addr为存储设备编号的数组 Len :the length of add Len为地址长度 Result : If return 0, it express successful operation. 如果返回值为0,则表示成功操作 If return 1, express failing operation. 如果返回值为1.则表示启动设备失败 Example : Int addr[127],len;//定义数组addr[127],len变量 Int res=GetItemNum(addr,len);//调用函数GetItemNum函数,并将函数值赋给变量res If(res==0)//如果res=0,则返回OK,反之,则表示启动设备失败。 { Return OK; } Else { Return ERROR; } Note: initialize all devices, and get the number of devices. You must call this function before operation. 注释:启动所有设备,并且得到所有设备的编号,用户必须在操作之前调用该函数。
cauczhyang 2013-09-21
  • 打赏
  • 举报
回复
4 Set relay state 设置继电器状态(0X是c语言中的16进制数的表示方法) //optional parameters 可选参数 #define MASK_FIR_NOT_5M 0x01 //Filter cut-off frequency less than 5M 设置5M高通滤波器? 0x01代表十进制1,转换成二进制为00000001,亦即代表第零位为1时,滤波器的截止频率设置为5M以下(此处的截止频率是上限频率) #define MASK_FIR_PAS_5M 0x02 //Filter cut-off frequency is 5M 不用5M滤波器 0x02代表十进制2,转换成二进制为00000010,亦即代表第一位为1时,滤波器的截止频率设置为5M(此处的截止频率是上限频率) #define MASK_AMP_D15FU 0x10 //Waveform normal scope,满幅度输出±10V 0x10为十进制16,成二进制为00010000亦即代表第四位为1时,波形的输出幅值为±10V #define MASK_AMP_N10DB 0x20 //Waveform output attenuate 20dB ±1V 0x20为十进制32,成二进制为00100000亦即代表第五位为1时,波形输出降低(至?)20dB #define MASK_OUT_HZ 0x04 //Output closed 输出高阻 0x04为十进制4,成二进制为00000100亦即代表第二位为1时,波形输出关闭 #define MASK_OUT_EN 0x08 //Output opened 输出使能 0x08为十进制8,成二进制为00001000亦即代表第四位为1时,波形开始输出 #define MASK_COP_AC 0x40 /Input frequency AC coupling 发出的波没有直流分量 0x40为十进制128,成二进制为01000000亦即代表第六位为1时,输入频率耦合有AC(交流分量) #define MASK_COP_DC 0x80 //Input frequency DC coupling 发出的波有直流分量,有1mv的初始值 0x80为十进制256,成二进制为10000000亦即代表第七位为1时,输入频率耦合有DC(直流分量) __declspec(dllimport) BOOL WINAPI SetRelay(unsigned char d,int index); Parameters:d: 8 bits unsigned integer Index: device number to operate Return value:If return true ,it express successful operation,else express failing operation. Example:BOOL Flag; Flag= SetRelay(MASK_OUT_EN,0 ); Note: There are four Relays in the signal fountain, control them by value in optional parameters. This operation will cost 100ms, that is the filter execute time. 在信号源中有四个中继器(或译为继电器?),在备选参数值中选择某值来控制它们,这一操作将暂用100ms时间,这是滤波器的执行时间。 5 Select frequency counter input 设置频率计数器的输入 //optional parameters #define FRQ_DC_20M 0x01 /Select low frequency input #define FRQ_10M_2700M 0x00 //Select high frequency input __declspec(dllimport) BOOL WINAPI SetFinSource(unsigned char d,int index ); Parameters: d 8 bits unsigned integer d为8位无符号整型变量,表示8位的I/O输出 Index: device number to operate Index为待操作的设备号 Return value:If return true ,it express successful operation,else express failing operation. 如果返回值为True,则表示操作成功,反之,则表示操作失败 Example:BOOL Flag; Flag= SetFinSource (FRQ_10M_2400M ,0); Note: There are two interface of signal input, one is high frequency input (10 to 2.7GHz), another is low frequency input(DC to 20M). 6 Reset counter and startup frequency one time test __declspec(dllimport) BOOL WINAPI StartFrqMeasure(int index ); Parameters: Index device number to operate Return value:If return true ,it express successful operation,else express failing operation. Example:BOOL Flag; Flag= StartFrqMeasure(0); Note: When it works in the frequency test state, it reset counter and bring one time intramural gating signal. The signal persists 1000ms, and carry through frequency counter. When it is the counter state, the function only reset the counter. 7 Set address counter’s last address 设置地址计数器的最终地址 __declspec(dllimport) BOOL WINAPI SetEndAddr(unsigned long d,int index); 设置缓冲器最后一个地址,因为缓冲器地址从零开始,如果有1000个数据,则最后一个数据的地址是999。 Parameters: d unsigned long integer. Index device number to operate Return value:If return true ,it express successful operation,else express failing operation. 如果返回值为True,则表示操作成功,反之,则表示操作失败 Example:BOOL Flag; Unsigned Long AddrVal=10000; Flag= SetEndAddr (AddrVal,0 ); Note: There is a 256K unit of 16 bit width in the signal fountain. So the address of end area is from 0000H to 3FFFF.This function should execute before send the waveform data to signal set. After that, reset address counter and stop it. Wait for the user sending over the data. 在信号源中,有16位宽的存储空间256K,因此结束空间的地址范围为000H-3FFFF之间。该函数必须在向信号集输入波形数据之前执行,重置并停止地址计数器。等待用户发送数据。 8 Set output filter cut-off frequency 设置滤波器,1K就可以 //optional parameter #define FIR_1K 0x00 0x00也就是十进制的0,也就是二进制的0000 0000 #define FIR_10K 0x02 0x02也就是十进制的2,也就是二进制的0000 0010 #define FIR_100K 0x01 0x01也就是十进制的1,也就是二进制的0000 0001 #define FIR_1M 0x03 0x03也就是十进制的3,也就是二进制的0000 0011 __declspec(dllimport) BOOL WINAPI SetFir(unsigned char d,int index); Parameter :d :8 bits unsigned integer. d为8位无符号整型变量,表示8位的I/O输出 Index: device number to operate Index为待操作的设备号 Return value :If return true ,it express successful operation,else express failing operation. 如果返回值为True,则表示操作成功,反之,则表示操作失败 Example :BOOL Flag; Flag= SetFir (FIR_10K, 0); Note :No other than the relay is set to output filter cut-off frequency that is less 5MHz, the function exerts operation. Otherwise it will is still 5MHz, cut-off frequency is not effected by functions setting. 注释:就是通过该中继器来设置输出滤波器的截止频率少于5MHz,该函数即是实现该项操作。否则滤波器的截止频率仍然为5MHz,函数的设置并未影响到截止频率。 9 Clear the address counter and start 清除地址计数器,波形开始输出 __declspec(dllimport) BOOL WINAPI FrameNegtivePulse(int index ); Paramemter: Index: device number to operate Index是欲操作的设备号 Result:If return true ,it express successful operation,else express failing operation. Example:BOOL Flag; Flag= FrameNegtivePulse(0); Note:The function should be use after transfer Waveform data to inside of the signal fountain. After the function that set address counter’s last address is used, the address counter has stopped and waited for program carry data of waveform to signal RAM.When transfer stop, function is used and start address counter again and send the signal fountain output waveform. 注释:该函数必须用在波形数据已经传输至信号源内部后调用。在调用设置地址计数器末地址的函数后,地址计数器已经停止工作并等待程序将波形的数据发送至发生器的RAM。一旦波形数据的传输停止后,调用该函数重启地址计数器并且向信号源发送待输出波形。
threenewbee 2013-09-21
  • 打赏
  • 举报
回复
主要看你的api申明原型是否匹配了。
worldy 2013-09-21
  • 打赏
  • 举报
回复
MSDN上找不到编号为48的错误

1,488

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧