For me I have Mervis Modbus client wich write registers in my C program modbus thread.
Then I have an other thread wich take care of changed values and publish on a topic to the mosquitto broker.
I have an other thread wich make some stuff on values, like a subscribed return value wich update modbus register before reply to modbus client.
@Giamba The order of sending the commands is not defined. Modbus defines input (readonly) and holding(readwirte) registers for this purposes. So you should use two registers, one for writing from Mervis to your application, and read the result of the computation of your application from a different register.
@xbastek To us it seems like the most likely explanation is that the timezone settings in IDE have been changed to users local time. The crystal used within the RTC is of quite high precision, and the time drift we have observed in testing has been on the order of one second in several months. In addition, the particular nature of the time drift (that is, in hours) would point this way as well.
The Mervis IDE as well as Neuron itself runs on UTC, but this is possible to change in the PLC setup, which will naturally skew the clock. Would it be possible to check that the customer's PLC time corresponds to UTC? If not we would recommend to set it back to UTC and see if the issues persist.
@Giamba I see that you are posting C source. I have found python in /usr/bin but I do not find any gcc or make anywhere. There is also no java installed. I am not an RPi user (I use nV embedded systems) so am not familiar with Jessie ... do I need to install these programming runtimes and environments? Do you know what size SD card I need to get to this environment?
Btw, i was trying to implement the same function but i'm getting a hard time understanding how the ST language works. Is the any ST language documentation besides the one on help?
For example i'm having a issue (probably related to includes) where i'm trying to use Lib.Core.V1_0.B99_PCTimeNode.Wday and i get the message the variable 'Wday' can't be accessed from the current scope.