Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging of VI to read from Force Sensor and RPM Sensor simultaneously

I have a VI (attached below) which reads the voltage values from an ATI Force/Torque sensor, as well as to count the frequency of an optical RPM LED signal. My objective is to synchronize the logging of data from both force and rpm sensor, such that the data captured at every interval is at the same time step for both sensors. My program for measuring the RPM sensor data has some bugs as it does capture data continously, but only once. I tried using a while loop but ended up with an error. I have no experience in LabView, and appreciate any help or advice given.

 

Thank you!

0 Kudos
Message 1 of 3
(3,903 Views)

can you send the snapshots of your vi as it is opening in LV 8.5. are you reading from serial ports for data logging from RPM and force sensor

0 Kudos
Message 2 of 3
(3,818 Views)

Well, you definitely need a while loop to read the counter more than once. The first thing I would try is to place the counter read inside the same loop as the force read. That would assure that the readings were close together in time.  I have not done rpm measurements, so I cannot say whether you have things set up properly.

 

Your VI has race conditions. The use of local variables can lead to race conditions and you have them. You have no way to know whether the code inside the Bias and Unbias case structures will execute before or after other parts of the code. You could be using stale values of Bias Voltages and Bias Vector. One way to fix this is to wire the arrays straight through the case structures and move the indicator terminals outside the case structure.

 

When you use wires to pass data, you do not need hidden indicators such as the Bias Vector. Why did you make Bias Voltages a 2D array when it only contains 1D data. Just show the Bias Vector indicator and eliminate Bias Voltages?

 

Change the mechanical action on the Bias and Unbias buttons to Latch When Released and you do not need the local variables to reset the buttons. Latch action booleans reset to default when read.

 

Use Build Array rather than the Convert from Dynamic Data you have feeding the Write to Spreadsheet File.vi for the counter. You still only get one data point.

 

It is very rare that you need to wire the N terminal of a for loop if you have an autoindexing array input. Doing so can cause behavior you might not expect. Remove the wire from Samples to Read to N.

 

The front panel documentation is very nice.

 

If you have not done so, I recommend that you work through the online tutorials for Getting Started with LabVIEW.

 

Lynn

0 Kudos
Message 3 of 3
(3,810 Views)