12-20-2023 10:21 AM
Hi, I want to solve the following problem, but I would like to generate the signal without using predestined blocks. I need 2 parameters that can be modified:
T - signal period; (road sign)
h - signal height; (control)
Te - sampling period; (control)
And as an indication of this the problem is: Consider the signal period to be an integer number of sampling periods T = n x Te. Thus n becomes an input parameter that will have to be read from the graphic interface (control), based on which T is calculated.
I would like a ramp to be generated up to a certain height "h" set by me, and when it reaches that height to go back to 0 with the reverse slope.
12-20-2023 10:40 AM - edited 12-20-2023 10:50 AM
Seems easy enough! What have you tried and where did you get stuck?
What is a "road sign"? (Do you mean "indicator:?
Your number of inputs is confusing, because there seem to be more than two based on the description: n, Te, h.
Is Te an integer? Even or odd?
12-20-2023 11:43 AM
Yes, is indicator and Te it's the sampling time and it is U32 type.
12-20-2023 02:15 PM
You said no "predestined blocks" (we usually call them primitives 😉), yet you want to use a ramp signal. Does that mean you can use the Ramp Pattern.vi?
Either way, you did not tell us how you want to store the signal. Arrays, clusters or waveforms are all possible.
The simplest way is to build an array of increasing numbers based on your two parameters. Then use Reverse Array.vi to concatenate those two together for one cycle. Then, you can concatenate the desired number of cycles together to create your full signal. (Hint: Words in bold are VIs you can use)
This is obviously homework, so we won't just code a solution for you. Try out some ideas and post questions if you get stuck...
12-21-2023 02:19 AM
Hi mihairusu,
mihairusu11@yahoo.com wrote:
Consider the signal period to be an integer number of sampling periods T = n x Te. Thus n becomes an input parameter that will have to be read from the graphic interface (control), based on which T is calculated.
I would like a ramp to be generated up to a certain height "h" set by me, and when it reaches that height to go back to 0 with the reverse slope.
What have you tried so far and where are you stuck?
Mind to attach your VI?
12-21-2023 01:14 PM
I can't use already prefabricated blocks, I need them to be at the basic level, that is, to be a formula for calculating the slope, the ramp signal. I have to do everything from 0 as if I didn't have those blocks.
12-21-2023 01:16 PM
Hi mihairusu,
mihairusu11@yahoo.com wrote:
I can't use already prefabricated blocks, I need them to be at the basic level,
And what's wrong with my description?
What have you tried so far?
12-21-2023 01:18 PM
I don't know how to do this, I can attach a .vi in which all the signals are made, namely, sinusoidal signal, ramp and step. From that .vi, I would be interested in the ramp signal, but I don't know how to modify it to display what I want. Please help me.
12-21-2023 01:40 PM
If you are looking to create a ramp, then use the following:
Now alternate between the two formulas every half period
12-21-2023 01:46 PM
Can you give me a vi for this because I don't know how to work very well with labview being a beginner. Please!