LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triangular wave generation on FPGA target

Solved!
Go to solution

Hi,

I am using PCI 7831R  DAQ card. I am trying to generate a triangular waveform as an output from this card using labview 2016.

Kindly suggest a solution as the triangular wave form option is not available on the FPGA target VI. How can I make the triangular wave form.

 

Waiting for response

 

 

Ekansh Garg

CSIO

0 Kudos
Message 1 of 10
(1,339 Views)

Hi Ekansh,

 


@EKANSH_CSIO wrote:

How can I make the triangular wave form.


A triangular waveform consists of ramps between min and max: you just need to interpolate between your min/max values over time (or iterations of your FPGA loop).

 

What have you tried and where are you stuck? Mind to attach your code?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(1,323 Views)

Hi,

Basically i want a sawtooth wave signal from my FPGA analog output pin, for which time and amplitude can be controlled in real time from lab view. Here is my code and snippet.

Please tell what am I missing out.

 

Waiting for you response.

 

Thanks

Ekansh,

CSIO

0 Kudos
Message 3 of 10
(1,281 Views)

Hi ekansh,

 

you miss to recognize that coercion dot! Such coercion dots have a purpose: read the LabVIEW help...

 

Suggestions:

  • Stay away from express VIs and their DDT wires!
  • Create the sawtooth in the FPGA.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(1,275 Views)

Hi 

I am facing the same challenge with the sawtooth generation on the fpga.

The above resources are in accessible when I tried to access them.

 

Here is the snippet of what I attempted to do.

0 Kudos
Message 5 of 10
(1,278 Views)

Hi again,

Is there a way to directly control and send sawtooth signal in real time to the FPGA I/O PIN from my VI (which is on host PC) in order to avoid repetitive code compilation on the FPGA target, as currently I am in development phase of the code . Is there a way to do so?

 

Best regards 

Ekansh 

CSIO

0 Kudos
Message 6 of 10
(1,257 Views)

Please suggest a solution of how can I generete a sawtooth signal on the FPGA I/O PIN directly from the host VI in the real time, to avoid repetitive compilation on the fpga target.

0 Kudos
Message 7 of 10
(1,250 Views)

Hi Ekansh,

 

please don't hijack (very) old thread when you already started your own discussion thread!

Keep related posts in just one thread!

 


@EKANSH_CSIO wrote:

Is there a way to directly control and send sawtooth signal in real time to the FPGA I/O PIN from my VI (which is on host PC) in order to avoid repetitive code compilation on the FPGA target, as currently I am in development phase of the code . Is there a way to do so?


Why do you need to compile "repetitive"?

As I suggested before: create the sawtooth signal inside the FPGA VI using simple math functions!

 

The FPGA only needs 3 inputs: min + max of the sawtooth signal and number of clock cycles for a full period.

I recommend to use FXP datatype: use the same FXP definition as is used by the AO pin…

I'm used to cRIO AO modules which use FXP datatype. As your device uses I16 you need to scale/round from FXP to I16…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 10
(1,244 Views)

Hi there again, I managed to generate triangular wave form, Thank you.

 

Now I am using a time delay inside a loop which is generating the wave form, but a little change in the time delay results in abrupt change in signal frequency. I am guessing this is because time delay function cannot take decimal values so it reads them as 0. 

So,

1)Can Time delay read values in decimals.

2) Is there a delay option fro values in micro second.

 

I have attached my code below

 

Warm Regards

 

Ekansh

CSIO

0 Kudos
Message 9 of 10
(1,186 Views)
Solution
Accepted by topic author EKANSH_CSIO

Hi Ekansh,

 


@EKANSH_CSIO wrote:

Hi there again, I managed to generate triangular wave form,


Did you do any of those basic LabVIEW training resources to actually learn LabVIEW and DATAFLOW?

Why are there so many local variables?

Why are there sequence frames when DATAFLOW should be used?

Why are there wrong datatypes, like orange wires where blue wires are expected?

See this:

No locals, no frames, just dataflow! (This will still not work as expected due to your other problems.)


@EKANSH_CSIO wrote:

1)Can Time delay read values in decimals.

2) Is there a delay option fro values in micro second.


  1. The Wait(ms) function can only wait in integer multiples of ms - as can be read in the LabVIEW help!
  2. Why do you want to wait in µs? This will not work reliable - not in Windows and not in NILinuxRT…

Does your VI run in the RT host or in the FPGA target?

Why do you create the waveform in the RT host, when you should do that (much better/more accurate!) in the FPGA target?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(1,182 Views)