Hi, I've tried a lot but I can't compile siemens_mpi.c on new kernel. It only work and compile with kernel before 2.6.13. The problem is that I must use Slackware 11 and I've problem using too old kernel.
I think it's possible to compile siemens_mpi.c by modifying some "#include" because of serial port header have been moved from old location in new kernel.
Can you help me?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm just working for my Diplomarbeit and want to use pvbrowser for visualisation. For that, I have to use libnodave.
My company provides an Siemens USB-MPI adapter with part number 6ES7 972-0CB20-0XA0.
I use openSUSE 10.2 with kernel 2.6.18.8-0.5-default and libnodave v0.8.4. The precompiled kernel module for accessing the USB adapter shipped with libnodave does not work for me. The files for this module are located in usb2mpi-Linux-2.6 in the libnodave directory tree. So I had to recompile the module.
Included with the mentioned version of libnodave is the archive usb2mpimake.tgz, also in usb2mpi-Linux-2.6. I unpacked it and applied the patch to the source file.
> patch siemens_mpi.c patch.in
After that, I applied the changes as mentioned in the previous post. I ran the make command and everthing was fine. The new module was created in the same directory as the sourcecode.
You must load usbserial befor you can use the new module ( run as root! ):
> modprobe usbserial
> insmod ./siemens_mpi.ko
If the commands complete without error, you should be able to use the adapter now. Try
> dmesg
an see the results of loading the module. Usually the module supports plug'n'play while the module is loaded. When you find that no device node ( e.g. /dev/ttyUSB0 ) has been created, try unloading the module, plug in the adapter befor you load the module again. Now the device node should be created. Later I tryed plugging in and removing the adapter while the module was loaded and it was correctly registered and de-registered. Great work!
The command
> testMPI -3 /dev/ttyUSB0
as mentioned in the README in usb2mpi-Linux-2.6 completed without any errors on my system.
I also tried some of the other options of testMPI. Reading the PLCs time ( -t ) failed. But the benchmark ( -b ) worked.
Thanks for the great piece of software!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have some additional information for working with the kernel module.
If you also do a
> make modules_install
in the source code directory, your freshly compiled module will be copied to the module directory of your current kernel. On my system this is /lib/modules/2.6.18.8-0.5-default/extra. The adavantage of this is, that the module will be auto loaded when you plugin the adapter, or you can use:
> modprobe siemens_mpi
which will also load all required kernel modules, if they are not present.
You may also want to run
> make clean
in the yource code directory to clean up the place and save some disk space.
Have a nice day!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I've tried a lot but I can't compile siemens_mpi.c on new kernel. It only work and compile with kernel before 2.6.13. The problem is that I must use Slackware 11 and I've problem using too old kernel.
I think it's possible to compile siemens_mpi.c by modifying some "#include" because of serial port header have been moved from old location in new kernel.
Can you help me?
Change in siemens_mpi.c
#include "/usr/src/linux/drivers/usb/serial/usb-serial.h"
to
#include "/usr/src/linux/include/linux/usb/serial.h"
I got "error: unknown field 'owner' specified in initializer"
so i deleted 'owner' line and code compiled ok.
I havent usb-adapter yet so i cannot test compiled module.
Hi!
I'm just working for my Diplomarbeit and want to use pvbrowser for visualisation. For that, I have to use libnodave.
My company provides an Siemens USB-MPI adapter with part number 6ES7 972-0CB20-0XA0.
I use openSUSE 10.2 with kernel 2.6.18.8-0.5-default and libnodave v0.8.4. The precompiled kernel module for accessing the USB adapter shipped with libnodave does not work for me. The files for this module are located in usb2mpi-Linux-2.6 in the libnodave directory tree. So I had to recompile the module.
Included with the mentioned version of libnodave is the archive usb2mpimake.tgz, also in usb2mpi-Linux-2.6. I unpacked it and applied the patch to the source file.
> patch siemens_mpi.c patch.in
After that, I applied the changes as mentioned in the previous post. I ran the make command and everthing was fine. The new module was created in the same directory as the sourcecode.
You must load usbserial befor you can use the new module ( run as root! ):
> modprobe usbserial
> insmod ./siemens_mpi.ko
If the commands complete without error, you should be able to use the adapter now. Try
> dmesg
an see the results of loading the module. Usually the module supports plug'n'play while the module is loaded. When you find that no device node ( e.g. /dev/ttyUSB0 ) has been created, try unloading the module, plug in the adapter befor you load the module again. Now the device node should be created. Later I tryed plugging in and removing the adapter while the module was loaded and it was correctly registered and de-registered. Great work!
The command
> testMPI -3 /dev/ttyUSB0
as mentioned in the README in usb2mpi-Linux-2.6 completed without any errors on my system.
I also tried some of the other options of testMPI. Reading the PLCs time ( -t ) failed. But the benchmark ( -b ) worked.
Thanks for the great piece of software!
Hi again!
I have some additional information for working with the kernel module.
If you also do a
> make modules_install
in the source code directory, your freshly compiled module will be copied to the module directory of your current kernel. On my system this is /lib/modules/2.6.18.8-0.5-default/extra. The adavantage of this is, that the module will be auto loaded when you plugin the adapter, or you can use:
> modprobe siemens_mpi
which will also load all required kernel modules, if they are not present.
You may also want to run
> make clean
in the yource code directory to clean up the place and save some disk space.
Have a nice day!