LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delay in a signal acquisition ( number of samples)

i 'm working with a NI myDAQ, I acquire teh signal without problem, but i need generate a delay in this signal, but no referent to the time, i need that is referent to the number of samples, I've been thinking in do this with some assistant or VI but i find nothing, my another idea is do this with a "index array" i put my signal in a array and make all that i need. i need this for to make a difference equation. thanks for the answer, really i need help.
0 Kudos
Message 1 of 18
(4,397 Views)

Are you able to share what you have done so far? What problems are you having after putting the data into an array?

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 18
(4,384 Views)

after some hours i can do this, only i use a a vi delay values, with this vi i can take the discrete signal with the delay than i want, this number correspond to the number of samples that i want, is so easy.

grettings from colombia.

 

0 Kudos
Message 3 of 18
(4,370 Views)

if you have another form, i receive any comment or help, thanks for your answer.

 

 

0 Kudos
Message 4 of 18
(4,369 Views)

Hi hammer89!!

 

Have you thought about using stacked shift registers?

 

I made a VI that may help you!! You just need to change the express VI "DAQ assistant" to your device. Also, you can change the loop timing by changing the value in the "Wait Until Next Multiple (ms)" function!!

 

Regards!

Felipe Flores
Technical Support Engineer
National Instruments
0 Kudos
Message 5 of 18
(4,360 Views)

really, my device is a NI myDAQ, i understand in your vi than you save each of the samples, but i don't understand how do you save it.

i can resolve my problem with this code, if you want see this and tell me if you know a better form to make this.

the example consist in a simple control (proportional), i have two analog inputs, A0 is my reference and A1,  and my analog output represent the out of system that is the signal control, for now only i want make a difference equation with this dates, for the delays i use a vi.

thanks for you answer.

manuel grisales.

 

 

0 Kudos
Message 6 of 18
(4,356 Views)

Hi! 

 

You should use the "split" function instead "Select Signals" and use "shift registers" instead of "Delay Values" in order to save processor resources. Those changes would improve your code and won't change the final result.

 

Sincerly Regards

 

 

Felipe Flores
Technical Support Engineer
National Instruments
0 Kudos
Message 7 of 18
(4,333 Views)

ok, i'm gonna try with this and tell you after, i don't want delays in my output, for that my control really work as i wating.

can you help me with a code where you make a difference equation from "shift registers" ? i don't have idea.

In the first example that you give me the max sample rate that i can have is 1 Khz, but i need more speed, for that i used a DAQ-assistant.

thanks for your councils.

gretting.

manuel grisales.

0 Kudos
Message 8 of 18
(4,321 Views)

hi, i think than you forged this post, but i can do my program with your answers, finally i understand how i can work with shift register and split.

 

here i post you my code, it's better than the other, now i going to prove this with my osciloscope and tell you the results.

 

thx so much.

 

 

manuel grisales

 

 

0 Kudos
Message 9 of 18
(4,275 Views)

Best regards!

Hello,

 

Sorry for the delay! I got a lot of work here but I did not forget you. Anyway, let's go to your vi:

 

The first thing I notice on your block diagram is that you're not managing the error correctly. you only create an error control to stop your while loop, but it will not work. You must use the error in/out terminals of your VIs to manage the error.

 

To stop your VI when an error ocurres, you have to use a function called "Unbundle" or "Unbundle By Name" to get only the satus of the error cluster (wich is a boolean), that is, if you get an error the status will change from FALSE to TRUE, and it will stop your VI. I think you might wanna stop your VI whenever you want in case of you don't get any error. To do that, you need to use a stop button. So, I recommend you to use a OR function to stop your VI when you get an error OR when you press the stop button. 

 

I attached your VI whith that correction.

 

Let me ask you a question. What does that differeces equation represent on your system? A PI controller? I'm asking it because you said your trying to implement a proportional controller, and actually you don't need a difference equation for that.

 

Felipe Flores
Technical Support Engineer
National Instruments
0 Kudos
Message 10 of 18
(4,261 Views)