PLC program (Siemens TIA V15) with Simulation Software(Visual Components)

Hi,

I have done a simple test with simulation software for PLC program test (using virtual PLC i.e. PLCSim). Here is the setup.

All the necessary files for this test is attached here as well (download from attachment). You should go to the following link to see the total setup instruction video.

Regards,

S

utility.zip (2.78 MB)

1 Like

Nice tutorial!
Have you tried measuring what kind of end-to-end latency (response time) you can get with this communication setup?
VC <-> KepServer should be pretty fast, but how fast is the communication through NetToPLCSim and response time of PLCSim itself.

@TSy, no i didn’t test communication speed in between NetToPLCSim and PLCSim, with my first 2 tests it seems pretty fast (only 5-10 variables). I don’t know the situation when there might be 300-400 variables communicating with KepServer. It would be interesting to see the latency in between .

KepServer < – > NetToPLCSim

 

 

Here is Part-2 of the communication test. This 2nd example will also give the user idea of using Technology Object > Motion Control library of Siemens TIA Portal V15. SCL code for Motion Control attached in ZIP folder.

This is how the main function of this program looks like.

 

 

 

 

MotionControlSimulationSampleCode.zip (4 KB)

Here is part-5 (part-3 & part-4 will come within a week) of the series. It’s a rich example of how to prepare simulation components behavior with python script & then structured text PLC code example. You will find all related component *Layout *Description *PLC code from following link:

https://blog-gallopautomation.com/plc-program-test-with-virtual-softwarevisual-components-part-5/

 

 

Here is part-3 of the series. It’s a rich example of how to prepare simulation components behavior with python script & then structured text PLC code example. You will find all related component *Layout *Description *PLC code from following link:

https://blog-gallopautomation.com/plc-program-test-with-virtual-softwarevisual-components_part-3/

Here is part-4 of the series. It’s a rich example of how to prepare simulation components behavior with python script & PLC code example with Structured Text(ST). You will find all related component *Layout *Description *PLC code from following link:

https://blog-gallopautomation.com/plc-program-test-with-virtual-softwarevisual-components_part-4/

Hi , my simulation with hunderds of robots, jigs , lamps , buttons is very slow . I link vc with kepserver . So , is there any way to optimize?

Are you using Siemens PLC for your use case? If Yes then do you have Siemens PLC Sim? with newest Visual Components version you don’t need to use Kepware as middleware anymore, you can directly connect to Siemens PLC Sim.

Do you have lots of python While loops running inside the components in Simulation. If yes then try to reduce them, only use them when utmost necessary.

Are you using Visual Components Library components (e.g. Works Library) in this Virtual PLC test layout of yours? If YES then try to make small efficient python scripts for each component inside simulation. You can do almost anything with your own python scripts inside the components instead of using VC Works Library. These works library components have thousands of lines of python codes inside and for a software which is single thread this is too much workload. I have simulates 20 machines, 7 robots with each machine has its own very simple python scripts. These modular machines I can re-use later as well. There were in total over 200 IO signal in between – robots <—> machines.

Number of signals can be no issue if you can prepare your layout wisely. One key point is also to use lightweight CAD files. Simplify your CAD files to the bare minimum geometry, texture you need.

remember to NOT delete your last 10 recent backup files of your layout. If you do something awkward the layout which you been working on for several weeks might get corrupt and you can’t recover it anymore.

Thanks! I have found out why , because of sensors. Only 10+ , they made the simulation slow. And I deleted all , the simulation backed to normal.

1 Like