06-16-2024 09:35 AM
I don't understand how that only returns a single sample per second for the torque stream of data but not the thrust stream. Can you elaborate? Also that does not change the skipped samples for the timer array.
06-17-2024 03:02 AM
Note that each 2nd value written in your Thrust column is the same are the Torque value:
Dynamic data is often discouraged from using, as it hides some details. It is better to use the DAQmx library directly, this also gives you way more control over you measurement. In fact, the DAQassistant express vi uses this. To see how it is built, right-click the DAQ assistant and click open front panel and look at the block diagram. There is some extra stuff, but the core is simple. Here is a minimal example that works for your case:
06-17-2024 11:16 AM
On 14 Jun, BasJong53 explained to you that your code did what you told it to do. You took the 1D Array of Thrust and asked for the Array Subset from index 0 to the end, which gives you a 1D Array of Thrust, the same as the input array. But for Torque, you input a 1D Array of Torque and asked for an Array Subset from index 1 to the end (which is also index 1), so you get Torque minus the first element (since you told it to ignore 0, start with 1).
Please learn to use (and distinguish between) the LabVIEW Array functions!
Bob Schor
06-19-2024 12:43 PM
Basjong53, thank you for taking the time to explain to me. I very much appreciate it.
06-19-2024 12:47 PM
Bob_Schor your aggressive comment contributes nothing to this post. People go to forums to ask questions because they are still learning LabVIEW, and nobody learns it overnight. If you aren't going to offer solutions to the problem, don't bother to reply.
06-19-2024 02:08 PM
Hallo jseele,
Bob hat sehr sachlich geantwortet und sogar das Wörtchen "Bitte" benutzt: wo genau siehst du ein "aggressives" Verhalten?
Und ja: es würde dir (und uns) helfen, wenn du LabVIEW-Grundlagen und den Umgang mit Arrays lernst…
06-19-2024 03:15 PM
@jseele,
I apologize if my earlier post offended you. I was surprised that you didn't see the earlier post that I cited which pointed out the error in using the wrong Array function.
In the spirit of making amends, here is (in part) how I would introduce some of the concepts in a slightly different way than the solution you chose.
Here's a picture of the VI. I didn't save it as a snippet, as it is all "out there in the open", and sometimes "coding it yourself" gives you some additional "muscle memory" to remember the key concepts.
I'll highlight some points:
I hope this makes sense to you. When I was testing it, I found it much easier to understand what was going on if I made the number of samples collected larger than 2, say 5 or 10, especially when dealing with a 3 x 2 array (3 x 10 is much easier to distinguish from a 10 x 3!).
Bob Schor
06-20-2024 07:29 PM
Bob, I appreciate your apology and your explanation. I will make sure to use daqmx and array functions in the future instead of daq assistant. However, I am curious about the output of the daq assistant in my original code. Is it outputting a 1D array, alternating between values for torque and thrust? I also don't understand why the element indices only went to 2 (whether that was because there are 2 quanities being measured or if there were 2 measurements per iteration...).
06-21-2024 07:22 AM
When you configure the DAQmx Timing function, you feed it two parameters -- the sampling rate (2 Hz), and the number of samples to take during a DAQmx Read (which you also set to 2). So when you do a DAQmx Read, it has an input parameter (if you are doing NChan NSamp) for "number of samples per channel". You told the Clock you wanted to read two samples at a time, so I wired the 2 (from the Timing function) to the Read (# of samples) so that when the Read occurs, you will get Sample 0 and Sample 1, the next time Sample 2 and Sample 3, and so on.
Note that one rarely sees such low sampling rates and # samples. The default values for Sample Clock are 1000 samples at 1000 samples/sec, which means that the corresponding DAQmx Read will "fire" once a second, giving you 1000 samples (from time 0 to 0.999, then 1.000 to 1.999, etc.). In your case, you'll get (again, one read / second) samples 0 and 1, a second later samples 2 and 3, etc.
Bob Schor
06-21-2024 05:22 PM - edited 06-21-2024 05:27 PM
Just to clarify, the parameter "samples to read" is total samples read across all channels at an instant in time? So then samples per channel would have to be equal to the total # of instantaneous samples divided by the # of channels? That doesn't seem to make sense because there could be cases where you could sample a channel twice at the same time.