LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Weight measurement using load cell and hx711

Solved!
Go to solution

Hello Daikataro,

I read all this thread and I am quite frustrated because I know that I have the solution in front of me but still I do not know how to make it working...
I understand that if I go with the second way you wrote I need to add a custom function on LIFA_Base script. I tried to understand how it works but, honestly, I do not get it perfectly.

So I would like to ask you for show me the way. Not giving me the answer, but please only let me know how could I read a call the function from a VI, for example.

Anyway, every suggestion or clue will be very welcome.

 

0 Kudos
Message 11 of 15
(4,572 Views)

I would suggest starting a new thread, and explaining clearly what are you trying to accomplish, and what you got so far. Also take a look at this example.

 

https://forums.ni.com/t5/LabVIEW-Interface-for-Arduino/LIFA-Ultrasonic-Distance-Sensor/ta-p/3514004

 

It's for proximity sensors, but the premise is the same, adding a custom function to the LIFA firmware, as well as the associated library for LabVIEW. Needless to say, it requires a solid understanding of both.

0 Kudos
Message 12 of 15
(4,564 Views)

Hello Daikataro,

Many thanks for for answer and for the link as well.

With a bit of patience I have been able to modify the existing library proposed by Nathan_B and now it is working for a load cell attached to a HX711.

I would be very happy if you can have a look and tell me how can I improve it.

https://forums.ni.com/t5/LabVIEW-Interface-for-Arduino/hx711-load-cell-arduino-using-LIFA/m-p/369804...

Thanks a lot,

Javier  

0 Kudos
Message 13 of 15
(4,552 Views)

Could it be possible to show these procedures and steps how could we model in LabVIEW with a diagram? According to the control cycle of Arduino send and received from the hx711 we should you for the cycle in LabView? Kind regards

0 Kudos
Message 14 of 15
(3,893 Views)

I found a new solution to this problem that I have not seen before. I wrote an Arduino code that waits to sample the load cell until a serial write is performed from LabVIEW ("ON"), then the Arduino code start sampling the load cell and printing the measured values into the serial monitor. After the Labview writes the "ON" string, it then reads the serial monitor using a VISA read to obtain the load cell values. This method was difficult to write but easy to implement if you have the code, which I will attach.

 

Just upload the Arduino code first to the board with the standard HX711 configuration w/ load cell or what ever sensor that uses a strain gauge (I used it for torque). Make sure to edit the calibration constant and zero offset for the load cell in the Arduino code (or set to "1" and "0" respectively it to pull raw data in). Then run the LabVIEW VI which will write the "ON" string to start sampling and reading the load cell data. Once you are finished make sure to toggle the STOP button, which writes an "OFF" string, to stop sampling and reading when you are done. The one thing I found was, you want to make sure to stop the sampling on the Arduino board otherwise the serial monitor will fill with old data, and on the next read cycle Labview will read old data until it catches up with the difference in sampling rates (Arduino = 80Hz, Labview = while loop rate).

Paul_MAE_0-1609652143878.png

 

This method seems to be the easiest because it uses the already well developed HX711 libraries devoloped in Arduino to sample the load cell instead of rewriting all of it in Labview.

 

Notes: Make sure to have the HX711 and QueueHX711 libraries in your Arduino Library.

0 Kudos
Message 15 of 15
(3,172 Views)