LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate digital pulse of variable duty cycle using Labview FPGA

Solved!
Go to solution
Highlighted

Hi everyone,

I am trying to generate pulses that I can change the duty cycle. I am using cRIO 9014 and NI-9403 DIO module connected on my chassis. I am able to see digital pulses which are coming from DIO module and I can change the period. I have this program and I am able to control and change the period of the pulses but I can not change the duty cycle of the pulses as I want. So How to do it on LabVIEW FPGA?

And My system clock rate is 40 MHz and since there is a timed loop, program should run at the clock rate. But when I start the program couple of times, there are different values in my indicator instead of 1 tick per iteration.

Does anyone explain to me why it is working like this? 

I am new to LabVIEW so any ideas or any example VI's would be much appreciated.

Regards,

Kaan

0 Kudos
Message 1 of 7
(249 Views)

I have attached the program as well.

Regards,

Kaan 

0 Kudos
Message 2 of 7
(190 Views)
Solution
Accepted by topic author kaan13

Hi Kaan,

 

where do you output your DO values? All you do is "enable" a certain output pin, but you don't set its value!

 

My system clock rate is 40 MHz…

The NI9403 does NOT support writing its DO values so fast. It only allows <= 140kHz…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 3 of 7
(183 Views)

I changed DO output connection and I am able to change duty cycle and period. Can I use while loop or for loop instead of timed loop which is in SubVI? And Do I have to use case structure in this case?

Many thanks,

Kaan

0 Kudos
Message 4 of 7
(151 Views)

Hi kaan,

 

you can use any kind of loop - when it suits to your requirements…

In a FPGA I usually use while loops as you don't know in advance how long that loop wil iterate.

 

Do I have to use case structure in this case?

???

For "cases" you should use "case structures"… Smiley Wink

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 5 of 7
(144 Views)

Thank you for your reply.

I also need to generate single pulse by PWM output.

My question is : How to do it in Labview FPGA? And how can I implement it to my code?

Regards,

Kaan

0 Kudos
Message 6 of 7
(112 Views)

Hi kaan,

 

I also need to generate single pulse by PWM output.

Please define a PWM outputting just a single pulse!

Right now it's a quite contradictionary description…

(A single pulse is just an ordinary DO: switch on, wait, switch off.)

 

How to do it in Labview FPGA? And how can I implement it to my code?

By programming!

After you define your requirements (and the algorithm) you can easily create the block diagram in LabVIEW…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 7 of 7
(82 Views)