![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|
#1 |
|
Member
![]() Join Date: Dec 2005
Location: The city Dalian of China
Posts: 9
|
Help me!
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? |
|
|
|
#2 | |
|
Member
|
Quote:
I have never heard of libnodave.so: If you do not get any other replies in a day, please supply more information. |
|
|
|
|
#3 |
|
Member
![]() Join Date: Dec 2005
Location: The city Dalian of China
Posts: 9
|
libnodave is a library that provides the necessary functions to connect to and exchange data with siemens S7 300/400 PLCs.
|
|
|
|
#4 |
|
Member
|
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 |
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|