I am working on ethernet communications with vipa cpus, and found your library
well documented and highly effective, keep up the good work!
The testISO_TCP program worked fine straightaway, only some minor comments to make:
the '-c' command is not checked from the command line (once added, all is well),
the program displays words from DB1 and not dwords as the comments suggest, could
do with a description of '-a' in the 'usage' printout.
Encouraged by the results, I copied out all my blocks using '--readout' and then
tried to use the testISO_TCPload program to write back DB1, which contained the
32 words needed for testISO_TCP. The program seems to send the upload request and
DB data correctly, and then hang on line 356 while attempting to send a command with
1 parameter byte 0x1C and 0 data bytes. Here's the dump of the relevant section :
The PDU and packet looked OK to me, only I couldn't figure out what this command
was supposed to do, so I commented out lines 345 to 358, thus going directly
to the next command which causes the PLC to link the block in, and then it
works fine! Maybe due to some minor protocol difference between siemens and vipa
cpus ? Once this was done, I was able to load blocks without any issues, haven't
tried SDBs though.
Some more comments / questions :
Two calls to daveNewConnection (lines 175,177). The second would over-write the first??
Three calls to ConnectPLC in a loop (lines 178 to 183). Why is this needed ?
If the PLC is password protected, the response to the upload request returns
zero param bytes and can be detected by checking p2.plen at line 275. Any idea
what the command sequence is to 'login' with a password ?
Once the blocks are loaded and linked in, the memory does not get compressed.
How can I achieve this ??
If my PC has two network cards, (say one to the PLC and the other to a LAN),
how will the opensocket sequence behave ? Can I select which card is to
be used for the connection, or will it happen automatically, assuming both the
subnet IDs are different ?
My OS : Win XP Pro SP2
My compiler : Borland command line tools 5.5
My CPU : Vipa 315-2AG10 (speed 7) version 1.25
Thanks in advance for your help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> The testISO_TCP program worked fine straightaway, only >some minor comments to make:
> the '-c' command is not checked from the command line >(once added, all is well),
> the program displays words from DB1 and not dwords as >the comments suggest, could
> do with a description of '-a' in the 'usage' printout.
The problem wit the test programs is that I sometimes change something and recompile them just to do a quick tes, e.g. in case a user asks for something.
Regarding the -c, I sometimes inserted it when I found it convinient to clear the memory used in the tests. Maybe I copied the text into usage without copying the code..
> DB data correctly, and then hang on line 356 while
>attempting to send a command with
> 1 parameter byte 0x1C and 0 data bytes. Here's the dump of >the relevant section :
I will check it later.
> works fine! Maybe due to some minor protocol difference >between siemens and vipa
No, there should be none. In fact, this code has been tested with VIPA speed7, but maybe I spoiled something later.
> Two calls to daveNewConnection (lines 175,177). The
>second would over-write the first??
Leftover from some experiment to find out whether it might be possible to establish multiple S7 connections over the same TCP connection (in case of MPI such a thing works, see testMPI.c).
> Three calls to ConnectPLC in a loop (lines 178 to 183). Why >is this needed ?
I have no CP at home. I did tests with other peoples CPs connected to the intenet and over my phone line. I found it sensible to retry the first call to the PLC in case it timed out due to slow internet connection.
> If the PLC is password protected, the response to the >upload request returns
> zero param bytes and can be detected by checking p2.plen at >line 275.
This may be different from Siemens. I seem to remeber there was some error response with code 8xxx.
>Any idea
> what the command sequence is to 'login' with a password ?
No, never tried it.
>
>Once the blocks are loaded and linked in, the memory does >not get compressed.
I guess it's like in S5 times: you must command the CPU to do this. Step7 may do it for you automatically, so you do not notice the command.
> How can I achieve this ??
Again, I never tried, but when I have some time I will.
> If my PC has two network cards, (say one to the PLC and
> the other to a LAN), how will the opensocket sequence >behave ? Can I select which card is to
> be used for the connection, or will it happen automatically, >assuming both the
> subnet IDs are different ?
Yes, you use the target IP and the OS determines interface and route. I do not know Windows very well. On Linux, for example, you could have two cards on the same subnet and then manually specify routes and interfaces based on target IP. But that again affects all programs on a machine, not just one.
Thomas
My OS : Win XP Pro SP2
My compiler : Borland command line tools 5.5
My CPU : Vipa 315-2AG10 (speed 7) version 1.25
Thanks in advance for your help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
>Any idea what the command sequence is >to 'login' with a password ?
>No, never tried it.
>Once the blocks are loaded and linked in, the >memory does >not get compressed.
>I guess it's like in S5 times: you must command >the CPU to do this. Step7 may do it for you >automatically, so you do not notice the >command.
> How can I achieve this ??
>Again, I never tried, but when I have some time I >will.
Hope to see these features in your next version !
> Three calls to ConnectPLC in a loop (lines 178 to >183). Why >is this needed ?
>I have no CP at home. I did tests with other >peoples CPs connected to the intenet and over >my phone line. I found it sensible to retry the first >call to the PLC in case it timed out due to slow >internet connection.
This sounds very interesting. I did my tests initially with a direct connection (cross-link cable) and then over a LAN. Can you tell me how to set up the connection to work over the internet ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Connection over Internet:
On the PC running libnodave, there is nothing special to do. You just need the IP address of a CPU connected to the internet.
To connect a CPU to the internet, you will have to use a router, e.g. another PC or a dedicated router. I cannot tell you how to configure MS Windows as a router. If your router runs a firewall, you need to configure it to let port 102 pass through. For IBH NetLinks, you would need port 1099.
If you have no static IP address (most internet users don't), you can use a service named dyndns. Dyndns gives you a domain name, e.g. myname.dyndns.org. After you connected to the internet, dyndns creates or updates a dns entry with your temporary IP address.
On the PC running libnodave, you can then look up the IP. Don't know how to do it on Windows. On LINUX, use dig or nslookup or ping. Maybe ping is sufficient under Windows, too.
Thomas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am working on ethernet communications with vipa cpus, and found your library
well documented and highly effective, keep up the good work!
The testISO_TCP program worked fine straightaway, only some minor comments to make:
the '-c' command is not checked from the command line (once added, all is well),
the program displays words from DB1 and not dwords as the comments suggest, could
do with a description of '-a' in the 'usage' printout.
Encouraged by the results, I copied out all my blocks using '--readout' and then
tried to use the testISO_TCPload program to write back DB1, which contained the
32 words needed for testISO_TCP. The program seems to send the upload request and
DB data correctly, and then hang on line 356 while attempting to send a command with
1 parameter byte 0x1C and 0 data bytes. Here's the dump of the relevant section :
****************************************************************************
Block sent.
PDU header: 32,01,00,00,03,00,00,12,00,00,
PDU header: 32,01,00,00,03,00,00,12,00,00,
plen: 18 dlen: 0
Parameter: 1C,00,00,00,00,00,00,00,09,5F,30,41,30,30,30,30,31,50,
PDU header: 32,01,00,00,03,00,00,12,00,00,
plen: 18 dlen: 0
Parameter: 1C,00,00,00,00,00,00,00,09,5F,30,41,30,30,30,30,31,50,
Got end of block transmission
PDU header: 32,03,00,00,00,00,00,01,00,00,00,00,
plen: 1 dlen: 0
Parameter: 1C,
error: ok
IF1 enter _daveExchangeTCP
send packet: : 03,00,00,14,02,F0,80,32,03,00,00,03,00,00,01,00,00,00,00,1C,
^C
D:\borland\libnodave>
****************************************************************************
The PDU and packet looked OK to me, only I couldn't figure out what this command
was supposed to do, so I commented out lines 345 to 358, thus going directly
to the next command which causes the PLC to link the block in, and then it
works fine! Maybe due to some minor protocol difference between siemens and vipa
cpus ? Once this was done, I was able to load blocks without any issues, haven't
tried SDBs though.
Some more comments / questions :
Two calls to daveNewConnection (lines 175,177). The second would over-write the first??
Three calls to ConnectPLC in a loop (lines 178 to 183). Why is this needed ?
If the PLC is password protected, the response to the upload request returns
zero param bytes and can be detected by checking p2.plen at line 275. Any idea
what the command sequence is to 'login' with a password ?
Once the blocks are loaded and linked in, the memory does not get compressed.
How can I achieve this ??
If my PC has two network cards, (say one to the PLC and the other to a LAN),
how will the opensocket sequence behave ? Can I select which card is to
be used for the connection, or will it happen automatically, assuming both the
subnet IDs are different ?
My OS : Win XP Pro SP2
My compiler : Borland command line tools 5.5
My CPU : Vipa 315-2AG10 (speed 7) version 1.25
Thanks in advance for your help.
> The testISO_TCP program worked fine straightaway, only >some minor comments to make:
> the '-c' command is not checked from the command line >(once added, all is well),
> the program displays words from DB1 and not dwords as >the comments suggest, could
> do with a description of '-a' in the 'usage' printout.
The problem wit the test programs is that I sometimes change something and recompile them just to do a quick tes, e.g. in case a user asks for something.
Regarding the -c, I sometimes inserted it when I found it convinient to clear the memory used in the tests. Maybe I copied the text into usage without copying the code..
> DB data correctly, and then hang on line 356 while
>attempting to send a command with
> 1 parameter byte 0x1C and 0 data bytes. Here's the dump of >the relevant section :
I will check it later.
> works fine! Maybe due to some minor protocol difference >between siemens and vipa
No, there should be none. In fact, this code has been tested with VIPA speed7, but maybe I spoiled something later.
> Two calls to daveNewConnection (lines 175,177). The
>second would over-write the first??
Leftover from some experiment to find out whether it might be possible to establish multiple S7 connections over the same TCP connection (in case of MPI such a thing works, see testMPI.c).
> Three calls to ConnectPLC in a loop (lines 178 to 183). Why >is this needed ?
I have no CP at home. I did tests with other peoples CPs connected to the intenet and over my phone line. I found it sensible to retry the first call to the PLC in case it timed out due to slow internet connection.
> If the PLC is password protected, the response to the >upload request returns
> zero param bytes and can be detected by checking p2.plen at >line 275.
This may be different from Siemens. I seem to remeber there was some error response with code 8xxx.
>Any idea
> what the command sequence is to 'login' with a password ?
No, never tried it.
>
>Once the blocks are loaded and linked in, the memory does >not get compressed.
I guess it's like in S5 times: you must command the CPU to do this. Step7 may do it for you automatically, so you do not notice the command.
> How can I achieve this ??
Again, I never tried, but when I have some time I will.
> If my PC has two network cards, (say one to the PLC and
> the other to a LAN), how will the opensocket sequence >behave ? Can I select which card is to
> be used for the connection, or will it happen automatically, >assuming both the
> subnet IDs are different ?
Yes, you use the target IP and the OS determines interface and route. I do not know Windows very well. On Linux, for example, you could have two cards on the same subnet and then manually specify routes and interfaces based on target IP. But that again affects all programs on a machine, not just one.
Thomas
My OS : Win XP Pro SP2
My compiler : Borland command line tools 5.5
My CPU : Vipa 315-2AG10 (speed 7) version 1.25
Thanks in advance for your help.
>Any idea what the command sequence is >to 'login' with a password ?
>No, never tried it.
>Once the blocks are loaded and linked in, the >memory does >not get compressed.
>I guess it's like in S5 times: you must command >the CPU to do this. Step7 may do it for you >automatically, so you do not notice the >command.
> How can I achieve this ??
>Again, I never tried, but when I have some time I >will.
Hope to see these features in your next version !
> Three calls to ConnectPLC in a loop (lines 178 to >183). Why >is this needed ?
>I have no CP at home. I did tests with other >peoples CPs connected to the intenet and over >my phone line. I found it sensible to retry the first >call to the PLC in case it timed out due to slow >internet connection.
This sounds very interesting. I did my tests initially with a direct connection (cross-link cable) and then over a LAN. Can you tell me how to set up the connection to work over the internet ?
Connection over Internet:
On the PC running libnodave, there is nothing special to do. You just need the IP address of a CPU connected to the internet.
To connect a CPU to the internet, you will have to use a router, e.g. another PC or a dedicated router. I cannot tell you how to configure MS Windows as a router. If your router runs a firewall, you need to configure it to let port 102 pass through. For IBH NetLinks, you would need port 1099.
If you have no static IP address (most internet users don't), you can use a service named dyndns. Dyndns gives you a domain name, e.g. myname.dyndns.org. After you connected to the internet, dyndns creates or updates a dns entry with your temporary IP address.
On the PC running libnodave, you can then look up the IP. Don't know how to do it on Windows. On LINUX, use dig or nslookup or ping. Maybe ping is sufficient under Windows, too.
Thomas
Connection over Internet:
Thanks, wll try it out and ley you know how it works.
Connection over Internet:
Thanks, wll try it out and let you know how it works.