11/16/2011 11:41 AM | |
Joined: 9/28/2010 Last visit: 11/27/2024 Posts: 43 Rating:
|
I will have Simatic 315 CPU and I need to read position from 2 position sensor very quicky. The sensors family is here: http://www.tr-electronic.de/trgroup/english/Products/sensors/LinearSensors/Magnetostriction/StainlessSteelRod.html The volume of transmitted data is 4 + 2 input bytes (position + velocity, the velocity can probably be omitted). And 4 output bytes (most probably cannot byt omitted and must be used). Times two - two sensors will be used. No other profibus devices will be used. I expect overall PB wiring distance a lot under 100 meters so I guess the 12 Mbit/s speed can be used. The idea is to read the position every 2 miliseconds. So in the CPU315 I create OB35 and set it to be called every 2 ms. Can I use the PIB / PIW peripheral addressing in the OB35 to read the current sensor values over profibus? How long will the data fetching take? Isn't it all nonsense that the data reading will take (for example) over 10 ms, so I can't read them every 2 ms? Or what other ways are to read the data every 2 ms (and to have enough time left in the PLC for its main cycle)? Or do have to give up profibus and use another way - like SSI interface or direct analog connection from the 2 sensors to PLC? Thanks for any info. |
11/16/2011 6:06 PM | |
Joined: 9/28/2010 Last visit: 11/27/2024 Posts: 43 Rating:
|
I wasn't probable clear enough, so I try to make my questions clearer: My PLC program doesn't exists yet. I don't have any hardware yet, until I know, what solution is viable. From my previous experience I expect the scan cycle (with no slownig by time interrupts) to be about 10 to 15 ms for project of this size. As I don't have the hardware I am unable to test it and determine the TTR time - so that is my first question - can anyone make some educated guess what the TTR would be with my configuration? I don't need exact value - just if the TTR will be closer to 1 or 2 ms, or maybe 10 ms or more? I'm aware of this web application, but only mode ET200s can be selected as slaves and I don't know how much the time wil differ with my slaves. I know how simatic with PB-DP work if the DO I/Os are mapped into the process image. What I don't know is how DP I/Os reading/writing work if it is mapped outside of the process image and I access them by PIB/PIW and PQB/PQW instructions (the peripheral addressing). I guess that when in program I use for example PIW 30 (where IW 30 is address of my PB-DP sensor) that the operating system of the PLC will deliver me the latest value (from the last PB-DP cycle). Value that may by 0ms old (the best case) or up to TTR ms old (the worst) case. Am I correct? So - does anybody know how long does this PIB/PIW instruction takes? For example - here is described that for CPU 317 The instructon L IB x takes 0.05 μs and L PIB x takes 15.01 μs. But that is for local I/Os - are those times the same for PB-DP addresses? Will my L PIW 30 also take only 15 μs? Or more? I understand that in my application there is only little use in calling the OB35 more frequent than the profibus TTR time is. If the TTR would be about 1-2 ms, than most of OB35 calls will get "fresh" data and the profibus use is possible for my application. If the TTR would be about 10 ms or more, than I must connect the sensor by different way, because 10 ms old data are too old for that application. |
11/17/2011 12:37 AM | |
Joined: 10/7/2005 Last visit: 3/17/2025 Posts: 3042 Rating:
|
Hello JanJasek tough call what you are trying to do I must say, let's see if we can shed some more light on things:
Two DP Slaves with 10 Bytes of I/O data each at 12 Mbps will give you a Ttr typical of about 0.1ms ( and ~0.7 ms @ 1.5 Mbps). You'll find an easy to use genericformula for the above calculation in the SiemensProfibus Technical brochure (direct download: http://www.automation.siemens.com/w2/efiles/pcs7/pdf/76/prdbrief/kb_profibus_en.pdf) and the attached pic. The calculation of course assumes that you have only the two DPSlaves on the bus, no other DP Masters (e.g. HMI's) and no Diagnostic messages (which you won't have if all is well, but if you do they can be longer and extend the bus time when they happen). While the above may sound encouraging, there are a few other things to look out forand allow me to point you to the thread Chosing Decentral Peripherie for time critical application for more on this matter. In it also a link to the Isochrone mode manualwich very nicely details how Profibus dataupdate relates to the PLC cycle when synchronised or not with it. One more thing to look out for if you really must call a cyclic interrupt OB every 2ms, is that the logic inside of it must NOT take longer than 2ms itselfs to execute (otherwise it will try to interrupt itself and your PLC will crash). I hope this helps with your research |
Cheers |
|
This contribution was helpful to
1 thankful Users |
Follow us on