You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old February 6th, 2009, 12:50 PM   #1
Clay B.
Lifetime Supporting Member
United States

Clay B. is offline
 
Clay B.'s Avatar
 
Join Date: Jun 2005
Location: Concord,NC
Posts: 1,304
Have you seen this before?

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.
  Reply With Quote
Old February 6th, 2009, 02:15 PM   #2
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,849
How did you send/receive the 4 words consistently - using SFC14/15 ?
  Reply With Quote
Old February 6th, 2009, 02:23 PM   #3
Clay B.
Lifetime Supporting Member
United States

Clay B. is offline
 
Clay B.'s Avatar
 
Join Date: Jun 2005
Location: Concord,NC
Posts: 1,304
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?)
  Reply With Quote
Old February 6th, 2009, 03:55 PM   #4
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,849
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 ?
  Reply With Quote
Old February 6th, 2009, 04:13 PM   #5
Clay B.
Lifetime Supporting Member
United States

Clay B. is offline
 
Clay B.'s Avatar
 
Join Date: Jun 2005
Location: Concord,NC
Posts: 1,304
Here is the manual.

http://www.ricelake.com/docs/ProdInf...8_profibus.pdf

Baud Rate= 1.5Mbps
Nodes= 2 Rice Lake, S7-300 PLC
Update time= Where do I find this value?
  Reply With Quote
Old February 6th, 2009, 05:04 PM   #6
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,849
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.
  Reply With Quote
Old February 6th, 2009, 06:36 PM   #7
Clay B.
Lifetime Supporting Member
United States

Clay B. is offline
 
Clay B.'s Avatar
 
Join Date: Jun 2005
Location: Concord,NC
Posts: 1,304
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.
  Reply With Quote
Old February 6th, 2009, 06:43 PM   #8
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,849
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 ?
  Reply With Quote
Old February 6th, 2009, 06:59 PM   #9
Brownhat
Member
United States

Brownhat is offline
 
Join Date: Mar 2007
Location: MN
Posts: 139
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.
  Reply With Quote
Old February 6th, 2009, 07:19 PM   #10
Clay B.
Lifetime Supporting Member
United States

Clay B. is offline
 
Clay B.'s Avatar
 
Join Date: Jun 2005
Location: Concord,NC
Posts: 1,304
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.
  Reply With Quote
Old February 7th, 2009, 05:22 AM   #11
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,849
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 ?
  Reply With Quote
Old February 7th, 2009, 10:44 AM   #12
Clay B.
Lifetime Supporting Member
United States

Clay B. is offline
 
Clay B.'s Avatar
 
Join Date: Jun 2005
Location: Concord,NC
Posts: 1,304
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.
  Reply With Quote
Old February 7th, 2009, 10:48 AM   #13
Clay B.
Lifetime Supporting Member
United States

Clay B. is offline
 
Clay B.'s Avatar
 
Join Date: Jun 2005
Location: Concord,NC
Posts: 1,304
Quote:
Originally Posted by Brownhat View Post
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.
  Reply With Quote
Old February 7th, 2009, 03:15 PM   #14
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
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 by Terry Woods; February 7th, 2009 at 03:19 PM.
  Reply With Quote
Old February 7th, 2009, 03:29 PM   #15
Clay B.
Lifetime Supporting Member
United States

Clay B. is offline
 
Clay B.'s Avatar
 
Join Date: Jun 2005
Location: Concord,NC
Posts: 1,304
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.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:40 AM.


.