LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Average Random Numbers and store in retrievable file

Hi, guys

 

Below is the assignment that i need to do but im pretty new to labview and have no idea how to go about it. your help would be much appreciated. i only know how to generate a random number within the range. 

 

You are collecting wind speed data to select a wind turbine for a power generation application. If the
average value of the wind speed data is  greater or equal to 5m/s, you must select turbine A,
otherwise you select turbine B. You are required to write a program that collect speed data, stores them
into a retrievable file called “Wind speed data” and gives you the average speed and the selected turbine.
You must use a random generator to generate speed data. Note that the data range for the wind speed
will be between 1 and 10m/s.

0 Kudos
Message 1 of 2
(2,974 Views)

@zubairkgt500 wrote:

Hi, guys

 

Below is the assignment that i need to do but im pretty new to labview and have no idea how to go about it. your help would be much appreciated. i only know how to generate a random number within the range. 

 

You are collecting wind speed data to select a wind turbine for a power generation application. If the
average value of the wind speed data is  greater or equal to 5m/s, you must select turbine A,
otherwise you select turbine B. You are required to write a program that collect speed data, stores them
into a retrievable file called “Wind speed data” and gives you the average speed and the selected turbine.
You must use a random generator to generate speed data. Note that the data range for the wind speed
will be between 1 and 10m/s.


Okay, so you know how to "retrieve" wind speed.  now you have to compare this result to 5 m/s.  (Hint: look in the block diagram palette for one called "Comparison".)  Then you'll have to select either turbine A or turbine B.

 

Now for probably the most difficult part of the problem - and it's not writing the file!  It's "how do I represent turbine A and B???"  The simplest way is to use a string constant with "Turbine A" as the value and another with "Turbine B" for the value.  Note that I'm handing out this info as a freebie because I don't think the point of the exercise is to make you figure out that part.

 

So now we have the pieces to put together most of your stuff.  When you put it all together, we can dissect the code if necessary, or continue of it looks good.

 

Which brings up an important point if you want to "do" LabVIEW correctly.  If you're ever going to use LabVIEW beyond the classroom - or if you even want to impress your professor - make the block diagram neat.  Line up the nodes so that the wires don't have unnecessary bends.  Eliminate unnecessarily long wires by keeping the distance between nodes to the shortest distance that is practical, and don't make them go "backwards" - that is, "right to left".  Don't have wires going behind object on the block diagram!  The reason for this is practical, even if it lends itself to a more aesthetic block diagram as a welcomed side effect.  The code has to be readable to everyone who is ever going to review or modify your code.  Long, crooked wires that go backwards and under things makes the code difficult to follow.  The text-based coding analog of a "sloppy" block diagram is source code with random indents.  While the compiler doesn't really care, if your fellow developer wanted to murder you for that, I'd probably furnish the murder weapon.  Hypothetically.  Of course.

 

So make the block diagram neat, score style points with your professor (and style points become a real thing if you decide to get serious about LabVIEW), and have fun.  LabVIEW is fun.  I can't believe I get paid to have fun like this.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 2
(2,951 Views)