TT_ZX Posted July 26, 2011 Report Share Posted July 26, 2011 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 Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted July 26, 2011 MVP 2022 Report Share Posted July 26, 2011 Try this- Joe T. Quote Link to comment Share on other sites More sharing options...
TT_ZX Posted July 27, 2011 Author Report Share Posted July 27, 2011 Thanks Joe. Net 2 was the key, SL4 in particular. I've already founds another use for SL4 before posting back. Cheers, Justin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.