06-22-2021 09:06 AM
Hi all.
I'm graduate student in Korea.
I have problems in my labview code.
First, i use the DAQ(keysight) equipment and sensors to measure pressure and flow rate. And the signals are handled in labview.
I want to measure the signals N times and finally get the graph the number of measurement vs. signals.
So, now i added For loop in my labview code. But, the data did not stored.
1. How can i store the data?
2. How can i draw the graph?
Actually, i search those things. There are two methods maybe.
First thing is using "Shift register and Insert Into Array" and second thing is using "Shift register and Bulid array."
But i don't know how to apply those method into my case.
Thank you for your apply.
06-22-2021 10:03 AM
@suminpark wrote:
1. How can i store the data?
2. How can i draw the graph?
Actually, i search those things. There are two methods maybe.
First thing is using "Shift register and Insert Into Array" and second thing is using "Shift register and Bulid array."
But i don't know how to apply those method into my case.
What you are really wanting is to have an array of your data when the FOR loop completes, so you need to bring the data out of the FOR loop. The default is that the data will be auto-indexed. You're going to need to provide a better description of what kind of graph that you want (what should the data look like) in order to get good advice on how to graph your data.
06-22-2021 11:19 AM
Typically, code images are useless. Why don't you attach the actual VI instead?
For each iteration of the FOR loop, you seem to have 8 basically identical sequential code sections that only differ in some constants. Wouldn't one instance of this code be sufficient by autoindexing on arrays of parameters? Suddenly the code would be much easier to debug and maintain!
Your "insert into array" near the upper left makes little sense, especially since we cannot tell what's in the diagram constant.
@suminpark wrote:
I want to measure the signals N times and finally get the graph the number of measurement vs. signals.
Typically we want the opposite: "signals vs. measurement index".
What exactly do you want at the end? Should all results be concatenated 5x for each of the eight arrays? How big are these orange arrays? Are all the same size? Do you want to see the graphed progress during execution or just a graph of the final 5 iterations? What is the loop rate? Do you want eight graphs or one graph with eight traces?
06-23-2021 07:05 AM
What exactly do you want at the end? Should all results be concatenated 5x for each of the eight arrays? How big are these orange arrays? Are all the same size? Do you want to see the graphed progress during execution or just a graph of the final 5 iterations? What is the loop rate? Do you want eight graphs or one graph with eight traces?
Actually, there are 8 sensors(2 flowmeter and 6 pressure sensor) and i received 8 signals each sensors.
And all of the sensors' outputs are current signal. So, there are 8 identical sequential code.
My final goal is getting the data and plotting graph the signals according to every iterations. And I want to see the graphed process during execution.
The number of iteration in for loop (i.e. 5) is just sample. I want to measure more.
Sorry I've never heard the "loop rate"...
Finally, It doesn't matter whether eight graphs or one graph with eight traces.
I will attach my labview file later.
Thank you for your apply.
06-24-2021 09:05 PM
What you are really wanting is to have an array of your data when the FOR loop completes, so you need to bring the data out of the FOR loop. The default is that the data will be auto-indexed. You're going to need to provide a better description of what kind of graph that you want (what should the data look like) in order to get good advice on how to graph your data.
My final goal is just store(accumulate) the data according to the number of repeating. The graph is secondary thing.
06-24-2021 09:07 PM
This is my code.
06-25-2021 01:26 AM
Hi suminpark,
@suminpark wrote:
This is my code.
From what I can see you repeat the same code 8 times in your FOR loop, the only difference is the channel number and the scaling parameters: why don't you use an inner FOR loop to simplify your code?
@suminpark wrote:
My final goal is just store(accumulate) the data according to the number of repeating.
Then you need to collect ("accumulate") your measurement data in loop tunnels at the border of your FOR loop…
06-29-2021 08:40 AM
(Sorry, I don't have any of your drivers so I can't really do much with your VI.)
You've been told now the second time how to simplify your code 8x.
@altenbach wrote:
For each iteration of the FOR loop, you seem to have 8 basically identical sequential code sections that only differ in some constants. Wouldn't one instance of this code be sufficient by autoindexing on arrays of parameters? Suddenly the code would be much easier to debug and maintain!
You still have not explained why you need to prepend five zeroes to one of the data, but if this is what you want, built array (concatenate mode) is the more logical function:
You have not explained how long these result arrays are and how the output should look like. Do you want to see the data live as it builds or only at the end?
Maybe you can reduce your example to a simple VI that creates random data of the same size, then tell us exactly what you want at the end.
06-29-2021 09:52 AM