Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS485 pump control via Labview

Solved!
Go to solution

@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.

 

Modbus Read Float.png

Rolf Kalbermatter
My Blog
0 Kudos
Message 21 of 26
(678 Views)

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).

0 Kudos
Message 22 of 26
(659 Views)

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 ??

0 Kudos
Message 23 of 26
(645 Views)

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.

0 Kudos
Message 24 of 26
(634 Views)

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

0 Kudos
Message 25 of 26
(607 Views)

Thanks a lot Kees, it works !

 

 

0 Kudos
Message 26 of 26
(569 Views)