很不好意思,代码都在我内网机器上(我在公司),传不出来的。
以下大致写写主要代码:
static int num1=0;
static int num2=0;
static int num3=0;
static int num4=0;
static int num5=0;
void OnButtonCurrentDc()
{
if(0==num1)
{
this->inialKBUSReceive();//此函数的功能就是初始化接受
char CurrentDc[14]={':','C','O','N','F',':','C','U','R','R',':','D','C','\r'};
//以上是万用表指令:配制成直流电流模式
this->KBUS_SendMSG(CurrentDc,14);//发送字符串
}
num1++;
}void OnButtonCurrentAc()
{
if(0==num2)
{
this->inialKBUSReceive();
char CurrentAc[14]={':','C','O','N','F',':','C','U','R','R',':','A','C','\r'};
this->KBUS_SendMSG(CurrentAc,14);
}
num2++;
}void OnButtonVoltageDc()
{
if(0==num3)
{
this->inialKBUSReceive();
char VoltageDc[14]={':','C','O','N','F',':','V','O','L','T',':','D','C','\r'};
this->KBUS_SendMSG(VoltageDc,14);
}
num3++;
}……
(还有两个类似的函数,形式一致),总是第一次按某个按钮,能正确发送指令,但紧接着按其他按钮就出错:“系统找不到指定的文件”。
以下大致写写主要代码:
static int num1=0;
static int num2=0;
static int num3=0;
static int num4=0;
static int num5=0;
void OnButtonCurrentDc()
{
if(0==num1)
{
this->inialKBUSReceive();//此函数的功能就是初始化接受
char CurrentDc[14]={':','C','O','N','F',':','C','U','R','R',':','D','C','\r'};
//以上是万用表指令:配制成直流电流模式
this->KBUS_SendMSG(CurrentDc,14);//发送字符串
}
num1++;
}void OnButtonCurrentAc()
{
if(0==num2)
{
this->inialKBUSReceive();
char CurrentAc[14]={':','C','O','N','F',':','C','U','R','R',':','A','C','\r'};
this->KBUS_SendMSG(CurrentAc,14);
}
num2++;
}void OnButtonVoltageDc()
{
if(0==num3)
{
this->inialKBUSReceive();
char VoltageDc[14]={':','C','O','N','F',':','V','O','L','T',':','D','C','\r'};
this->KBUS_SendMSG(VoltageDc,14);
}
num3++;
}……
(还有两个类似的函数,形式一致),总是第一次按某个按钮,能正确发送指令,但紧接着按其他按钮就出错:“系统找不到指定的文件”。
解决方案 »
- Microsot Visual C++ Runtime Libarary Runtime error
- 创建多视图类型失败
- 请问,如何调试一个自己开发的 ASP 组件?
- 在VC6中如何显示一个模态窗口?
- 请教如何将内存中的一个html格式的字符串显示在htmlview中,谢谢!!!
- 有现在在湖南长沙想做兼职的高手没有?!
- 求教:SetTimer() 和 CSocket::Receive()合用的问题,计时器怎么实效了??
- 感谢Richard2001(Richard) ,可我还是无法VB下调用DLL,紧急求援各位高手
- 请教有关证书方面的知识
- Unable to open file "C0X32.OBJ"
- 关于双击的问题
- meshlab
再按的时候
还能执行下面的..?if(0==num3)
{
this->inialKBUSReceive();
char VoltageDc[14]={':','C','O','N','F',':','V','O','L','T',':','D','C','\r'};
this->KBUS_SendMSG(VoltageDc,14);
}
{
this->inialKBUSReceive();
char VoltageDc[14]={':','C','O','N','F',':','V','O','L','T',':','D','C','\r'};
this->KBUS_SendMSG(VoltageDc,14);
}
-----你自己跟下你的代码..
//硬件的初始化只能一次。