LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus communication with a load cell

Solved!
Go to solution

Hello..!

I'm a new user of  LV and I try to communicate with a load cell by RS232 modbus.

After installed NI Modbus Library I created a master VI with labview 8.6 using these library, and I can obtain a communication with load cell  , these value are added into 1 register U32Bit, and it's  okay, if  I press a load cell I can see the values go on.( from 0 to 65535) . Now I want to show  on front panel  the value in KG , as decimal point,, for a right interpretation of value  for my customer, so I added a block array to unbundle than I convert a value with I32Bit ( -32768 to 32768 ) with an indicator, but I can't see any values..

I suppose I doing something of  wrong ( conversion ), I read some KB, but I can't see a suitable solution..

Can someone give me  a link or information to show me an example to convert this value..?

Thanks  in advance for any helps..

 

Configuration of  MAster VI:

 

 Read holding register

Starting address 2012 ( query for obtain net value from the load cell)

quantity 1

 

Slave address: 1

RTU

9600

Com 3

parity none 

 

 

 

 

 

0 Kudos
Message 1 of 8
(3,496 Views)
Please attach your code.
------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Message 2 of 8
(3,488 Views)

Hello Jyang,

Thanks for your reply..

Here below I posted my block diagram of LV, you can see a first approch to acquire data from a load cell by modbus RS232.

My target is acquire the compression and tension forces and show in the indicator on the  front panel..

If you have any advices for doing better, please inform me..

Thanks again for your helps...

 

Dave

 

 

0 Kudos
Message 3 of 8
(3,475 Views)
Where are you seeing the returned values
when you run this?
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 4 of 8
(3,470 Views)
Try using 2011 as your starting address.  While Modbus registers start at one (such as 40001), in LabVIEW they begin at 0.  So 42012 (or 402012) would be addressed as 2011 in LV.
Message 5 of 8
(3,459 Views)

Good Morning MR. Monroe

Thanks for your message..

These values I can see from register output, that I tried to convert 1D array to Double for a clear interpretation of  the  values ( engineering units).. I tried  also to use a starting address 2011, but  If  I put this, don't show  anything...

my problem is  a right conversion to show a positive and  negative values on a numeric indicator..

It's my first time  using modbus protocol, so you can see some mistakes in my LV code..

If you have any advice to give me i'm very happy..

 

Have a nice day

 

Dave

 

 

 

0 Kudos
Message 6 of 8
(3,438 Views)
Solution
Accepted by topic author Julio80
Can you post some examples of the bytes that you are receiving from the Modbus read and what you expect those values to be?  It is probably just a matter of the right typecasting, or endianism of the number, or some scaling operation that needs to be done.
Message 7 of 8
(3,422 Views)

Hello Ravens,

I tried to use your good advices and  finally I can communicate correctly with my trasducers showing  on front panel the right value ( Kg). Has been a  problem of conversion from output of register ( U16Bit  as 0-65535 )  to I16bit ( -32765 to 32765).

Thanks  very much for  your help, and I hope to chat again for new challenge...

Have a nice WE

 

Julio

Message 8 of 8
(3,400 Views)