LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulating response of first order system

Hi All,

 

I'm taking a course that's teaching labview.  I've done pretty well so far on the labview projects but this one has me stumped.  Here is the assignment:

 

y(n)= Δt       *    (  T  * y(n-1)+x(n)  )

         T+Δt            Δt

Where T is the time constant, x(t) is the input and y(t) is the output.

 

 

Experiment 1, Simulate the dynamic response of first order system

 

 

1.      Launch LabVIEW.

2.      Create a blank VI.

3.      The front panel should have at least an numeric control to input the time constant and the graph indicator to show the result.

4.      Drop the “Simulated Signal” express VI and choose the signal type as square wave, frequency as 1Hz, sample frequency as 1000Hz and number of data points as 500.

5.      Use “Convert from Dynamic Data” VI to convert the data from the “Simulated Signal” express VI to single waveform data.

6.      Use waveform function to extract the waveform data and the time interval of the waveform.

7.      Use FOR loop to iterate the output data of the first order system.

8.      Use the formula node to program the algorithm based on equation 3.

9.      Use waveform function to create the waveform data from the output data and the time interval of the input waveform.

10.  Use “Build Array” function to create an array that consists of the input and output waveforms.

11.  Use graph indicator to show the input and output waveforms.

12.  Use “Write LabVIEW Measurement File” VI to save the data in a file.

13.  Run the VI using the following time constants: 0.01, 0.03, 0.05, 0.07 and 0.1, and save the results to files.

 

Now i'm ok up 'til #5.  #6 asks to extract the time interval of the waveform which i'm confused about.

Also, I used a for loop but I don't know if that needs to be around the entire thing

#8. I setup the formula but not sure where the inputs should be connected to

#9 is very confusing, i'm assuming he wants me to connect the waveform output to the input of another waveform?

 

Any help in this would be much appreciated.  

TIA

0 Kudos
Message 1 of 11
(5,822 Views)

dude did u find the answer? I have the same problem ! I get errors when I try to connect my build array and build signals to the output of for loop !

any body out there can help ?? thanks

0 Kudos
Message 2 of 11
(5,361 Views)

plz email me at : hadelec_7@yahoo.com 

0 Kudos
Message 3 of 11
(5,359 Views)

kakariki,

 

The thread to which you responded is two years old.  I suggest you start a new thread with your question.

 

Please tell us exactly what you are trying to do.  Also mention if it is a school assignment.

 

The show what you have tried.  Include data if necessary.  Explain what the results should be.  Ask specific questions about the parts you do not understand.  List the exact wording of any errors you get.

 

Lynn

Message 4 of 11
(5,356 Views)

hi lynn

 

thanks for reply. the problem is the same, yes it is a school project. I uploaded both the problem and my vi file here ! I have problems in my formula node(error: array indexing expected)  and also when I am attaching build waveform and build array to the output of my for loop with shift registers it says I can not do that because one is a double number the other one is array !

I solved the formula node problem bye making an array inside the formula node. but the problem with connecting the build waveform and build array in parts 9 and 10 of the problem is still there ! can u please take a look ? I think I might not understand the problem very well ...

do I still need to make a new thread ?

thnaks

Download All
0 Kudos
Message 5 of 11
(5,349 Views)

I have problem here :

 9- Use waveform function to create the waveform data from the output data and the time interval of the input waveform.

10- Use “Build Array” function to create an array that consists of the input and output waveforms.

so when I am trying to connect the output (1-D array) to the time interval of input(double) in build waveform I get error " you have connected two terminals of different type". its the same when I try to connect input and ouptput to build array !

I am new to labview, and in this case honestly I am not sure what I am doing ! 

0 Kudos
Message 6 of 11
(5,348 Views)

kakariki,

 

The general policy on the Forums is that we will help you to learn to use LabVIEW, but we will not do your work for you.  You would not learn anything that way and it would be dishonest for you to submit work done by someone else.

 

If your classes are not covering the basics of LV, and it appears that they may not be, please search for the on-line tutorials at th NI web site.  There are several resources for getting started with LV.  Speniding a little time with those will take you a long way toward understanding some of the elementary problems you are having.

 

As an example the errors you get at the Build Array primitive are easily explained once you understand that all elements of an array must be of identical datatypes. So you cannot make an array with both a numeric datatype and a waveform datatype.  Make both one datatype or the other.  Explain why you chose that type.

 

The same type of problem exists where you try to make a waveform because you are connecting an array to terminal which expects a scalar.  One of the first things you should learn about LV is how tunnels work at the borders of various types of structures, in this case the For loop.

 

I would not use a formula node for a problem like this because it can be done quite easily in native LV functions (which can automatically handle the array issues), but it may have been a requirement for your course.  I cannot recall the last time I needed to use a formula node.  Even if it is a course requirement, I encourage you to try to do it without the formula node just to see what the differences are.

 

You are not very far from having something which will work, but as I have pointed out above, the errors you are making show a lack of basic understanding of LV.

 

Lynn

Message 7 of 11
(5,337 Views)

Lynn,

thaks for reply. I understand your concern about integrity, and I DID NOT ASK YOU TO DO THE PROJECT FOR ME ! so if I were you, I would try to not judge people before I get to know the reason they are asking for help ! 

anyway, based on your comments on errors I got it working now. I was really close and you directed me the right way. for the build waveform part I disabled auto indexing in for loop(based on other NI discussion forum which btw you also could have told me so !) and for the build array part I got the input directly from after simulate signal ! I can post the picture here if some one interested.

thanks

Message 8 of 11
(5,328 Views)

kakariki,

 

I know you did not ask for someone to do your project.  However, we see many such requests and I chose to caution you so that you did not go that route and also to hint to other readers who might not have thought about those issues of the possibility that this was school work.  I did not intend to imply any critcism. I am sorry if you interpretted it that way.

 

I am glad that you got it working.

 

Lynn

0 Kudos
Message 9 of 11
(5,305 Views)

Posting a picture would be a great deal of help!

0 Kudos
Message 10 of 11
(5,256 Views)