Not necessarily just S7 - Inbuilt simulators

RMA

Member
Join Date
Sep 2004
Location
North of Hamburg, Germany
Posts
2,052
Jesper and S7Guy have mentioned in recent posts that they always build in Simulators in their projects, to assist in testing.

Until now, I have assumed that this might be practical in a new project, but that it would probably be impractical, or too much work, to incorporate in my current project. Now, however, that following the successful factory acceptance test, I'm about to lose my PLC to the customer on-site, I'm faced with a few months of either travelling to the customer site (5 hours drive away) on a regular basis, or considering implementing some form of simulator to simplify testing.

I'd be grateful for any examples, not just from Jesper and S7Guy, how you've implemented in-built simulators.
 
To a large extent, it depends on the real process.

If it is a simple circle-logic routine then you can simply initiate the routine by a single, simple, phoney (test) input signal.

If, on the other hand, it is a complicated, a motion sensitive issue, you need to create simulated partial conditions.

Simulate this... watch the response... then simulate that... then watch the response... etc.

Typically, the simulated input comes from an HMI/MMI.

It requires that you understand the necessary required initial conditions and the subsequent trigger... all of which are simulated.
 
We use the Siemens plc simulation. It works like a real wordl plc. So you still have to download programs/hardware configuration. We also use Siemens TP270 displays. With protool we can test the displays with "simulation" or "run time". The funny part is that when i'm simulating a plc in Step 7, protool can be tested in run time because it connects to the virtual plc. In this way we test our HMI/PLC program without display and plc. It is quicker (download to P l C is faster). And there is no need for test equipment. When the HMI and PLC are ok in the simulated world then we start testen in the real world. So in a sense I always have my PLC with me!

Large/complex changes in program we test with the simulator before download to the real world (over phone or just onsite).
 
I've got PLCSim, but I find that it's not suitable for testing more than very small snippets of a program - I've discussed the weaknesses of PLCSim a few times here.

What I'm looking for is something like what Jesper mentioned in a recent post where he commented that in his in-built simulation he can also adjust feedback (or perhaps it was loop) response times.

I'm pretty sure that anything substantial is going to include mapping I/O so that one can swap between plant I/O and simulated I/O at the drop of a Bit (so to speak!).

If possible I'd like to see an example of how people have realised such set-ups.
 
You can simulate everything !
You have to create a "model" of the simulated process. People who are into proces control an regulation will know what a model is. It is a theoretical mathematical representation of the physical proces.
The model can be as simple as when a motor is started then the corresponding input from the contactor is also set. But it can also be a complicated timedependant formula.
If the model is accurate, then the simulation will be very lifelike.
If you want, you can make a variable model where the changing of a few constants may reflect changes to the proces.
Some people use advances simulation program (like VisSim for example), but why not use the PLC for it. Todays PLCs have enough computing power that I find it enormously productivity enhancing to simulate everything from within the PLC. It is good enough for my puposes for sure.
I can then test not only my PLC program, but also my HMI program, datalogging etc.

By the way, what were the shortcomings of Siemens PLC-SIM that you have found Roy. I would like to know them.
 
We maybe have different experiences of PLC sim , but I use it for just about everything , PID loops , simulating read and write to profibus devices , and am quite impressed with it . I tend to write a simulation block ( say FC10 which contains all of the simulation code ( PID PV simulators , motor feedbacks etc)) , just to speed things up , but I would say that I am more than 99.5% tested with PLCSIM and protool RT .
 
I believe that Roy is talking about a simulator that will actually run his process without actually processing product.

As Jesper said, it's a matter of developing a model of the process.

In many cases, a simple simulator can be developed through the use of a Time & Event Based Drum (you remember that from TI, eh, Roy?). Alternatively, you can simply use dedicated simulator timers and simulator logic to drive your simulator signals.

Since actual product is not moving through the process then the product can not be detected and so subsequent actions do not occur.

However, if you develop a simulator, you can impose simulated signals which are programmed in parallel (sorta) with actual input signals.

For example, if a part is to be loaded into a clamping part-holder by a cylinder then you can tell the simulator to extend the cylinder. When the cylinder is extented, you can use that real input as an input to the simulator drum to force the drum to turn on the simulated "part-loaded" bit. This bit would then be used to close the clamp. When the clamp is closed then that real input signal would initiate some subsequent action in the process. When that action is completed then a real signal from that action can force the simulator drum to the next step... open the clamp, eject the part, etc. etc... ad-pukem.

With careful consideration, you can have your entire process running without a single piece of product passing through.

Is this what you meant Roy?
 
Thanks for the replies, guys.

basically what I'm lookng to do is, as Terry and Jesper suggest, effectively model the complete hardware (or at least one or maybe two of the 21 modules). I'm slowly starting to get a feel for how I can realise this, helped on by your input, but it's going to be a couple of weeks before I can start trying it out, since I'm off to site tomorrow for another couple of weeks commissioning.

By the way, what were the shortcomings of Siemens PLC-SIM that you have found Roy. I would like to know them.

My main gripe with PLC-Sim is it's built in recorder, which could be a real boon had it been properly implemented. Unfortunately, when it is recording an operation, instead of recording each operation individually, PLC-Sim takes a snapshot of the I/O-Byte that the Bit you're operating is in. This means that when you play back this operation you cannot make simultaneous operations of other bits of the equipment to check for interactions etc., if any of the Bits that you want to manually play with are in the Bytes that you've recorded, because when you (say) set an Output Bit in one of these Bytes, since it was not set during the recording process, when the replay next accesses this Byte it will overwrite the Bit that you just set.

There are basically two philosophies for defining your addressing, depending on the circumstances. Either you spread related I/O over a large number of cards (preferably with redundancy) so that the chances of a fault affecting several parts of the system at once are relatively small. Or you group all related I/O for one sub-system as far as possible on the same Input or Output card. In this case a card fault will only affect a relatively small, clearly definied part of the plant, leaving (most of) the rest still able to operate. Because of my Process Control background, I tend to use the latter system, but unfortunately it doesn't agree with PLC-Sim!

Don't expect to have much Internet access over the next couple of weeks, so it may be about the 18th July before I'm back.
 

Similar Topics

Hi I wanna know that do we have any type of control logix plc (Rockwell Automation) which contains in-build scada in it? If so can any one please...
Replies
5
Views
2,763
Hello, Does anyone know a good simulator for MOSCAD?? I am currently developing an application that will need some communication with MOSCAD but I...
Replies
0
Views
1,674
O
To the experience PLC guru out there ! Firstly this site is great. I have learnt a little so far just coming to this www.plcs.net and hope to...
Replies
3
Views
2,569
Back
Top Bottom