Libnodave, S7-222, Linux, Hilfe?

jestal

Level-1
Beiträge
3
Reaktionspunkte
0
Zuviel Werbung?
-> Hier kostenlos registrieren
I'm having no luck.

I have compiled the libnodave programs with no error.

./testPPI /dev/ttyS0 gives the following:
timeout in _daveExchangePPI!

My cable is 6ES7 901-3CB30-0XA0.
I have tried all switch settings.

This cable does work with S7-222 to program, in Windows.

My serial port does work.
Linux is PuppyLinux 4.0

Can you give me some clues?
 
Hello
after reading your question I've just tried it with the 3CB30 cable - for the first time with libnodave and this cable too.
Seems to be working
linux:~ # cd /
linux:/ # cd libno*
linux:/libno42_PCTest # make
cc -O0 -Wall -Winline -DLINUX -c -o testPPI.o testPPI.c
gcc nodaveCommon.o setport.o nodavePPI.o testPPI.o -o testPPI
linux:/libno42_PCTest # ./testPPI
Usage: testPPI [-d] [-w] serial port.
-w will try to write to Flag words. It will overwrite FB0 to FB15 (MB0 to MB15) !
-d will produce a lot of debug messages.
-b will run benchmarks. Specify -b and -w to run write benchmarks.
-l will run a test to determine maximum length of a block in read.
-m will run a test for multiple variable reads.
Example: testPPI -w /dev/ttyS0
linux:/libno42_PCTest # ./testPPI -d /dev/ttyS1
Trying to read 64 bytes (32 words) from data block 1.
This is V memory of the 200.
Press return to continue.
PDU header: 32,01,00,00,00,00,00,0E,00,00,
plen: 14 dlen: 0
Parameter: 04,01,12,0A,10,02,00,40,00,01,84,00,00,00,
I send: 68,1B,1B,68,
send 29
.............
For compiling in PC I just took an older version of libnodave (V4.2 ...) which doesn't any matter.
There are two points which have to be in the testPPI.c and switched to the PLC similar.
dc =daveNewConnection(di,2,0,0); // insert your PPI address (2) here
1.) You have to choose really that adress which is given to your PLC - in this case by me No.2
fds.rfd=setPort(argv[adrPos],"19200",'E');
2.) The choosen baudrate must be same like switched in your PLC.
In the newer versions the source looks a little bit other, but in usage you will find the help and must look in the source for the points were you have to fix the code in these both points.
regards
 
Hi
Now, then next thing is to try a generic RS232/RS485 adapter

until 19.200Bd works every RS232 --- RS485 with automatic data direction control (ADDC) and right connect of line 'A and B' (Pin 8 & 3);

for 187,5kB there normally works nothing - without one exception to try setting in Linux the UART to a Baudrate nearly this 187,5kB (230.000 and a little smaler clock ...).
Therefore has been my way to reach the 187,5 kB taking an extern/optional UART (PCI) or µC (AVR) and choose the divide by 3,68xxx MHZ for 230.000Bd, but clocking it by only 3,00MHZ. Thats works well .
But in 187,5kB there is a little difficult to find an isolated ADDC-Adapter which can transform the speed, the most of them 'hangs up' there functions a few clocks over 19.200Bd.
In 187,5 you need very good quality or short length of the cables (I took there the Profibus cables) otherwise the communication is disturb.


When I built it for myself in 187,5kB in isolated 'design' there didn't work any Optocouplers which I'd tried too. Only the ISO722 or aquivalents transmitted the dates - but then until real higher speeds up to > 12MB.
 
Zurück
Oben