News:

SMF - Just Installed!

Main Menu

Write outputs in the PLC

Started by emiliano, March 22, 2026, 10:11:48 PM

Previous topic - Next topic

emiliano

Hello,

I would like to know if it is possible to write directly to the outputs of the PLC (Siemens S7), whether they are real (Q0.0 to Q1.2) or virtual (Q3.0, Q3.1, ...).

It would be also desiderable to write virtuals inputs (I3.0, I3.1, I4.5,...).

EasyPLC_Master

That has not sense!

In Machines Simulator the PLC Outputs are read entities (due are wrtitten by the PLC) and the PLC Inputs are write entities (due are readed ny the PLC).

It makes no sense and is counterproductive for Machines Simulator to write the PLC outputs in a PLC simulation.

emiliano

Quote from: EasyPLC_Master on March 23, 2026, 11:58:14 AMThat has not sense!

In Machines Simulator the PLC Outputs are read entities (due are wrtitten by the PLC) and the PLC Inputs are write entities (due are readed ny the PLC).

It makes no sense and is counterproductive for Machines Simulator to write the PLC outputs in a PLC simulation.


The purpose for which I needed to write input and output —which I did in a Unity+PLC communication script— is to work with digital twins, where there is synchronization between the real system and the virtual twin.
The system could operate in two modes, using a single P1 program (which reads virtual inputs and writes virtual outputs) on the PLC:
- Simulation mode: the P1 program running on the PLC controls the virtual twin (the virtual twin's inputs—sensors and buttons—are inputs to the P1 program; the virtual outputs read from the PLC control the virtual twin's elements).
- synchronization mode: the same P1 program running on the PLC simultaneously controls both the virtual twin and the real system (in this mode, Unity had to read the physical inputs from the PLC and write them to the virtual inputs; and likewise, read the virtual outputs generated by P1, write them to the physical outputs, and act on the elements of the virtual twin).