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.
Change button status
Re: Change button status
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.
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
Re: Change button status
(The project was not tested on the real PMU device, so please let me know if you have any problem with it.)
Re: Change button status
Thanks. I’ll check it tomorrow!
stół kuchenny okrągły
Who is online
Users browsing this forum: No registered users and 1 guest