LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recording time shift from a continuous signal

Solved!
Go to solution

Hello

 

I am just starting learning LabVIEW and have to complete this vi.

I need to output the data from continuous time shift, but I don't know what to do to translate it to acceptable one.

 

The attachment 1 is the vi.

The attachment 2 shows where the problem is.

 

 

Thanks

LPH

 

Message Edited by Support on 04-21-2009 08:20 AM
0 Kudos
Message 1 of 6
(3,515 Views)

I can't load your VI here, but from your picture, I gather that the other cases put out an ARRAY of DBL on that wire.

 

In case 4 you're trying to output a scalar, so that's your mismatch.

 

If you want to put out an array in case 4, then you need to BUILD ARRAY in case 4.  Wire the scaler into a BUILD ARRAY function, and the output is an array (of one element).

 

That'll get you past the error - whether that's what you really want to do or not, I can't say. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 6
(3,504 Views)

And after you fix this error, you HAVE to replace your local variables with wires. The way you have it now, you have a reace condition where the values of the locals are being read before they are written to. NEVER use a local just because you think the wires will make you diagram look more 'messy'.

 

I'm also unsure about your approach towards reading the scope. You have a fetch function inside the loop. I believe you have to do an initiate before you can fetch a new waveform and that is outside the loop and only runs once. Do not use the run continuous button.

Message 3 of 6
(3,499 Views)

Thanks for your help guys,

 

to Dennis Knutson,

Sorry I don't understand "....fix this error, you HAVE to replace your local variables with wires......",

 

to CoastalMainBird, 

It works now, but i have another question.

 

For the case 4,  the result should be time shifting of a wave, but the reading will change continuously, and I want to record those numbers.

The result I got in case 4 contains only one number.

How can I make the result become a contiunous number?

 

Thanks again

 

LPH

 

 

 

0 Kudos
Message 4 of 6
(3,473 Views)

Sorry I don't understand "....fix this error, you HAVE to replace your local variables with wires......",

 
Look at your diagram.
You have one of the Tektronix VIs outputting a value called DELTA T.
A couple of places you use the DELTA T control (local variables) as an INPUT.
 
Which one do you think will execute first, and why?
 
 
The answer is, you don't know.
 
Since you didn't connect with wires, LabVIEW thinks you don't care about the order of things.  It might do the READ of local variables BEFORE doing the WRITE.
Even if it does them in the order you want the first time, it might just do it differently the next time.  It's allowed.
 
To avoid that uncertainty, run a wire from DELTA T coming out of FETCH WAVEFORM directly to where you want to use it.  Delete the local variables.
 
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 5 of 6
(3,461 Views)
Solution
Accepted by topic author LPH

How can I make the result become a contiunous number?

 

I don't know what you mean by "continuous number". 

 
Your calculations produce only one number per loop.
If you feed it to the strip chart, the chart will show you a history of the number. 
If you want to record the signal for the spreadsheet, then use the BUILD ARRAY function in case 4 to append it to an existing array.
Initialize the array to empty outside the loop, and feed it into a shift register.
Each time through the loop, append the new value to the array, and put it into the right-side of the shift reg.
When it's time to SAVE, you have the complete history of that value. 
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 6 of 6
(3,460 Views)