Change button status

All information about power management unit
Post Reply
RobS2
Posts: 3
Joined: Sat Dec 22, 2018 11:34 am

Change button status

Post by RobS2 » Sun Dec 23, 2018 3:26 pm

I am working through programming a system using 2 PMUs, a 12 button CANBus keypad, 2 wheel switches (each with 4 buttons), DTA Dash and DTA Dash.

I am struggling a little with the switches - is it possible to change their status via a function? For example the cooling fan will switch on via the ECU but will also have an override via the keypad. The button colour will change depending on the fan status and whether it is being switched via the ECU or the keypad. The fan will only switch on when the ignition is on. This all works fine, but if the fan override is ON and the ignition is switch OFF the fan switches off as expected. However I want the fan not to switch back on when the ignition is switched back on - basically to reset the button status to OFF.

Thanks in advance for any help.

jgm
Posts: 76
Joined: Wed Oct 19, 2016 3:59 pm

Re: Change button status

Post by jgm » Wed Dec 26, 2018 11:59 am

Hi,

Below is a solution to your problem.
The keyboard button will have 3 states - OFF, GREEN, BLUE (OFF, ON from CAN and ON by user).
When you turn on the ignition it will be controlled by CAN. When you press the button it will turn BLUE and the output will be ON. It will stay until you press the button again.

The following elements are used:
- k_fanIndicator - keyboard button of type "Indicator" and colors: NONE, GREEN, BLUE
- c_ecu_fanStatus - CANbusInput from the ECU with values zero or one.
- f_fanOverride - is the logical Function that holds the override status
- n_fanState - is the Number that holds the state (or color) of the button 0(OFF), 1(ON from CAN), 2(ON by user)
- o_fan - the PowerOutput

Formulas:

c_ecu_fanState configured
f_fanOverride = toggle(k_fanIndicator, rising, default:0)
n_fanState = 2*f_fanOveride + c_ecu_fanState
k_fanIndicator.setValueChannel = n_fanState
o_fan.active = n_fanState


Attached is PMU project and configuration of the k_fanIndicator button.

I'm not sure the ignition problem you have. For me if the ignition signal is lost from the PMU, the PMU turns off, the logic stops execution and all the power outputs are turned off.
Attachments
fanOverride.pmu
(24.88 KiB) Downloaded 9 times
k_fanIndicator.PNG

jgm
Posts: 76
Joined: Wed Oct 19, 2016 3:59 pm

Re: Change button status

Post by jgm » Wed Dec 26, 2018 12:16 pm

(The project was not tested on the real PMU device, so please let me know if you have any problem with it.)

RobS2
Posts: 3
Joined: Sat Dec 22, 2018 11:34 am

Re: Change button status

Post by RobS2 » Fri Dec 28, 2018 1:16 am

Thanks. I’ll check it tomorrow!

Post Reply
stół kuchenny okrągły

Who is online

Users browsing this forum: No registered users and 1 guest