Libnodave help on extension

F

Thread Starter

Frank

For a change in de PLC software I also need to change/extend the Libnodave code, all running on a Linux PC.
My questions:

*Can understand code work? My C++ knowledge is quit rusty....
It should print a HEX code from DB22.DBD2 till DB22.DBD24<pre>
Bytes = 22;

res=daveReadBytes(dc,daveDB,22,2,Bytes,NULL);
if(0==res) {
for (a=1; a <= Bytes;a++)
{
d=daveGetFloat(dc);
fprintf(fp,",x" ,c);
}
} else
{
printf("DB22 failed! (%d)\n",res);
}</pre>
*Also when I want to compile the program the following message appears: "***no rule to make target 'log'. Stop"
"Compilation exited abnormally with code 2 at THU oct 13 10.51.00"

Thanks in advance for your advise.
 
A

automation man

It appears that you are trying to print the wrong values.

daveGetFloat retrieves a floating point value from dc.

"dc" should contain an array of bytes that has the values you need.

You should be printing dc[byte].

Keep in mind that the values start at around byte 24.

You will have to test it to determine where exactly your data is.

delete the daveGetFloat and change c to dc and it should work.

>DB22.DBD2 till DB22.DBD24<pre>
> Bytes = 22;
>
> res=daveReadBytes(dc,daveDB,22,2,Bytes,NULL);
> if(0==res) {
> for (a=1; a <= Bytes;a++)
> {
> d=daveGetFloat(dc);
> fprintf(fp,",x" ,c);
> }
> } else
> {
> printf("DB22 failed!
>(%d)\n",res);
> }</pre>
>*Also when I want to compile the
>program the following message appears:
>"***no rule to make target 'log'. Stop"
>"Compilation exited abnormally with
>code 2 at THU oct 13 10.51.00"
>
>Thanks in advance for your advise.
 
Top