Hi Peter,

Well, if you want to use PLC4X to communicate with the real or the simulated 
PLC in order to execute various test-scenarios: then probably PLC4X is what 
you're looking for.

If you want to extract the PLC program from one PLC and write that to a 
simulator, then unfortunately PLC4X doesn't have that focus and therefore 
doesn't support this.

The programming part of automation engineering is what every PLC vendor 
implements separately. Sometimes even one vendor has multiple ways of doing 
that for their different products.

However, PLC4X does have the parts that you probably need to implement such a 
feature, however it will certainly require reverse engineering for almost every 
type of PLC.

I had been thinking about starting to work on something like what you describe. 
However, my idea would have been to simulate just enough of a PLC for the 
engineering tool to accept it and to have the Engineering tool deploy the new 
program to that instead of a real PLC. This component would then pass the 
program to a CI/CD pipeline, just as you describe it. However, I knew this 
would be a lot of work and considering how well the industry accepted my offers 
in the past, I decided that I won't do this, as it's not worth it. They haven't 
even started thinking of concepts like continuous-integration or 
continuous-delivery or even testing. 

Chris



-----Original Message-----
From: Peter Saxton <pe...@petersaxton.uk> 
Sent: Dienstag, 3. Mai 2022 09:35
To: dev@plc4x.apache.org
Subject: Scope of using PLC4x as simulated driver for PLC projects

Hi everyone.

First post here so apologies if my terminology is a bit off, I'm from a web 
software background.

If I want to write behavior tests for a PLC project that already exists, is 
PLC4x the right tool for that job or would there be something better? 

Ideally I would be able to export a whole PLC project from a machine. Start 
that exported project in a soft/simulated PLC environment and run a suite of 
tests against the PLC logic. Ideally at no point would I be reliant on having 
the correct hardware.

Reading through the PLC4x pages I found the section on "Testing (or using PLC4X 
without a PLC)". As I understand this this is for testing software outside the 
PLC but simulating a PLC. I would like to go the other way round and test a PLC 
project by simulating the outside world. I also looked at the section on the 
simulated protocol, but again I think this is for simulating values for a plc4x 
client.

Essentially we'd like to write a test saying "when input 1 & 2 are on the 
output A is live", and check that the PLC code was going to do this.

I'm interested in testing against Siemens PLC projects, however for getting 
started I would happily run a proof of concept on something like OpenPLC if 
that was easier without hardware.

Cheers, Peter

Reply via email to