Have you seen this before?

Clay B.

Lifetime Supporting Member
Join Date
Jun 2005
Location
Concord,NC
Posts
1,304
I just completed a project that thru me a curve ball I have never seen before. I am wondering if anyone else has seen something like this.


I connected a Rice Lake 920i to a S7-300 PLC thru Profibus DP. The Rice Lake is a generic slave to the S7-300. The Rice Lake requires 4 words consistent messaging.

The message form is first word command in Hex second word is parameter in Hex third and forth word can be either DINT or Real. The 3 word is MSW forth is LSW.
Commands and Parameters are predefined for the Rice Lake.

Curve ball: If I sent my messages from my S7-300 faster than once every 250 mil seconds the return from the Rice Lake would be garbled.

What I mean by garbled is this:

I would alternate between sending the message First word hex130, second word hex 64, third and forth 1.0 to 8.0 depending on the recipe value I wanted to load into Setpoint 100.

The next message would be First word hex140, second word hex 62, third and forth 0; this would tell me the value in Setpoint 98

I would alternate between these 2 messages every scan. I would read the return on every scan.

What I expected to happen was when I sent 140,64,1 I would get back 140,status value of Rice Lake,1 When I sent 130,62,0 I would expect back 130,status value of Rice Lake, value of Setpoint 98 (hex62).


What I would ACTUALLY get back would be 140, some unknown value, and either the value I sent or the value of Setpoint 98, the other message back would be 130,some unknown value, and either the value I sent or the value of Setpoint 98.

Like I said the messaging was getting garbled. The only time I received consistent and expected responses was when I spaced out my messages by 250ms.I would send my first message, wait 250ms send my second wait 250ms repeat.

Well having a .5 second plus delay between my action reactions was not acceptable so I had to create an alternate method. This does not correct the messaging garbling; it just allows me to work around it.

Has anybody else seen something similar?Maybe in another device.

Also Note: I know the accuracy of my echoes because I got my local Siemens vendor to bring in a Profibus sniffer and we could see the messaging on Profibus in its native form. And in order of send receive. That’s how we figured out the garbling and how much delay we needed to get rid of it.
 
Yes, I use SFC14 and SCF15. I used an Any (think that is the correct term ) to point at a DB with the correct word form in it.

I then created an FC I would load with data from other DB blocks depending on what I needed to do. I would call the Data Loading FC there a sequencer I created.

(Clear as mud huh?)
 
Can you post a link to the manual for the profibus interface of the Rice Lake - my quick search didn't find anything useful.

What Profibus baud rate are you using ?
How many nodes on the Profibus ?
Profibus update time ?
 
If you look at the profibus properties, a set of times is given - typical target rotation time is the update time IIRC.
As you only have the Rice on the bus, this isn't going to be a problem.
 
ok let me make sure I understand what you are talking about. T

Typical Target Rotation = Update Time

This is found in Bus Parameters and in my case = Ttr typicaly 23561 or .9ms

So is my bus to fast for the Rice Lake? Like i said I did notice when I slowed things down using a timer I got more consistant data. Problem here is I had to slow things down to much.
 
No your bus is not too fast - the bus should normally be faster than your plc scan.

What were the "unknown values" you got - random numbers that changed all the time or a fixed number that you were not expecting ?
 
I'm not familiar with Profibus, but I just setup communications with a 920i using EtherNetIP. In my setup I had a RPI of 50 ms, but I did not update the output command until input words showed a mirror of the command to indicate that the command was sucessful. It may be that you are sending the next command while the 920i is trying to act on the previous command. If you use the input word command mirror update to trigger the next command, you may be able to achieve an update interval shorter than 250 ms.
 
Basically what I see is parts from one message in an echo for another message.

Here are 2 typical messages I send. This while batch is running. The first message is to tell the Rice Lake what Mode the PLC is in the Second message is to read what batch state the Rice Lake is in. I do not know if you have had a chance to look at the manual but with Rice Lake you give it comands and based off those comands ti is supposed to respond.

Messages Sent from S7-300
First Message:
130 (Comand for write to setpoint), 62( Parameter for Setpoint 98), 0000, 0003 (Data to write to Setpoint)
Second Message:
140 (Comand for read setpoint), 5F (Parameter for Setpoint 95)
0000,0000 (We send no value because we are reading)

