You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old December 25th, 2005, 09:40 PM   #1
lijasmine
Member
China

lijasmine is offline
 
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?
  Reply With Quote
Old December 25th, 2005, 10:09 PM   #2
CaseyK
Member
United States

CaseyK is offline
 
CaseyK's Avatar
 
Join Date: Feb 2004
Location: In the cornfields, on the prarie, outside Chi-Town, a few miles beyond the boondocks.
Posts: 1,731
Lightbulb

Quote:
Originally Posted by lijasmine
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.
  Reply With Quote
Old December 26th, 2005, 12:20 AM   #3
lijasmine
Member
China

lijasmine is offline
 
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.
  Reply With Quote
Old December 26th, 2005, 02:44 AM   #4
CaseyK
Member
United States

CaseyK is offline
 
CaseyK's Avatar
 
Join Date: Feb 2004
Location: In the cornfields, on the prarie, outside Chi-Town, a few miles beyond the boondocks.
Posts: 1,731
Lightbulb

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
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:01 PM.


.