LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate single ramp signal

Solved!
Go to solution

Sorry, I thought I had but I only posted the arbitrary signal express attempt.

 

Here is one I just now got to work, I had to put a Stop  before the Write to make sure any other tasks were cleared.

 

I get about one ramp per second now. I feel there has got to be a better way than running the continuous samples but I have tried different combinations of finite sample and sample sizes but I guess I just don't understand the calculations there.

0 Kudos
Message 11 of 20
(1,771 Views)
I found a bunch of "Generate arbitrary number of analog output values" examples in the example area but they were all version 5.0.1 and I can't open them with 9.0.1
0 Kudos
Message 12 of 20
(1,766 Views)

Ok here are a couple of the things that I see. First the sawtooth generator is set up incorrectly. You need to have more samples to generate your signal. You are using the wrong signal type 5 is ramp. You need to remember that most everything is zero based index in LabVIEW. the duration should be something closer to 0.990. The larger the number the more teeth you will have.

 

 

Example_VI_BD.png

 

I also changed your code a little. You may have to change a few tings but this should get you closer. Another problem that you may have here is that you can not generate a -1 volt signal. I saw that error yesterday. You may need to correct for this.

Tim
GHSP
0 Kudos
Message 13 of 20
(1,740 Views)
Recommendation.  Instead of wiring a numeric constant in and thus getting that coercion dot, delete the constant.  Then right click on the input and choose Create Constant.  Now you have an enum already wired up where it is clearly documented which function it is you are trying to use, and no coercion dot.
0 Kudos
Message 14 of 20
(1,735 Views)

Thanks for the great tip RavensFan, I didn't know that short-cut.

 

When I run the [5].vi I get a continuous sawtooth at 10 Hz. Which is curious because the 'Frequency' constant says 1000. That said, I'm not sure you understood I WAS trying to get a single ramp, in such a way that I could piece them together one at a time and get less than the twenty "sawtooths" I was getting with my other method.  I have given up on the single ramp method, as I was able to get it to output single ramps to my positioner, and even with a few ramps it did not move it adequately. So, I am back to the bursts of continuous sawtooth and I have been able to get about 10 at a time which seems to be the , but would like to understand why yours gives 10hz not 1KHz.

0 Kudos
Message 15 of 20
(1,722 Views)
I would guess that it is because I use a 1000 ms timer on the event timeout. You could change that to 10000 ms on the timer and maybe that would get you what you want.
Tim
GHSP
0 Kudos
Message 16 of 20
(1,720 Views)
Do you just wat to ramp once and never again or do you want to push a button everytime you want to ramp or what are you really trying to do?
Tim
GHSP
0 Kudos
Message 17 of 20
(1,712 Views)
I believe that this is closer to what you are looking for. I fed the AO back to the AI and I can watch the ramp happen. If you cahnge the timeout for the top loop it will change how fast you ramp.
Tim
GHSP
0 Kudos
Message 18 of 20
(1,701 Views)

I made this one only generate one ramp. You can adjust frequency, sample and loop time to get your timing where you want it.

 

I hope some of this helps.

Tim
GHSP
0 Kudos
Message 19 of 20
(1,698 Views)

It is helping me understand some things I've never messed with. Event structures for one. I'm having to examine that well to see what you do with the shift registers.As I see it you are using them to build the ramp array. I don't quite see yet why you have to have a direction control outside and in the event structure.

 

Unfortunately, I'm having some problems with my PCI-6251 cards. They are being fussy. Sometimes they work sometimes they don't. I can get an output from MAX panels, but am having trouble getting any new AO vi I create to output. SOme weird anomaly or gremlin is all I can figure.

 

Thanks for all the suggestions, you've given me much to "chew" on. I'm sure something in there will be of value. ...I'm going to go restart my PC and see if these DAQ boards start behaving again.

 

CHristopher

0 Kudos
Message 20 of 20
(1,678 Views)