09-29-2011 02:30 PM
09-30-2011 01:33 AM
Are you able to share what you have done so far? What problems are you having after putting the data into an array?
09-30-2011 09:11 AM
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.
09-30-2011 09:14 AM
if you have another form, i receive any comment or help, thanks for your answer.
09-30-2011 10:39 AM
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!
09-30-2011 10:57 AM
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.
10-03-2011 08:46 AM
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
10-03-2011 02:46 PM
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.
10-18-2011 06:12 PM
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
10-19-2011 08:03 AM
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.