07-18-2019 09:37 AM - edited 07-18-2019 10:04 AM
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
Solved! Go to Solution.
07-19-2019 04:17 AM
I have attached the program as well.
Regards,
Kaan
07-19-2019 04:47 AM
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…
07-22-2019 04:40 AM
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
07-22-2019 05:02 AM
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"… 😉
07-22-2019 05:24 PM
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
07-23-2019 12:57 AM - edited 07-23-2019 12:58 AM
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…