12-09-2022 10:50 AM - edited 12-09-2022 10:53 AM
@nicos1712 wrote:
Thanks KC, I can actually control my pump now !
Last problem: I can't use the "double" addresses like "2 3" or "13 14" (see the Input register table or even in the Holding register table).
If I understood correctly, these data are floats.
Do you have an idea?
Yes, you need to make a multi register read. Specify the lower address as start address and 2 as number of registers to read, then pass the resulting array of 2 uint16 to a Typecast whose Type input is connected to a single precision floating constant. If he value looks weird try to add a Swap Bytes node in the input array before the Typecast.
12-09-2022 02:15 PM
Thank you Rolpha for your reply.
I have done the steps you specified, but it does not work...
I am attaching my VI and what I did for Write/Read Multiple Holding Register (go directly to the Page 4 tab, you will understand).
12-12-2022 10:34 AM
Still not clear for me that you can read one register at address 0.
No write just a simple read. What is the data read and what is the failure status ??
12-12-2022 02:21 PM
I succeeded to read the speed of the pump (see my VI in attachment).
However, how can I write the speed and thus change the speed of the pump?
Thank you in advance for your answer.
12-13-2022 02:23 AM
Hi,
To write a float (SGL in this case) you need to write two registers.
First you have to split up the SGL into two registers. (RolfK already explained this)
See attached VI to convert a SGL into two registers and back again to SGL.
I assume that the registers don;t need to be swapped. But you will see that if you write and read the speed.
Kees
12-16-2022 10:18 AM
Thanks a lot Kees, it works !