
Ryan Poethke (Customer) asked a question.
What's the technical limitation that prevents the use of PWM functionality on all the built-in outputs on a BX-DM1E-18ED13-D? Computing horsepower of the microprocessor in the PLC?
I have an application where the client wants to control the brightness of up to (8) indicator lights on a panel (not just on/off). I know I could buy multiple HSIO cards to get that functionality, but that's a lot of money for some blinkin-lights.
Alternatively, any chance of a PWM card with (8) or (16) outputs? This application doesn't require the extra functionality of a HSIO card.
Thanks,
Ryan Poethke
That would be scan dependent, and may or may not work as well as you like, but yeah that could work.
I would personally probably use a timer interrupt and immediate output instructions. Under Interrupts, setup a single timer as recurrent at 500us. Add an ISR.
In the ISR:
// Count 0 to 19 to create 100Hz base freq
MATH V0 = if(V0 < 19, V0 + 1, 0)
// Add rung for each output x, V0x is duty cycle range of 0 - 20...0 = off, 20 = on
STRLT V0, Vx
OUTI Yx
Just threw it together to test. Worked beautifully. ISR latency is 7-8us and the execution time is about 35us, which should produce a far better result than FLASHER and virtually indiscernible from the hardware PWM.