ylle Posted August 5, 2013 Report Posted August 5, 2013 Hi. My V350 is communicating with Modbus device. It`s quite simple becose almost all Modbus device registers are 16-bits, I have to worry about were to but comma in MI-s. But im confiused about two register. In Modbus device manual there are notes about those register and i dont know do I have to swap or just directy store those 16-bits registers into DW or ML; or make same mathematical operation... Registers are: Register number Modbus aaddress Parameter Received data scale Units Notes 40001 0 Total low 16 bits x1 Kg Total= (Total high x 65536)+Total low 40002 1 Total high 16 bits x1 Kg Im using Modbus R.H.R #3 function, reading from Slave aadress 0, reading vector length 2 into Master aadress MI0-MI1. So question is what to do next with those values in MI0-MI1? Regards, Ylle
Gabriel Franco Posted August 5, 2013 Report Posted August 5, 2013 You could use STRUCT FB to copy 2 MI to your desired DW
Emil Posted August 6, 2013 Report Posted August 6, 2013 It's even easy and right ot use Copy memory (VisiLogic > Vectorm menu > Use ofset).
Gabriel Franco Posted August 6, 2013 Report Posted August 6, 2013 Emil, I used Copy Mem in the past and got different results from STRUCT.
Emil Posted August 7, 2013 Report Posted August 7, 2013 Copy memory and Struct are different functions. You define the thhings in different way and, according to the definition, you can receive different results. Can you send mail ot support@unitronics.com with some example what exactly you did? In my understanding, Copy Memory needs ot be the simplest way ot acheive your goal. I want to see how you define both modulles and why you get different results.
Gabriel Franco Posted August 9, 2013 Report Posted August 9, 2013 Actually I don´t have any example with copy mem. I´ll try it again and let you know results and programs.
Gabriel Franco Posted August 11, 2013 Report Posted August 11, 2013 Emil, I tried again Copy Mem and got same results as STRUCT. Probably I made mistake before.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now