LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help Needed: Generating Adjustable Trapezoidal Waveforms in LabVIEW

Hello,

 

I am trying to generate two trapezoidal waveforms using LabVIEW software. Here are my requirements:

 

1. The amplitude of the signal should range from 0 to 10V.
2. The slope of the trapezoidal signal should be adjustable.
3. The waveforms should work for different frequencies.
4. The two waveforms should have a phase difference, and this offset should also be adjustable.

 

I have made some progress and have been able to generate the waveforms for certain frequencies. However, I am encountering issues when trying to adjust the waveforms for other frequencies.

 

Could someone please guide me on how to achieve this? Any sample VIs or detailed instructions would be greatly appreciated.

Thank you!
I have attached a LabVIEW 2017 file that i have used.

0 Kudos
Message 1 of 7
(477 Views)
0 Kudos
Message 2 of 7
(452 Views)

Offhand, I think I'd use the available signal generation functions to make triangle waves with the desired frequency and phase offset, then pass the data through a saturation function to clip the amplitude and turn the triangle into a trapezoid.  A simple "In Range and Coerce" function might be enough.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
Message 3 of 7
(386 Views)

Thank you for your suggestion. I tried using the signal generation functions to create triangle waves with the desired frequency and phase offset and then passed the data through the "In Range and Coerce" function to clip the amplitude and turn the triangle into a trapezoid. However, I am not able to get the correct output.

I am a newbie to LabVIEW, I get errors related to data types and connection issues.

Could you please provide more detailed instructions or an example VI that shows how to correctly set up and connect these blocks? Any help would be greatly appreciated.

.

 

0 Kudos
Message 4 of 7
(347 Views)

Hi Vincent,

 


@Vincent_Dz wrote:

I am a newbie to LabVIEW, I get errors related to data types and connection issues.

Could you please provide more detailed instructions or an example VI that shows how to correctly set up and connect these blocks? Any help would be greatly appreciated.


Unfortunately you forgot to attach your latest version of your VI so we cannot give advice for improvements…

 

Basically a trapezoidal waveform consist of 4 ramps:

  1. ramp up from lower to higher level
  2. ramp from higher level to higher level (yes, ramps can have the same start and end level!)
  3. ramp down from higher to lower level
  4. ramp from lower to lower level

All you need is a loop to create those ramps (given start, end and duration) and append them into a larger waveform:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 7
(343 Views)

Thank you for the guidance. I still not able to follow. 

 

I was able to generate the desired waveform in MATLAB, as shown in the attached images. However, I'm having difficulty replicating this in LabVIEW.

 

I’ve attached images showing the MATLAB implementation and the corresponding waveforms. The waveforms include 3 signals that I was able to easily generate in MATLAB. Please  provide guidance on how to achieve this in LabVIEW? 

 

Thanking you,

Download All
0 Kudos
Message 6 of 7
(212 Views)

Hi Vincent,

 

you just kudoed my previous message so I guess you use my suggestion to solve your problem!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(206 Views)