06-17-2014 04:00 AM
Hello ,
I am trying to generate a simple Square Wave signal to control frequency of LED blinking ( 0- 100 Hz) via the FPGA of cRIO 9022.
When I am trying to control it on the host VI the maximum frequency attained was at between 40-50 Hz after that there is a decrease in rate of blinking even after increasing the frequency( 50Hz-100Hz the blinking rate was 50Hz -0 Hz).
I have tried using the normalize signal generation Fpga function .
tried changing the Data representation and the digits of precision and number of digits.
but of no use.
below attached are my host and fpga vis
What should i do to get a frequency more than 40 Hz ?I want to use this to automate the working of a Powertrain module.
06-20-2014 08:24 AM
Hi,
right click on your cRIO in your project Properties>>Top Level Clock.
Are you looking for that ?
Best regards Matijas
06-20-2014 09:57 AM
Make sure the Execution Mode of your Square Wave Generator express VI is set to Inside of a Single Cycle Timed Loop. Otherwise the code looks fine to me.
06-23-2014 06:17 AM
Hello ,
Thank you for the response Crossrulz and Matijas :).
Matijas, it was configured to run on the top level clock itself
Crossrulz, Yes it was made to run inside a SCTL by right clicking it and configuring.
My prolem was the data communication and conversion into FXP
When the Freq was 1Hz the fxp value was 2.49 e^-8 and for 100 Hz ( FXP 2.49xe^-6) the behaviour is same, so I was wondering whether the VI was missing the significant bits ?
07-08-2014 07:06 AM
Hello,
The problem was very simple, I was expecting a complex solution 😛 .It was the period of the Deterministic loop in RT which was too long that frequency generator couldnt make it at higher frequencies, everything else was fine ( I was so dumb editing the ,Double, FXP , word length and integer length 😄 LOL )
Sorry for the late reply,
Just wanted to thank you guys for the support.
Cheers