05-22-2025 07:45 AM
Hi,
I have an old 9012 cRIO which I found in our store. I want to generate a square wave from it, at up to 25000Hz to control a stepper motor.
So I have a timed loop in the code, with the clock source set to 1MHz. However I am getting an error -820, saying that it has been initialised with illegal parameters.
Is this true? Am I stuck with a limit of 1lHz?
Regards,
Ian
05-23-2025 09:07 AM
You are using the Scan Mode with the shared variables. 1kHz is the enforced limit on the legacy cRIO controller.
You can use some C Series Module Support for Specialty Digital Functions in Scan Mode to generate PWM.
If you don't have those modules, you have to generate the square wave using FPGA mode. See examples at Help >> Find Examples >> Hardware Input and Output >> compactRIO >> Signal Generation and Processing >> Digital >> Pulse Width Modulation >> PWM Generation