LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating a data cluseter consisting in: a sinusoidal signal, a cosinusoidal signal, a ramp signal, an integer value for number of points

 

I have this thing to do my I do not understand clearly how should I generate the data cluser. Can you help me out? I tried a lot to figure it out but can not manage to find the answer.

 

 

Create a SubVI for generating a data cluster consisting in: a sinusoidal signal, a cosinusoidal signal, a ramp signal, an integer value for number of points and a string containing the sinusoidal data values converted to text. The inputs of the SubVI will be: the number of points and amplitude of the generated signals. Demonstrate the functionality of the SubVI by creating a *.vi for displaying the signals and additional data on a graph/indicators.

0 Kudos
Message 1 of 9
(1,035 Views)

It is so much easier for us to work with code, rather than pictures of code.

 

Do the following:

  1. Start the LabVIEW Forum.
  2. On the first page, click on "Learn LabVIEW Basics".  Click on "5.  Data Structures".  Read about Clusters.
  3. Create a Cluster with the elements that you want.  Don't worry that it doesn't have any values (yet) -- you need do have a representative of your Cluster to create "Cluster Wires" to carry the data.
  4. As you'll learn in the LabVIEW Basics, you "Bundle" appropriately-typed elements into a Cluster, and "Unbundle" them out of the Cluster.  There are two forms of "Bundle" and "Unbundle" -- I strongly urge you to use the "By Name" version, as it is tells you exactly where to connect the wires (I use this 99% of the time, even though I'm hardly a beginner ...).
  5. Here's an unrelated hint -- what is the phase difference between a sine wave and a cosine wave (in degrees)?

Bob Schor

 

0 Kudos
Message 2 of 9
(1,013 Views)

That's very helpful.  You do realize, don't you, that you'll need to build a second Cluster?  One with elements "Sinusoid" (what type of element is this?), "CoSinusoid", "Ramp", "# Points" (you can use symbols like "#" in naming Elements in LabVIEW, very nice), and "Data String".  You've got four of the components on your Block Diagram (though you used different names than I chose, which is fine), but no Cluster to put them into.  Create the Cluster, get the missing fifth element onto a Wire, and wire up you Cluster!

 

Bob Schor

0 Kudos
Message 4 of 9
(999 Views)

For the second cluster how can I enter that items in it? I had some problems trying to create also a second cluster.

0 Kudos
Message 5 of 9
(996 Views)

That's very helpful.  You do realize, don't you, that you'll need to build a second Cluster?  One with elements "Sinusoid" (what type of element is this?), "CoSinusoid", "Ramp", "# Points" (you can use symbols like "#" in naming Elements in LabVIEW, very nice), and "Data String".  You've got four of the components on your Block Diagram (though you used different names than I chose, which is fine), but no Cluster to put them into.  Create the Cluster, get the missing fifth element onto a Wire, and wire up your Cluster!

 

Bob Schor

0 Kudos
Message 6 of 9
(996 Views)

Oops, ignore the previous (accidental) double Post.

 

Go back to my first Post, where I tell you where to learn about Clusters.  Read the section Creating Cluster Controls and Indicators (you will be creating an Indicator).  Read a little more in that section and you'll (I hope) learn how to do a Bundle by Name and build your Cluster.

Are you trying to "learn on your own"?  If so, you need to read a bit more and think about what you are reading.  If you are learning in a class, either you are not paying attention, your instructor is doing a very poor job of communicating with you, or you are not asking for explanations when he or she "goes too fast" for you to follow.  Don't be afraid to ask for a better explanation.

 

Bob Schor

0 Kudos
Message 8 of 9
(983 Views)

I apologize -- now I'm being careless.  I see you have a thick orange wire (which means that it is an Array of Floats, Dbls in your case) going from a Ramp Pattern VI to something called "Waveform Ramp", which I (carelessly) thought was an Indicator of type Array of Dbl.  Nope, it is a Waveform Graph (perfectly legal to have), which can take an Array of Dbls as its input.  While there can be times when you'd want to make a Cluster having Waveform Graphs as elements (rare, I suspect), Clusters are much more likely to have the relevant Data (here, Array of Dbl) and their elements.

 

Bob Schor

 

P.S. -- I'm busy writing some moderately hairy LabVIEW code using some LabVIEW technology that's somewhat new to me, so I've been popping in and out of the Forums while my code compiles and tests, which may explain my "fuzzy thinking" ...

0 Kudos
Message 9 of 9
(973 Views)