PDA

View Full Version : Help me!


lijasmine
December 25th, 2005, 09:40 PM
Please help me read this program that I have writeen with libnodave.so:
int main(int argc,char **argv)
{

unsigned char buf[1024+1];
daveInterface * di;
daveConnection * dc;
_daveOSserialType fds;
int speed=daveSpeed187k;
int re;
fds.rfd=setPort("/dev/ttyS1","38400",'N');
fds.wfd=fds.rfd;
if(fds.rfd>0)
{
printf("\nstarting ppidaemon\n");
/*daveNewInterface(_daveOSserialType nfd, char *
nname, int localMPI, int protocol, int speed);*/
di = daveNewInterface(fds,"IF1",0,daveProtoMPI,speed);
re=daveInitAdapter(di);
if(re==0)
printf("Adapter is succeed\n");
if(re>0)
printf("are results (also errors) reported by the PLC\n");
if(re<0)printf(" means error reported by library code.\n");
/*daveNewConnection(daveInterface * di, int MPI,int rack, int slot);*/
dc =daveNewConnection(di,2,0,2);
if(daveConnectPLC(dc)==0)
printf("Connect PLC is succeed");
/*daveReadBytes(dc,area,dbnum,start,len,data)*/
/*int daveWriteBytes(daveConnection * dc,int area, int DBnum, int start,int len, void * buffer);*/
//daveWriteBytes(dc,0x84,1,0,24,buf);
daveReadBytes(dc,0x84,1,0,24,buf);
printf("%s\n",buf);
daveDisconnectPLC(dc);
daveDisconnectAdapter(di);
}
return 0;

}

The output is:
starting ppidaemon
means error reported by library code.
IF1 *** no DLE before send.
IF1 *** _daveSendMessageMPI error in _daveSendDialog.
???
I don't know why?

CaseyK
December 25th, 2005, 10:09 PM
I don't know why?

Me neither.....

I have never heard of libnodave.so:

If you do not get any other replies in a day, please supply more information.

lijasmine
December 26th, 2005, 12:20 AM
libnodave is a library that provides the necessary functions to connect to and exchange data with siemens S7 300/400 PLCs.

CaseyK
December 26th, 2005, 02:44 AM
Now I understand...

Because...

I don't understand...

Siemens, that is!



There are some S7 experts on here that will be of great assistance.

regards.....kc