TIA Portal - PLCSim : simulating hardware

dezuiper

Member
Join Date
Dec 2017
Location
Belgium
Posts
6
I am trying to test my PLC program but I find the PLCSim of TIA portal insufficient: you can only run one sequence at a time.
I am trying to test a hardware setup of multiple pneumatic valves with redundant sensors.

Is there a tool that can connect with PLCSim that can simulate (unlimited) amount of hardware inputs (sensors, valves, ..) that are connected to the PLC?
 
I am trying to test my PLC program but I find the PLCSim of TIA portal insufficient: you can only run one sequence at a time.
I am trying to test a hardware setup of multiple pneumatic valves with redundant sensors.

Is there a tool that can connect with PLCSim that can simulate (unlimited) amount of hardware inputs (sensors, valves, ..) that are connected to the PLC?

If you purchase PLCSim Adv, then you get programmable access via an API. You can directly change the memory in runtime from a PC program that you'd have to write.

I think there is also a tool called SIMIT that allows you to simulate all your IO.
 
If you purchase PLCSim Adv, then you get programmable access via an API. You can directly change the memory in runtime from a PC program that you'd have to write.

The classic Plcsim had such Api from the beginning, and now you need to purchase the extra version for nearly 3k€ to get what you were able to do with the old version.

There are (internal) methods to write inputs and read outputs in standard TIA Plcsim, but they are not in any public Api and I haven't found out how to properly connect to a running Plcsim instance. This would be enough for me for 99% of the simulations I'm doing: connect to Plcsim, read outputs and write inputs.
 
From the 1st post it is not clear to me what exactly is to be achieved or what is the problem.

PLCSIM can only run one program, but you can have several PLCSIM instances and these can even run PLC programs the communicate with each other (to a limited degree).
 
PLCSIM can only run one program, but you can have several PLCSIM instances and these can even run PLC programs the communicate with each other (to a limited degree).

For instance in PLCSIM you can only active one sequence at a time. So If I want a valve to close on my PLC I can add a trigger (the valve relay output) to start the sequence. But I can only do this for one valve, I can not have multiple sequences active that can "close" multiple valves.
 
The company I worked for would spend a great deal of time designing test programs to run alongside or from another PLC to test functionality. At the end of the day it's not the most straightforward but is a possibility too.

This can either be done with Hardware or, as Jesper mentioned through two different instances of PLCSim... mind you that for this to be "easy" it is required that you map your inputs into a DB, so that you can then choose how to write to the DB and forego completely the requirement for Inputs or Outputs.

Have you considered this?
 
No but it is a good way to build a test bench.

I had hoped this would have been a standard feature in TIA portal where you could hook up virtual devices to the simulated PLC in order to propely test it. Group multiple sensors and define how they work together, tweak delays, add noise, disabled sensors so you could test the robustness of your PLC code.
 
IMO the way the sequence steps in PLCSIM works, seems to be impractical for large projects.
Even if you could simulate many sequences in parallel, to set it up would be a lot of work.

I write my simulation code directly in the program that I want to simulate.
Thus, it works with a real CPU as well as PLCSIM.
And it does not cost extra.
And the simulation code is automatically syncronised with the real PLC code.
And when you copy-paste real code, the simulation code follows.
etc....

Some colleagues of mine use SIMIT, but as far as I can tell, it is a huge job to maintain the code for SIMIT.
 
No but it is a good way to build a test bench.

I had hoped this would have been a standard feature in TIA portal where you could hook up virtual devices to the simulated PLC in order to propely test it. Group multiple sensors and define how they work together, tweak delays, add noise, disabled sensors so you could test the robustness of your PLC code.

What you describe seems to be exactly what SIMIT does. Although I found the configuration to take a bit of time. I believe SIMIT is available to download and will work on a limited range of addresses on the PLC, something like PIW256 to 512, so it's definitely worth a shot.

Me personally would go down the route of writing the simulation code myself as a lot of it can be adapted to different systems fairly easily.

Also, if there is something we can't really complain much is about the quality and even existence of PLCSim from Siemens. Other brands (looking at you Rockwell) aren't even close to what PLCSim lets you do.
 
Some colleagues of mine use SIMIT, but as far as I can tell, it is a huge job to maintain the code for SIMIT.

In my experience, a good simulation takes about as much time to generate from scratch and maintain as the code that controls it.
 
A work around could be to write all your inputs to a DB and use the DB in your program.

This way you can choose not to overwrite the DB with your inputs and simulate the values in a dedicated simulation block.
 
I write my simulation code directly in the program that I want to simulate.
Thus, it works with a real CPU as well as PLCSIM.
And it does not cost extra.
And the simulation code is automatically syncronised with the real PLC code.
And when you copy-paste real code, the simulation code follows.
etc....

I'm using that simulation-style occasionally, but you need to program to be compatible with such simulation.
Means: you can't use PIB/PIW/PID access, and also can't use DPRD_DAT for Profibus slaves.

Using the S7ProSim interface to Plcsim v5 for your simulation, you don't have to care about that. And you have a clean program without any simulation elements in it.
 
I'm using that simulation-style occasionally, but you need to program to be compatible with such simulation.
Means: you can't use PIB/PIW/PID access, and also can't use DPRD_DAT for Profibus slaves.

Using the S7ProSim interface to Plcsim v5 for your simulation, you don't have to care about that. And you have a clean program without any simulation elements in it.

I used to have a DB dedicated for Simulation control. Inside a GlobalEnable and then individual bits to control simulation of separate systems. I would then use these bits to control the mapping into separate DBs.

A GlobalEnable
JC false
CALL DPRD_DAT
CALL #MapInputs
false: NOP 0
 
Means: you can't use PIB/PIW/PID access, and also can't use DPRD_DAT for Profibus slaves.
Indeed. But I always only read with direct Peripherial access once to a DB from which I do the further program acces. So when simulating I simply bypass the peripherial access read part.

And you have a clean program without any simulation elements in it.
To be "clean" in this way is to me irrelevant. There has to be a simulation program somewhere, and in this way I have the real code and the simulation code in one place, syncronised, commented, backed up together etc.
 

Similar Topics

Hi I used to be able to launch PLCsim without any problem. Now it tells me " STEP 7 Professional Licence is required to simulate this PLC"...
Replies
15
Views
507
Hi, I want to use PLCSIM because the hardware I was working on has now been delivered to customer. Which option do I choose from this drop-down...
Replies
12
Views
351
hi everyone. i hope you guys are doing great. i am trying to built communication between aveva intouch hmi 2023 and tia portal v18. i dont have...
Replies
1
Views
530
Hi, My PLC hardware has been delivered to customer site - many thanks for the invaluable help on this forum! I was looking into see if it's...
Replies
12
Views
2,471
Hi Friends, I tried using TIA Portal v17 with S7 PLCSIM Advanced v4.0 but no luck. Has anyone here tried with success?
Replies
12
Views
10,067
Back
Top Bottom