Typical Message from Rice Lake
First Message
130, 425f , 0000,0040 or 130,5A6D, 0000,0000

Second Message
140, 7BFF, 0000,0000 or 140, A3F2, 0000,0040

Basically the value part of the message can be combined with either first part. The second number is supposed to be controller status but I can not make heads or tails out of it.

When I have worked with profibus before, well about any messaging system I used the header to tell me the value I should be looking at. Not so here

It seems to me the Rice Lake sends it's responces when it gets around to it and the last 2 words are not really tied to the first word.
 
Something that jumps out from your last post, command 130 is expecting the setpoint as a floating point number, yet you show the number as 0000,0003 (either 2.755065e-040 or 4.203895e-045 depending on the order of the two words when displayed as floating point) - what floating point number are you trying to send ?
 
Yea, The last number is a float and I enter it as such.

When I form my message my words are
First (word)
Second (word)
Third (real)

I read the same way. I use DB50 for my words to the Rice Lake and DB51 for words back

my any pointers are P#DB50. DBX0.0 Byte 8 for SFC15

P#DB51.DBX0.0 Byte 8 for SFC14


I have never used an Any pointer before, very nice function.
 
I'm not familiar with Profibus, but I just setup communications with a 920i using EtherNetIP. In my setup I had a RPI of 50 ms, but I did not update the output command until input words showed a mirror of the command to indicate that the command was sucessful. It may be that you are sending the next command while the 920i is trying to act on the previous command. If you use the input word command mirror update to trigger the next command, you may be able to achieve an update interval shorter than 250 ms.

What I found was similar, just alot slowwer than 50ms. In my case it was over 200ms.
 
Is your description accurate?

This might be all wet... but maybe not...

Clay, you said...
"I would alternate between these 2 messages every scan. I would read the return on every scan."

Maybe you just came up with a poor description... but maybe this is what you are actually doing - not necessarily what you are trying to do!

If this is what you are actually doing then it sounds like you are actually WRITING and READING on the same scan...

Begin Scan-1
Rung-X: Write ABCD
Rung-X+Y: Read AB00
End Scan-1

Begin Scan-2
Rung-X: Write ABEF
Rung-X+Y: Read AB00
End Scan-2

If this is what you are actually doing... I wouldn't expect it to work as you want.

The WRITE and READ must happen on at least alternating scans (perhaps even more, as in every other 4 or 5 scans).

Scan-1: WRITE
Scan-2: READ
Scan-3: WRITE
Scan-4: READ

You would need to use a toggle arrangement to Enable the WRITE and Disable the READ for ODD Scans, followed by Disable the WRITE and Enable the READ for EVEN Scans.

Is this even close?
 
Last edited:
My poor grasp of the english language is at fault here. I do alternate my reads and write on different scans. I used a counter function after my Write to go up one. The next scan I would use the one value to enable my read function. I would then go up another count tick. I have a line after my count that moves it up another tick. I then reset my count and start over again. I use the counter as a condition on my data send so that I load my data in my DB the scan prior to the scan I write on.


FYI... I did not do this to begin with and I would get the same grabled data back. It was alot more frequent and I found that time delaying my wites did not help until I put the reads and writes on alternating scans.
 

Similar Topics

I'm pretty new to PLC's, so forgive me if I use the wrong terminology and whatnot. We have an issue at work where we have a flow meter that is...
Replies
10
Views
270
I have a word in some DB which I want to load to AR1 and use as a pointer. In order to do this I need to write L DBxy.DBW xy SLD 3 LAR1 I...
Replies
3
Views
506
Hello All, need one help , looking for a example which can help me to write following code in Studio 5000 ladder logic. I have 2 String...
Replies
14
Views
735
Good Morning, I'm not sure if this is a stupid question, but I've been working with FTView ME for quite some time now and I can't solve this...
Replies
9
Views
1,466
Hi all. This is my first time working with the CCW software, and I'm using the CCW developer edition version 21. The PLC is a Micro870...
Replies
4
Views
1,478
Back
Top Bottom