LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triangle Wave Generator

Hey guys, 

I'm very very new to labview and have to make a triangle wave generator in LabView and control the frequency from the front panel. My teacher wants me to create one by hand and not use one of the functions already created and has told me to basically create one so that the function will climb at a rate of 1 when the y value is < 1 and once it reaches that value, stop and fall at a rate of 1 until it reaches -1. 

I am trying to use Cases and increments to create this but having a lot of trouble. Can someone point me in the right direction and I know... this is rookie work. 

0 Kudos
Message 1 of 6
(4,197 Views)

Shift registers.  Case structures or Select functions.  Comparisons.

 

If you'd like more help, you'll need to post what you have so far as a VI.  We can't guess what trouble you are having.  You need to show us.

0 Kudos
Message 2 of 6
(4,183 Views)

I know this is completely wrong because like I said, I am new to this. I just started using it last week but basically I think I would need to add [increment] each round until I reach max value (amplitude of 1) then change to subtracting [increment]. So i need to change increment from positive to negative. I'm not to sure how to set up my VI to get a triangle wave without using the given functions that are included in LabView. Any ideas on how I could do that? And I know, the code is awful in my picture. question for crosser.JPG

0 Kudos
Message 3 of 6
(4,160 Views)

Use block diagram clean up so it is easier to follow your wires.

 

It looks like you are trying to increment and decrement simultaneously, then merging them as two different signals.

 

You need two shift registers.  One that keeps track of the current voltage.  The other keeps track of the amount you are incrementing.  When you are incrementing, that should have the value of +1 in it.  When you need to decrement, put in the value of -1.  Every iteration, add the values of the two shift registers and put it back in the current voltage shift register.  The other register you wire through.  But if you exceed the one limit, wire in a -1.  When you exceed the other limit, wire in a +1.

0 Kudos
Message 4 of 6
(4,154 Views)

I'm having a hard time putting together what you are saying.. Can you draw a picture of it? Doesn't need to be a IV but i'd like to see what you are talking about. Sorry I am not up to speed on the code at all 

0 Kudos
Message 5 of 6
(4,150 Views)

I can only help so much.  This is still your homework.

 

Try writing down what you need to do in pseudo-code or a flow chart.

0 Kudos
Message 6 of 6
(4,141 Views)