but i get a lots of error 'cause every function from nodave.h (daveStop,daveReadBytes, and so on) raise this error:
testISO_TCP.c:(.text+0x26d3): undefined reference to `daveReadBytes'
What could it be?
TIA
Daniele.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1. Ubuntu is not important. Libnodave does not depend on distributions.
2. Why do you run gcc from command line?
3. Is your system **really** BIG_ENDIAN? i386 is not. What processor do you have?
I do not know compiler and linker syntax by heart. I really on my Makefiles, one time composed and working since. Try to change what you need, e.g. BIG_ENDIAN in the Makefile. Result?
Compiling Libnodave with recent gcc versions will produce warnings, but warnings are no errors. Undefines references may indicate that function naming is different between object files. C++ mangled names? Dump your objectfiles if you want to know. Libnodave is written in C, not C++!
Thomas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I changed from:
gcc -Wl,-z -Wl nodave.o openSocket.o testISO_TCP.o -o TestISO_TCP
to
sudo cc -Wl nodave.o openSocket.o TestPLC.o -o TestPLC
everything work fine, i got my executable!!!!
I'm trying with command line compiling 'cause i'm testing libnodave and expecially using it to develop my own solution.
So by now the first is made now i'll start to develop some solutions...
I red into another post that libnodave can't handle multiple connection, i mean, it can't handle more than one active connection at the same time. Is it true, and if it's... there's a way to handle more than one PLC?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hence it is a problem with file rights? VERY strange, because the compiler wrote files to the same dir and the executable has a name different from what is contained in Libnodave distro (and might have been unpacked by root)..?
T odevelop your own solution, I should still start from existing Makefile and modify it. Makefiles hacve the advantage that they will give exactly the same commands tomorrow or in some years.
I am answering your questions, why don't you answer mine? What big endian machine do you have?
>I red into another post that libnodave can't handle multiple connection,
rubbish...
testMPI has a test for it. Try testMPI --mpi2=<your 2nd PLCs MPI address.
> i mean, it can't handle more than one active connection at the same time.
It can handle as many as want. Your PLC can't.
>.. there's a way to handle more than one PLC?
Because you use TCP/IP: With MPI, there is the same serial interface and adapter. Therefore connections share a common serial port, the file descriptor for it and a common daveInterface.
In TCP/IP, there are separate sockets, hence separate daveInterfaces, and, again separate daveConnections. Technically, with TCP/IP there is not difference from starting two instances of testICO_TCP. This is the fastest test possible and will normally work with different OR the same PLC, provided it has free connections available. Note that the PLC uses a connection (limited resource) each time the CPx43 receives the connect request sent by daveConnectPLC.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, i'm replying to your question 'bout big endian machine: i do not have a big endian machine, i was trying to compiling sources so i had a look around other post and the first compiler command i found uses big_endian. BTW i've removed that directive once i had a look to the makefile.
You're right about using a makefile instead of command line, i'll do.
My target is to build a linux server that can read from many PLCs connected by CPX43 interface. i thought to usa something like an array of daveConnection one for each PLCs, by this way in the same source i can poll more plc..
thanks a lot for your quick help!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
i'm having a lil' problem trying to compile exmples like testISO_TCP..
that's what i did:
gcc -Wall -DDAVE_BIG_ENDIAN -DLINUX -c testISO_TCP.c
Everythings OK
then:
gcc -Wl,-z -Wl nodave.o openSocket.o testISO_TCP.o -o TestISO_TCP
but i get a lots of error 'cause every function from nodave.h (daveStop,daveReadBytes, and so on) raise this error:
testISO_TCP.c:(.text+0x26d3): undefined reference to `daveReadBytes'
What could it be?
TIA
Daniele.
1. Ubuntu is not important. Libnodave does not depend on distributions.
2. Why do you run gcc from command line?
3. Is your system **really** BIG_ENDIAN? i386 is not. What processor do you have?
I do not know compiler and linker syntax by heart. I really on my Makefiles, one time composed and working since. Try to change what you need, e.g. BIG_ENDIAN in the Makefile. Result?
Compiling Libnodave with recent gcc versions will produce warnings, but warnings are no errors. Undefines references may indicate that function naming is different between object files. C++ mangled names? Dump your objectfiles if you want to know. Libnodave is written in C, not C++!
Thomas
I changed from:
gcc -Wl,-z -Wl nodave.o openSocket.o testISO_TCP.o -o TestISO_TCP
to
sudo cc -Wl nodave.o openSocket.o TestPLC.o -o TestPLC
everything work fine, i got my executable!!!!
I'm trying with command line compiling 'cause i'm testing libnodave and expecially using it to develop my own solution.
So by now the first is made now i'll start to develop some solutions...
I red into another post that libnodave can't handle multiple connection, i mean, it can't handle more than one active connection at the same time. Is it true, and if it's... there's a way to handle more than one PLC?
Hence it is a problem with file rights? VERY strange, because the compiler wrote files to the same dir and the executable has a name different from what is contained in Libnodave distro (and might have been unpacked by root)..?
T odevelop your own solution, I should still start from existing Makefile and modify it. Makefiles hacve the advantage that they will give exactly the same commands tomorrow or in some years.
I am answering your questions, why don't you answer mine? What big endian machine do you have?
>I red into another post that libnodave can't handle multiple connection,
rubbish...
testMPI has a test for it. Try testMPI --mpi2=<your 2nd PLCs MPI address.
> i mean, it can't handle more than one active connection at the same time.
It can handle as many as want. Your PLC can't.
>.. there's a way to handle more than one PLC?
Because you use TCP/IP: With MPI, there is the same serial interface and adapter. Therefore connections share a common serial port, the file descriptor for it and a common daveInterface.
In TCP/IP, there are separate sockets, hence separate daveInterfaces, and, again separate daveConnections. Technically, with TCP/IP there is not difference from starting two instances of testICO_TCP. This is the fastest test possible and will normally work with different OR the same PLC, provided it has free connections available. Note that the PLC uses a connection (limited resource) each time the CPx43 receives the connect request sent by daveConnectPLC.
Sorry, i'm replying to your question 'bout big endian machine: i do not have a big endian machine, i was trying to compiling sources so i had a look around other post and the first compiler command i found uses big_endian. BTW i've removed that directive once i had a look to the makefile.
You're right about using a makefile instead of command line, i'll do.
My target is to build a linux server that can read from many PLCs connected by CPX43 interface. i thought to usa something like an array of daveConnection one for each PLCs, by this way in the same source i can poll more plc..
thanks a lot for your quick help!!