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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...