06-01-2024 09:30 AM
I really need help in this. I'm working on a project using stepper and loadcell. The scheme is stepper give some torque within a rod to a porous disk, and then the loadcell show the weight that stepper give to porous disk.
So I need to control the stepper speed and steps, and show the loadcell value. I'm using Arduino for the actuator (I attached the vi and arduino program). But it keep showing this
I'm using this schematic for stepper and loadcell (I only use one arduino):
I hope you can help me with this problem. I already check the baudrate (115200)
Solved! Go to Solution.
06-03-2024 09:25 AM
A potential problem could be that Arduino communicates over the same port as you are trying to use.
Only one application can open a com port at the same time.
06-08-2024 05:40 AM
oh, I see. But whenever I'm trying to run the labview it can't read the load cell. do have any example how to run the loadcell? especially using LINX?
06-10-2024 04:51 AM
If I understand LINX correctly, it should simply be an interface between the HX711's serial port, the Arduino's serial ports, and your PC's serial port.
Can you rule out a hardware problem?
I'd first make this: Arduino with Load Cell and HX711 Amplifier (Digital Scale) | Random Nerd Tutorials work, purely on the Arduino. Then you know for sure the HW is working...
Next (or first) I'd try to make LINX work with a serial loopback work (connect RX and TX) on the Arrduino. Everything you send to the Arduino's serial port should be read back.
When both are working, you should be able to replace the loopback with the loadcell, and making it work should be a matter of correctly configuring the settings.
06-10-2024 08:23 PM
I recommend that you search the Web for "Control Stepper Motor with Arduino". You will probably find multiple sites that describe using NEMA 17 motors and the A4988 Driver chip. Some also talk about using a LoadCell like the HX711. With the A4988, pretty much all you need is the ability to create several bits of Digital Out lines to set stepper properties, one DO bit to set direction of rotation (CW/CCW), and one DO bit to generate a Pulse train that makes the motor go one step per pulse. I'm doing this with an NI USB-DAQ device, not using an Arduino, and not using any Load Cell.
You can also search for "Stepper Motor and HX711" and find multiple "hits". Maybe you can find some answers there ...
Bob Schor
06-11-2024 06:51 AM
I have tried loadcell with purely arduino in IDE and yes it worked. I also tried using LIFA with HX711 library from https://forums.ni.com/t5/LabVIEW-Interface-for-Arduino/hx711-load-cell-arduino-using-LIFA/m-p/369900...
and it works, but I'm confused how to connect the loadcell and the stepper at the same time. I know this code probably wrong, can you tell me how to combine these two (the stepper and loadcell?) especially how to use only one lifa close. Whenever I want to use only one lifa close it keep showing error. Thanks before
06-11-2024 09:53 AM
So one close returns an error, because the top close already closed the port.
I'd simply delete the bottom close.
The wire has a reference, referring to the device (it's serial reference). It's opened once, then used, and then closed twice... It only needs to be closed once, as the top wire and bottom wire refer to the same internal reference.
You might run into problems when you call the device in parallel (e.g. after the event structure and below the event structure. If the device has synchronous communication (which is normal for serial devices), calling it in parallel is a good way to ruin it. There's a change this is no problem, because both VIs could use the same VI internally, and that VI might synchronize communication. It doesn't have to though...
TL;DR: call the device in a sequence, not in parallel.