This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

mb:setregisters() and LM values
#1
Hi all,

I think I have figured out the method to read a register and write its value to an LM object

-------------------------------------------------- ---------------------------
result_5, result_6, result_7, result_8 = mb:readregisters(3203, 4)

if result_5 then
  value5 = bit.lshift(result_5, 48) + bit.lshift(result_6, 32) + bit.lshift(result_7, 16) + result_8
  ../..
end
-------------------------------------------------- ---------------------------

But could you explain to me how to do the opposite with the method "mbConfusedetregisters(register,value)"
from values of LM objects like Uint8, Float32 and Int64?

Thank you in advance for your assistance and have a good week.
Reply


Messages In This Thread
mb:setregisters() and LM values - by SigmaTec - 08.08.2022, 05:55

Forum Jump: