Step 7 communications

GlenGineer

Member
Join Date
Jan 2014
Location
Manchester, NH
Posts
123
Greetings,

Whereas in the past I mostly tried giving answers to others or asking obscure Allen Bradley questions. Today I ask a question as a student. I recently began a S7 class and my lab partner and I were asked to figure out how to communicate between 2 S7-1200 PLCs and write a how to document. My lab partner and I learned how to use TSEND_C and TRCV_C to transfer data between two PLCs. We figured it out and wrote up an instruction sheet. Today I followed my own directions and failed. While setting up a return send and receive pair I accidently accepted the default setting for "Connection Data." The default was incorrect but I immediately realized this. So I reset it to the proper settings but still could not get the send and receive to function until I canned my program and I recreated the entire program. Once everything was done correctly the first time two way communication worked normally.

I was hoping I could add the voice of experience to this document. Are there any rules of thumb that should be observed? Are there common problems that you see when networking two plcs? Any help will be appreciated.
 
Last edited:
Hi Glen,

Is there a reason why you have picked these functions? Why not Profinet Controller - Device or Put and Get?

The main thing I have ran into using connections is establishing the actual connection. I have not set up connections in TIA yet, but I imagine it would be pretty similar to this:

Click
 
Hi Glen,

Is there a reason why you have picked these functions? Why not Profinet Controller - Device or Put and Get?

Personally, I prefer TCP comms, especally with the new _C blocks, to Put/Get, but I agree that I-Device (controller/device) is much easier.



I was hoping I could add the voice of experience to this document. Are there any rules of thumb that should be observed? Are there common problems that you see when networking two plcs? Any help will be appreciated.

Not sure if this is what you ran into the first time or not, but there are two ways to declare the communications parameters. The first way is to have the IP addresses and everything listed in a data block in a specific structure, which is what I typically do. The second way is to draw connections in the HW/Network editor, and then reference it in the block call. I've seen a couple times where I accidentally used one when I meant to use the other, and it wouldn't work.
 
Get and Put were the first form of communication that I was going to try. However I came across a video (in Spanish) that described the TSEND_C and TRCV_C communication. I spent many hours trying to get two S7-1200s to talk back and forth and finally managed it. However repeating the operation seems to be a challenge. To me it seems slightly buggy. The slightest mistake at one of several points seems to cause an unfixable error. Its like you fix your error but somewhere in the back of the TIA program it remembers how you originally set it up (even though it displays correctly in the TIA software).

Another classmate is establishing comms with Gets and Puts and will then write his own instructions.

To close the loop I suppose I should say that I am doing Ethernet communication using version 13 of the TIA portal.

Thanks for any suggestions you all have,
Glen
 
I would definitely look into controller-device communication using profinet. I cannot find any examples, but last time I played with it it was very simple.
 
The slightest mistake at one of several points seems to cause an unfixable error. Its like you fix your error but somewhere in the back of the TIA program it remembers how you originally set it up (even though it displays correctly in the TIA software).

I'm not sure exactly what you were doing, but I can think of two things that could be related to the cause.


  1. If you feed the blocks new communication parameters, you probably need to reset the connections so that it knows to pull in the new parameters. You might need to expand the block interface to see this input, I can't remember.
  2. Depending on how you updated the parameters, it may require extra steps to become effective. There are at least three different values for any given tag: A) The offline value, what it shows in your S7 project, B) the online start/initial value, which is what the tag reverts to when it is reset (startup, if the interface is changed & reinitialized, etc), and C) the actual value, which is what the PLC actually uses in work memory.
If you change the start value in the DB or block interface, it doesn't actually change the actual value the PLC is using in work memory, at least until the DB is reinitialized or the PLC restarts.

If you use a watch table to change the value, then the actual value the PLC is using will get changed, but it won't change the value it defaults to when it powers up next time.
There could be something else going on, but I've seen those two different interactions cause all sorts of "entertaining" commissioning issues.

I CHANGED THE VALUE, SEE?! WHY IS IS STILL DOING THE OLD THING?
 

Similar Topics

I am having a step7 v5.4 program where the blocks are encrypted and locked. And the manufacturer is stopped the support. Is there any ways to...
Replies
2
Views
177
Good Morning, Hoping someone with some Siemens experience can give me a hand with this one. Customer has a S7-200 cpu, which has a 6GK7...
Replies
0
Views
248
HI! HOW COULD I OBTAIN THE NAMES OF THE STEPS OF A ROUTINE IN SFC LANGUAGE IN STUDIO5000? Or is there a system variable that gives me those...
Replies
0
Views
339
I'm just trying to figure out the right method of adding a DO card to an existing rack. It's not the *next* open slot, but I have to move the AO...
Replies
5
Views
547
Hi Siemens Experts, I am hoping someone can shed some light on my issue. I have uploaded the code from a S7-300 (317-2PN/DP) using Step 7...
Replies
9
Views
676
Back
Top Bottom