S7-1200 ISO on TCP with libnodave

tkamrath

Member
Join Date
Aug 2010
Location
Cypress, Tx
Posts
18
I am using libnodave to communicate with a 1214 S7-1200 PLC via the builtin ethernet port. It is working fine for a single instance of my .net C# program. And I have it working on a PC and on a CE panel device. But what is not working is multiple connections. So when I run one instance the connection is successfull. When I start the second instance I cannot get a connection. Then when I kill the first instance the second instance gets connected. I think the problem has something to do with the ISO packet. My question is how do I change the code in libnodave to allow for multiple connections?

There is parameter in the ISO packet that tells the 1200 what connection mode to use. In the libnodave _daveConnectPLCTCP function the packet data is somewhat documented for the CP243 communications and this parameter is there. But I don't know where this parameter is in the regular TCP ISO packet. I think the default for this parameter is 1 (PG) and I need to change it to 2 (OP) so that the 1200 will support up to 3 connections. Can anyone tell me where this parameter is in the TCP ISO packet data block so I can change it?
 
Hello tkamrath,

For i school project i'm trying to make a nice interface on the pc to communicate with a s7-1200 plc. To keep it cheap i found libnodave to make a connection via tcp from pc to plc. I have a little knowledge of programming, but i need some startup to be able to make connection from excel to plc. Now i found your comment in this forum, where you write that at least you have a successfull connection. Is it possible that you can give me some hints as startup?

Thanks
Mark
 
I am using libnodave to communicate with a 1214 S7-1200 PLC via the builtin ethernet port. It is working fine for a single instance of my .net C# program. And I have it working on a PC and on a CE panel device. But what is not working is multiple connections. So when I run one instance the connection is successfull. When I start the second instance I cannot get a connection. Then when I kill the first instance the second instance gets connected. I think the problem has something to do with the ISO packet. My question is how do I change the code in libnodave to allow for multiple connections?

There is parameter in the ISO packet that tells the 1200 what connection mode to use. In the libnodave _daveConnectPLCTCP function the packet data is somewhat documented for the CP243 communications and this parameter is there. But I don't know where this parameter is in the regular TCP ISO packet. I think the default for this parameter is 1 (PG) and I need to change it to 2 (OP) so that the 1200 will support up to 3 connections. Can anyone tell me where this parameter is in the TCP ISO packet data block so I can change it?

Why you should have two same programs running on PC? At least try to close connection when you have finished a transaction, so it will free the communiation channel for other instance.
 

Similar Topics

Hi friends, This is my first work with simatic and I am having some difficulties to comunicate S7 with HMI. HMI: T5F-2 Beijer Electronics S7...
Replies
3
Views
3,548
Hi Guys, I have the task of setting up communication between a S7-1214C with Version 3.0 Firmware, and a Beijer E1101 HMI. This needs to be done...
Replies
7
Views
4,639
I have written my own dll (wrapping parts of libnodave) to communicate with a 1214 S7-1200 PLC via the builtin ethernet port. It is working fine...
Replies
4
Views
4,426
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
6
Views
230
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
75
Back
Top Bottom