09-09-2021 05:40 PM
I have an Arduino sending a number (angle from a motor) over serial to my PC. I also have an ATI load cell sending voltages to an NI USB-6356 DAQ. These voltages are then conditioned to forces and can be saved to a file. My issue is coming in when I try to put my angle from the Arduino together with the force data and export it to a file.
What I'm getting is all the forces/torques and then in the column that I want to be the angle, I'm just getting one value of the angle (see below). The end result should be a list of forces/torques and angles that correspond to those forces/torques.
First I tried using build array to convert my angle into an array, and that didn't work (it only made it a 1D array). I've also attempted to force my angle to be saved as a 2D array that populates beyond the first position, and that didn't work.
I think the fundamental issue is that when I open a probe on the voltages, I see they're reading off continuously (see below).
But when I open a probe on my angle, it's reading off continuously, but not updating in the same way (see below).
I've attached my VI. Any help is appreciated!
09-09-2021 06:13 PM
Could you share your Arduino sketch as well? I'm mostly interested in the serial communications. I think we can simplify that quite a bit.
On a more general note, you really should learn to use Shift Registers. You can avoid some of your local variables that way.
You can also change the "mechanical action" on your buttons. If you change it to a "Latch When Released", then the control will reset itself when the terminal is read. Again, this will eliminate some of your local variables.