thiagoralves Show full post »
hjbleier
v3 looks amazing so far, good work!!!! Is there any plan to allow v3 to get the system time so time of day functions can be done? I have been using codesys on the raspberry pi and opto22 groov for hmi. I am stuck using codesys for the ability to do time of day functions. I got a project that I would love to use openplc on but it would be the master modbus device so it would need to be able to set the occupied register in all of the slave devices. Is there any chance that it will be added to v3? that would be awesome!!! 😁
Quote 0 0
hjbleier
LeissKG wrote:

That may be not quite right. I seem to remember to have seen
digital I/O modules in a catalog page that had pins that
could be individually switched between input and output.


Barix has a modbus rtu device that can do this. The Barix X8, it has 8 io point they can be onewire, digital in or digital out. The onewire is detected on power up, digital in or digital out is set by using a modbus register. It is a very cheap device but I wouldn't recommend using it for anything that is important. It doesn't have any optical isolation and it barely has enough current on the digital out mode to drive most pilot relays (it's meant to drive a couple of very small leds). I keep one around just for testing things when I am proving out a sequence of operation. But I agree with the direction openplc is heading I don't see this being a item that is need there are plenty of other things to work on and it would be hard to implement and I think it would confuse most people if anything.
Quote 0 0
thiagoralves
hjbleier wrote:
v3 looks amazing so far, good work!!!! Is there any plan to allow v3 to get the system time so time of day functions can be done? I have been using codesys on the raspberry pi and opto22 groov for hmi. I am stuck using codesys for the ability to do time of day functions. I got a project that I would love to use openplc on but it would be the master modbus device so it would need to be able to set the occupied register in all of the slave devices. Is there any chance that it will be added to v3? that would be awesome!!! ðŸ˜

I'll work on that. It might not be available on this first beta version of OpenPLC v3, but maybe on future releases. In the mean time, you could try to do an experiment. OpenPLC should already support datetime operations at least. The conversion function UDINT_TO_DT will convert an unsigned double integer (UDINT) variable into a Date Time (DT) variable. The conversion works by summing the number of seconds stored in the UDINT variable with the Unix Epoch date (January 1st, 1970 at 00:00:00). Therefore, if you can find a way to keep writing the Unix Epoch time (number of seconds since 1970) to one of OpenPLC's Modbus registers, like %MD0 for example, you can then get this value and convert it to the current date using the UDINT_TO_DT function.
Quote 0 0
hjbleier

I'll work on that. It might not be available on this first beta version of OpenPLC v3, but maybe on future releases. In the mean time, you could try to do an experiment. OpenPLC should already support datetime operations at least. The conversion function UDINT_TO_DT will convert an unsigned double integer (UDINT) variable into a Date Time (DT) variable. The conversion works by summing the number of seconds stored in the UDINT variable with the Unix Epoch date (January 1st, 1970 at 00:00:00). Therefore, if you can find a way to keep writing the Unix Epoch time (number of seconds since 1970) to one of OpenPLC's Modbus registers, like %MD0 for example, you can then get this value and convert it to the current date using the UDINT_TO_DT function.


That sounds like a good fix for now, I will setup a extra raspberrypi this weekend and give that a try. That sounds like it should work thank you so much for the idea my friend 😀 keep up the amazing work!
Quote 0 0
thiagoralves
OpenPLC v3 beta 1 was released today! Check it out:  https://openplc.discussion.community/post/openplc-version-3-beta-1-released-9769268?pid=1304535566
Quote 0 0