Setting inputMode, inputDebounce etc. from software

Topics about the Software of Revolution Pi
Post Reply
smilykoch
Posts: 4
Joined: 29 Nov 2017, 13:00
Answers: 0

Setting inputMode, inputDebounce etc. from software

Post by smilykoch »

Hi RevPi team.

Is it in any way possible to set the InputMode of a DI/DIO module through software, in this case C?

I would have loved to be able to just write to InputMode_x, and see the module changing config, but this doesn't seem to be the case?
Is the ONLY way to change those configs, through the config.rsc?

Best regards,
Mathias
User avatar
volker
Posts: 1046
Joined: 09 Nov 2016, 15:41
Answers: 1

Re: Setting inputMode, inputDebounce etc. from software

Post by volker »

HI,
the values marked as "M" in the Value editor in PiCtory are kept in memory and can be read and written at run time like any value in the process image. Bu tjust like DIO Inputs writing to these adresses is worth nearly nothing because they will be overwritten by the system again (with DIO inputs PiControl would overwrite them with IO data): During restart of PiControl the config.rsc is read an values are set according the config values of this file. So If you write to the process image a value and restart PiControl you will overwrite your writenn values. For a permanent change you would ned to read the JSON file (this is quite easy using Python JSON object library) and write back the file with your chaned values. This is the only way because changin the value in the process image will have no effect until a restart of the PiControl driver. Only during this restart phase the DIO configuration is sent to the DIO module.
Hope this makes sense.
Volker
Unser RevPi Motto: Don't just claim it - make it!
smilykoch
Posts: 4
Joined: 29 Nov 2017, 13:00
Answers: 0

Re: Setting inputMode, inputDebounce etc. from software

Post by smilykoch »

Hi.

Thank you for your reply.

This is exactly the conclusion i reached after reading through the source code of piControl.

Unfortunately this means i will have to do a bit more JSON manipulation through my C software than anticipated. But so be it :)

Thank you!

Best regards,
Mathias
Post Reply