Jump to content

How to up date and date/time over modbus


Recommended Posts

I have a modbus device that I would like to update the time on periodically. The date format is not quite the same as the PLC and I can't work out a simple way of sending the correct values.

The data structure is detailed below (hopefully it will display correctly). All values are 16bit unsigned integers.

Address Words Description

49 1 WEEKDAY

50 3 YEAR, MONTH, DAY

53 3 HOUR, MINUTE, SECOND

My intention was to get the correct values into a vector of XI's and then write them to the modbus device in one operation. It looks simple enough but I can't get the correct YEAR, MONTH, DAY values into consecutive XI's in the correct order.

There maybe be a better way to do this but I can't figure it out with my limited experience. Hopefully someone here can help me out with this one.

Thanks in advance,

Justin

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.