Single-Time Write via Modbus
Hi,
I need to send a calibration value to different probes, e.g. PH and EC. Setting a register to 1 will activate the calibration function. However, I will only need to send this value once (when calibration should be initiated, not repeatedly).
I am defining an Output_Word variable in Pictory, e.g. OUTPUT_ph_tmp_comp, and assign the following WRITE_SINGLE_REGISTER action for the corresponding slave.
Since there is an action interval item in the list of attributes I am wondering how often revPI will send this command out. Even if the variable is set back to 0. Is revPI checking if a change in the register happened and only sends the update command once a change was observed or is it constantly sending the content of the register according to the action interval, no matter what?
I am asking since some other write commands might overwrite EEPROM on a probe and this storage might break after too many write operations. If revPI would continue to send a 0 afterwards and the probe would overwrite the storage every 1000ms, it might break after a while.
Thanks!
Nils
I need to send a calibration value to different probes, e.g. PH and EC. Setting a register to 1 will activate the calibration function. However, I will only need to send this value once (when calibration should be initiated, not repeatedly).
I am defining an Output_Word variable in Pictory, e.g. OUTPUT_ph_tmp_comp, and assign the following WRITE_SINGLE_REGISTER action for the corresponding slave.
Since there is an action interval item in the list of attributes I am wondering how often revPI will send this command out. Even if the variable is set back to 0. Is revPI checking if a change in the register happened and only sends the update command once a change was observed or is it constantly sending the content of the register according to the action interval, no matter what?
I am asking since some other write commands might overwrite EEPROM on a probe and this storage might break after too many write operations. If revPI would continue to send a 0 afterwards and the probe would overwrite the storage every 1000ms, it might break after a while.
Thanks!
Nils
Re: Single-Time Write via Modbus
I think I have confirmed that revPI keeps on sending the Output variable with the given action interval.
Now my questions is, how do I send a ModBus command for calibration only once?
The problem with the process image is that I don´t have direct control over the interface. So how can I send out just one command alone?
Now my questions is, how do I send a ModBus command for calibration only once?
The problem with the process image is that I don´t have direct control over the interface. So how can I send out just one command alone?
Re: Single-Time Write via Modbus
Hi Niels,
For use cases like this the process image is indeed not the best fit. I would suggest to implement it without the virtual modbus device and directly use modbus with a library (like pymodbus for python).
Nicolai
For use cases like this the process image is indeed not the best fit. I would suggest to implement it without the virtual modbus device and directly use modbus with a library (like pymodbus for python).
Nicolai
Re: Single-Time Write via Modbus
Hi Nicolai,
Thanks for your quick reply.
Since there can only be one Modbus Master at a time, would it be possible to use such a script in co-existence with the revPI Modbus Master running?
E.g. the revPI Modbus Master service would poll the sensor registers at defined intervalls from Pictory and the pymodbus script would send the calibration command? Or is it possible to inject commands with pymodbus in a already initiated communication channel controlled by the Modbus master service?
If co-existence is not possible, I could think of a dirty hack that would first disable the Modbus Master service via the script, initiate its own communication and send the calibration command, and then restart the ModBus Master service. But I think that would be really ugly for a production environment the revPI is designed for...
I would suggest to implement a functionality into the Pictory service that allows to send a one-time request that could for example be used for calibration (or to set other attributes like response-delay on a sensor). Otherwise I will need to disconnect the sensor from the revPI setup every single time I want to perform a calibration. With many sensors and a calibration to be performed once in a month, this is quite a burden. Therefore, I would like to implement all features of the sensor via the GUI to make it user friendly.
Cheers,
Nils
Thanks for your quick reply.
Since there can only be one Modbus Master at a time, would it be possible to use such a script in co-existence with the revPI Modbus Master running?
E.g. the revPI Modbus Master service would poll the sensor registers at defined intervalls from Pictory and the pymodbus script would send the calibration command? Or is it possible to inject commands with pymodbus in a already initiated communication channel controlled by the Modbus master service?
If co-existence is not possible, I could think of a dirty hack that would first disable the Modbus Master service via the script, initiate its own communication and send the calibration command, and then restart the ModBus Master service. But I think that would be really ugly for a production environment the revPI is designed for...
I would suggest to implement a functionality into the Pictory service that allows to send a one-time request that could for example be used for calibration (or to set other attributes like response-delay on a sensor). Otherwise I will need to disconnect the sensor from the revPI setup every single time I want to perform a calibration. With many sensors and a calibration to be performed once in a month, this is quite a burden. Therefore, I would like to implement all features of the sensor via the GUI to make it user friendly.
Cheers,
Nils
Re: Single-Time Write via Modbus
Hi Niels,
it should be possible to have multiple modbus master instances (at least for TCP). More details you can have a look at this article: https://www.rtautomation.com/rtas-blog/ ... e-masters/
Nicolai
it should be possible to have multiple modbus master instances (at least for TCP). More details you can have a look at this article: https://www.rtautomation.com/rtas-blog/ ... e-masters/
Nicolai
Re: Single-Time Write via Modbus
Hi Nicolai,
I tried and it leads to many errors during the communication. There can only be one Modbus RTU master on a serial bus at a time.
Therefore, the problem remains. I will have to disable Modbus service / manually send RTU command / enable Modbus service which is not very elegant and might lead to other problems. It would be nice to have the one-time functionality via Pictory/revPI in the future.
Cheers,
Nils
I tried and it leads to many errors during the communication. There can only be one Modbus RTU master on a serial bus at a time.
Therefore, the problem remains. I will have to disable Modbus service / manually send RTU command / enable Modbus service which is not very elegant and might lead to other problems. It would be nice to have the one-time functionality via Pictory/revPI in the future.
Cheers,
Nils
Re: Single-Time Write via Modbus
Hi Nils,
Yes, it is only possible with TCP (as I mentioned above). I didn't know that you are using RTU. With RTU your solution makes sense and might be the only solution without a custom implementation at the moment.
I'll add your feedback to our backlog, but can't promise any date yet.
Nicolai
Yes, it is only possible with TCP (as I mentioned above). I didn't know that you are using RTU. With RTU your solution makes sense and might be the only solution without a custom implementation at the moment.
I'll add your feedback to our backlog, but can't promise any date yet.
Nicolai
Re: Single-Time Write via Modbus
Single-Time write on startup may be useful for many applications, e.g. to integrate the download of config parameters and settings into the master application on the RevPi. This can help to avoid configuration of slave devices with vendor specific tools, e.g. when replacing components in the field.
Best Regards
Thorsten
Best Regards
Thorsten
--
https://www.mechapro.de - Wir bewegen Ihre Ideen!
https://www.mechapro.de - Wir bewegen Ihre Ideen!
Re: Single-Time Write via Modbus
Hi Nicolai,
Have you considered implementing such a single-time write feature for the new release?
Cheers,
Nils
Have you considered implementing such a single-time write feature for the new release?
Cheers,
Nils
Re: Single-Time Write via Modbus
+1 for single-time modbus write function