DIO module simulation

Moderator: RevPiModIO

sofiene
Posts: 23
Joined: 24 Dec 2019, 15:36

DIO module simulation

Post 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.
User avatar
RevPiModIO
KUNBUS
Posts: 328
Joined: 20 Jan 2017, 08:44
Contact:

Re: DIO module simulation

Post by RevPiModIO »

At the moment not as fine as is should be :D

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 :D

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 :D
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!
sofiene
Posts: 23
Joined: 24 Dec 2019, 15:36

Re: DIO module simulation

Post by sofiene »

RevPiModIO wrote: 25 Jun 2020, 19:28 At the moment not as fine as is should be :D

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 :D

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 :D
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 ?
User avatar
RevPiModIO
KUNBUS
Posts: 328
Joined: 20 Jan 2017, 08:44
Contact:

Re: DIO module simulation

Post 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
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!
User avatar
RevPiModIO
KUNBUS
Posts: 328
Joined: 20 Jan 2017, 08:44
Contact:

Re: DIO module simulation

Post 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...
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!
Koffee-Junkee
Posts: 3
Joined: 23 Sep 2021, 17:56

Re: DIO module simulation

Post 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.
Marco_C_AM
Posts: 1
Joined: 01 Jul 2022, 11:05

Re: DIO module simulation

Post 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
User avatar
dvojtise
Posts: 5
Joined: 02 Feb 2024, 09:05

Re: DIO module simulation

Post 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
Didier Vojtisek - Research Engineer - Inria / IRISA / Université de Rennes
User avatar
RevPiModIO
KUNBUS
Posts: 328
Joined: 20 Jan 2017, 08:44
Contact:

Re: DIO module simulation

Post 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
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!
gypo
Posts: 1
Joined: 01 May 2024, 09:47

Re: DIO module simulation

Post 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?
Post Reply