Page 1 of 2
DIO module simulation
Posted: 25 Jun 2020, 13:14
by sofiene
is there any way to simulate the DIO module inputs and outputs via a graphical interface by using buttons and indicators
i need to test my code on my computer before setting it on RevPi.
Re: DIO module simulation
Posted: 25 Jun 2020, 19:28
by RevPiModIO
At the moment not as fine as is should be
You can "sudo apt-get install revpipyload" on your Revolutoin Pi and set the XML-RPC service on. At the new version just run "sudo revpipyload_secure_installation" and say YES to "allow from local network" and YES to "setup ACL". Than you can install RevPiPyControl on your network computer and connect to your revpi.
With this Program you can watch die IOs and switch outputs.
To simulate Inputs, you have to stop the piBridge bei "piTest -S". Than run your program with RevPiPyLoad (upload it via RevPiPyControl). If the program is running, you can start python3 on your RevPi and import revpimodio2 and type rpi=revpimodio2.RevPiModIO(autorefresh=True, simulator=True). Now you can set Inputs to values with rpi.io.InputName.value = True, which your control program will see and to the work
You will have the logs in RevPiPycontrol and a "PLC Developer" Mode to easily upload your python files, check it out in the "PLC" menu.
https://revpimodio.org/revpipyplc/
The next version will have an simulator mode, to set Inputs with the GUI
![Überglücklich :D](./images/smilies/icon_e_biggrin.gif)
Re: DIO module simulation
Posted: 26 Jun 2020, 11:43
by sofiene
RevPiModIO wrote: ↑25 Jun 2020, 19:28
At the moment not as fine as is should be
You can "sudo apt-get install revpipyload" on your Revolutoin Pi and set the XML-RPC service on. At the new version just run "sudo revpipyload_secure_installation" and say YES to "allow from local network" and YES to "setup ACL". Than you can install RevPiPyControl on your network computer and connect to your revpi.
With this Program you can watch die IOs and switch outputs.
To simulate Inputs, you have to stop the piBridge bei "piTest -S". Than run your program with RevPiPyLoad (upload it via RevPiPyControl). If the program is running, you can start python3 on your RevPi and import revpimodio2 and type rpi=revpimodio2.RevPiModIO(autorefresh=True, simulator=True). Now you can set Inputs to values with rpi.io.InputName.value = True, which your control program will see and to the work
You will have the logs in RevPiPycontrol and a "PLC Developer" Mode to easily upload your python files, check it out in the "PLC" menu.
https://revpimodio.org/revpipyplc/
The next version will have an simulator mode, to set Inputs with the GUI
thanks for the quick response
but what i need is to simulate revpimodio from a computer when i can't access Kunbus core3 Device using configrsc and procimg files like so :
Code: Select all
self.revpi = revpimodio2.RevPiModIO(autorefresh=True, direct_output=True, configrsc=root + "\opt\KUNBUS\_config.rsc", procimg=root + "\dev\piControl0")
so what i need is something that basically modifies the procimg file content when i click a button in a user interface.
is that possible ?
Re: DIO module simulation
Posted: 03 Jul 2020, 07:50
by RevPiModIO
Oh, I see!
This function will be added in RevPiPyControl. In the next release, you can select a piCtory file and use the "PLC watch mode".
The system will create a "process image" on your local machine, which you can use with RevPiModIO(procimg="filename", configrsc="selected_pictory_file". In the "PLC watch mode" you will be able to set the INPUTS of your process image, so your ModIO software will control the outputs.
https://revpimodio.org/en/revpipyplc-2/
Regards, Sven
Re: DIO module simulation
Posted: 08 Jul 2020, 17:58
by RevPiModIO
Hi sofiene!
Do you like to beta test the new Software with the simulator function? There are some things to to, but I think I could release a beta next week...
Re: DIO module simulation
Posted: 23 Nov 2021, 18:41
by Koffee-Junkee
I know, this Discussion in the Thread is a long time ago, but I want to reset the request about the simulation.
I have also the scenario, that I want to simulate the general program on my development (Windows) computer and later send it to the RevPi.
The genral value and state of the IOs is un intresting.
In the revpimodio2 is a flag for simulation, but the driver doesn not start
RuntimeError: can not access known pictory configurations at /etc/revpi/config.rsc, /opt/KUNBUS/config.rsc - use 'configrsc' parameter so specify location
Also it there the description, that the simulator flag switches the in- and outputs which makes for me no sense.
It would be nice, whe I get some information about this topic.
Thanks in advance.
Re: DIO module simulation
Posted: 05 Sep 2022, 15:00
by Marco_C_AM
Hello,
I am also very interested in the subject, in the meantime a guide has been developed to simulate a code before loading it on the PLC?
Thanks
Marco
Re: DIO module simulation
Posted: 22 Feb 2024, 17:48
by dvojtise
Hi
is there any news about this simulator feature and how to use it ?
(requirement on the host PC simulating the RevPi, ...)
thanks
Re: DIO module simulation
Posted: 29 Feb 2024, 08:22
by RevPiModIO
With the "RevPi Commander" an existing config.rsc file can be used to start a simulator. You install the program on your developer PC and call File -> RevPi Simulator. There you select a created config.rsc file and start the simulation. The window also shows the required additional parameters for the RevPiModIO(configrsc=..., procimg=...) call so that it uses the simulation files. Via the PLC monitor, outputs can then be set as a simulation in the RevPi Commander.
https://revpimodio.org/quellen/revpicommander/
Of course, the same technique can also be used to write a complex simulation with RevPiModIO. For this purpose, a config.rsc, a procimg and the parameter simulation=True are also passed to the RevPiModIO call. Both config.rsc and the process image can be downloaded via the RevPi Commander.
Sven
Re: DIO module simulation
Posted: 01 May 2024, 10:05
by gypo
Hi Sven, I'm facing a similar situation. I haven't acquired RevPi modules yet, and I'm lacking the "config.rsc" file, but I'm eager to begin developing my software. Can I utilize Pictory on my PC to generate the "config.rsc"? Alternatively, do you have any documentation available that outlines how to craft my own config file?