PWM Input

John Wambold 9 years ago in Other updated by Gustav Widén (System support) 8 years ago 3

I have an application that requires using a PWM input to control the brightness of a MD4 5 inch non-touch display. The input is to be wired on C4:1 of a XC21 module. The input runs at a duty cycle of 10-90%.

Unfortunately for me, this is an optional input on the overall system. It is possible, that the PWM input is not available. If this is the case, the brightness would be controlled by a discrete switch.

My plan was to monitor the PWM input value, and if the PWM input was 100%, then I would go to a predefined brightness. If the PWM input was 0%, then I would go to a different predefined brightness. Any value between 10% and 90%, I would have the brightness of the MD4 set to the PWM value. As I see it now, I am not able to set the PWM input value to read from 0-100%. The default values for these types of inputs are 5-95%, and I can adjust them to cover 1-99%. This would be fine if the input was always a PWM type, but if the vehicle does not have this optional switch, then my PWM value would be 0% or 100%.

Is there anyway that I would be able to accomplish this, without have to make an adjust item?


That is an interesting idea, but I cannot think of a good workaround for this. Unlike the VIN, the range of the PWMIN cannot be set so wide that it disables error detection. I think the reason is for the PWMIN to require set simits on the duty cycle is that the frequency is an unknown.

You could use the Status operator to detect that the PWMIN is in either high error or low error, and use the result of that to know if the sensor is installed or not. But the problem with such a method is that you would be getting the error message on the screen and in the log each time you start up the system.

My suggestion is to use a Digital Parameter or State Parameter to switch between using the sensor and the predefined value, and also use that to disable the function group that the PWMIN is in.

I assume it is a one-time setup for each machine, so it should be quite easy to include this parameter in a production script for sending the application and settings.

Thanks for the reply. I am aware that I could easily create a parameter to work around this; however, my customer is concerned about the number of parameters that we already have. They would like the fewest possible parameters to change per vehicle.

Is there anyway of opening up the range to allow for a 0% or 100% input?


I do not think that is feasible. Without a min and max MR%, then I don't see how it could be possible to figure out the frequncy and period time.