libnodave exchang data with siemens s7?

lijasmine

Member
Join Date
Dec 2005
Location
The city Dalian of China
Posts
9
I have installed libnodave-0.8.1 on RedHat 8 platform,beacuse I want to exchange data with siemens S7 300/400 PLCs. I have writen the program:
int main(int argc,char **argv)
{char buffer[50],buf[]="This is a simple application";
daveInterface * di;
daveConnection * dc;
_daveOSserialType fds;
int speed=daveSpeed187k;
fds.rfd=setPort("/dev/ttyS1","19200",'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,"Zhao",0,daveProtoMPI,speed);
if(daveInitAdapter(di)!=0)
printf("Adapter is succeed\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,daveDB,1,0,24,buf);
daveReadBytes(dc,daveDB,1,0,24,buffer);
printf("%s\n",buffer);
daveDisconnectPLC(dc);
daveDisconnectAdapter(di);
}
return 0;

}



the output is:

starting ppidaemon
Adapter is succeed
Connect PLC is succeedZhao *** no DLE before send.
Zhao *** _daveSendMessageMPI error in _daveSendDialog.
Zhao *** no DLE before send.
Zhao *** _daveSendMessageMPI error in _daveSendDialog.
@?%@N
I want to know the meaning of char *nname and the why of error ?
 

Similar Topics

Hi I am trying to connect to a s7-300 with libnodave. I successfully connected to 1200 and a 1500. 1500 had to make some change in the hardware...
Replies
1
Views
1,403
Greetings everyone, I encounter a lot of problems to connect to the PLC. For a couple of days, I had to find by myself the port number ... For...
Replies
9
Views
6,841
Hi,I'm a beginner.I want to connect 1200 by libnodave .who can upload a simple example . About how to build communication and Write DB Values .Any...
Replies
4
Views
1,985
Hi All I want communicate PLC S7 300 by VB.net and use Libnodave pass usb mpi 6ES7972-0CB20-0XA0. Can do it? If can please guide me. Thank you.
Replies
0
Views
3,297
I coded this app using LIBNODAVE maybe some of you guys can test.. i used PLC siemens s7-1200 1212C images...
Replies
1
Views
3,289
Back
Top Bottom