labview 和max下面我都试过,都不行,下面是ni论坛上面相关的,后面是我在上面提问的。
高手请帮忙,谢谢
http://forums.ni.com/ni/board/me ... amp;message.id=7618
someone else have used C++ to control 5508A, It has worked well
the following is the code about the ie488 and laser read subroutine.
I don't understand ieseg(0xd000); ieinit(0x2b8,21,0);
what's 0xd000 and 0x2b8,21,0? as for Labview, what is related with them?
and I have try the command RS and M1RC by visa write and read, It's no response.
#define LMaddr 23
////////////////////////////////////////
void reset_laser()
{
char *cmdstr;
char *outstr;
outstr="RS";
ieseg(0xd000);
ieinit(0x2b8,21,0);
iedevclr(LMaddr);
ieoutput(LMaddr,outstr,strlen(outstr));
}
////////////////////////////////////////////////
float getlaser()
{
char * outstr,*instr;
float finstr;
instr =new char[21];
outstr="M1RC";
ieseg(0xd000);
ieinit(0x2b8,21,0);
ieoutput(LMaddr,outstr,strlen(outstr));
ieenter(LMaddr,instr,20);
instr[strlen(instr)-1]='\0';
finstr=atof(instr);
delete instr;
return finstr;
}
[ 本帖最后由 lup 于 2006-12-7 21:23 编辑 ] |