01-21-2010 11:00 AM
For generating a triangle waveform, I have 3 vi's that I could use. Signal Processing -> Signal Generation -> Triangle wave.vi, Signal Processing -> Signal Generation -> Triangle Pattern.vi, Programming -> Waveform -> Analog waveform -> Waveform generation -> Triangle waveform.vi.
What is the basic difference between these 3. I understand that all 3 have a different input set and I can use them according to what combination of input data I have. Is there any specific case for which each of them is used?
Solved! Go to Solution.
01-21-2010 11:13 AM
Hit Ctrl-H to open context help.
Put one of each function on your block diagram and hover over them. Information about each will come up.
They do similar things, but aren't identical.
The first you listed creates an array that consists of a triangle waveform.
The second creates an array that consists of a single pulse of triangle waveform. It also seems to allow for "asymmetry". The rise rate of the triangle can be different from the fall rate.
The third creates an actual waveform that contains sampling info (start time, dt between samples) of a triangle waveform.
The first would be better for doing math on a repeated pattern.
The second for specialized triangle shape. It can be a buildling block of larger arrays if you wanted to repeat the generated triangle.
The third contains sampling data which would allow a more direct connection to DAQ functions.
Which is the best to use all depends on what you are trying to do. But all can be made to work.
01-21-2010 11:19 AM
01-21-2010 12:07 PM
so, does this mean that I can not use triangle wave and triangle pattern to generate an actual waveform. Why I am asking is because I tried checking the waveform on an oscilloscope. The waveform generated by triangle waveform.vi is visible on the oscilloscope but not the one generated by triangle pattern and triangle wave.
the attached vi CreateWaveformTest.vi does show up correctly on the oscilloscope.
The other vi, createparttern test.vi shows up correct in the waveform graph but I am not abe to see it on the oscilloscope. comes up as a straight line
01-21-2010 12:19 PM
01-21-2010 12:23 PM
01-21-2010 12:30 PM - edited 01-21-2010 12:33 PM
You should really get to understand DAQ a little better and the difference between data types. When you create a waveform data type, the data type includes timing information. For DAQ, the most important is the dt or time between samples. You have configured the DAQ Assistant to use this information in generating the waveform. When you create the 1D array, obviously this cannot contain timing information and when you convert to dynamic data, all that you will get is a default dt of 1.
As mentioned, you can use either function but if you create the 1D array, you will need to modify the data to add the dt that you want.
Look inside the Basic Function Generator. It uses the lower level Triangle Wave function that you have already mentioned. See how the timing information is add to the 1D array output.