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
Setting inputMode, inputDebounce etc. from software
Re: Setting inputMode, inputDebounce etc. from software
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
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!
Re: Setting inputMode, inputDebounce etc. from software
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
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