I’m trying to setup my logic for headlights on a racecar. We are using the “Aux” output to trigger a relay (ran out of Outputs on the PMU).
I setup a Function that will turn on the headlights with a keypad button (we only have 1 headlight level, no secondary High beams). I also have second CAN button on the steering wheel that will trigger a Pulse to flash the lights.
So each function works independently, but I can’t get the logic to work to flash the lights when they are already ON.
I basically have the following.
![image](https://europe1.discourse-cdn.com/flex013/uploads/ecumaster/original/1X/ca506f2e8f3c238dafdedba72e4ffe3667aa54c5.png)
I tried a few other configurations, but it would either not work at all, work only when BOTH buttons were active.
What I need is the following, just not sure which set of commands to make it happen.
Lights on
OR
Pulse On/Off
OR
Lights on
AND
Pulse Off/On
Currently the Latching Lights on is overriding the Pulses.
I have not changed the order with the pulse first, but I don’t think that would make a difference.
value=
c_steering_button2
AND
not_c_steering_button1 (false delay 6s)
OR
pulse c_steering_button1
You may need to use 2 functions and feed forward the first to the second if this is still causing the output to stay latched
I finally got around to testing this and things seem a little closer. When the lights are off (k_lights not set) things pulse as expected with a single push of Button 1. With lights on, they only pulse while Holding button1 (prior to adding the 6s false delay).
My question is, what is the 6s false delay intended to do?
![image](https://europe1.discourse-cdn.com/flex013/uploads/ecumaster/original/1X/4a6ef2fb85c76e8cc27023031f0417b01ab0c76c.png)
I am a bit unclear if this works for you or not now. The function is a bit different then with your first post
My intent with the 6 second delay was to allow the pulse to complete. The function requires the light button to be on and the flash to pass not be pressed. If the FTP button is pressed it gives the pulse function 6 secons (3 pulses of 0.5 on and 0.5 off = 6s) to operate, which is on the other side of the OR. it being on the other side of the OR should let it operate with k_lights off.
There’s a few ways to tackle this, but this way felt most efficient
Sorry, unfortunately I don’t have the car at my house, so I work on things at home, then go to the shop and test.
At the moment, the FTP button works when k_lights (headlights) is OFF. This is the pulse after the OR.
The next step is to allow the Pulse to work when k_lights (headlights) is ON. This is the portion I’m still not getting to work correctly. Prior to adding the 6sec delay, what would occur is the lights would be on, but they would only Pulse while actively holding the FTP button, vs just pressing it and running the 3 pulse cycle.
Maybe an idea to use a nc/no relay and use it to switch between the two functions you need.
Method 1:
More operations. More intuitive.
![light_pulse_method1](https://europe1.discourse-cdn.com/flex013/uploads/ecumaster/original/1X/6eaa02cbac77dc77f6658c2ddf36fb19720157a7.png)
Method 2:
Optimized. Harder to understand without good knowledge of logic operations.
![light_pulse_method2](https://europe1.discourse-cdn.com/flex013/uploads/ecumaster/original/1X/fccd3e7ea631e44f424cd7dd21e7ca5327d00ab8.png)
So in all my testing I could not seem to get any of this logic to work right.
When k_lights was triggered, the lights would never pulse.
My question now is, does the order of commands create a priority?
I have historically been putting k_lights first, then pulse. So k_lights on always seems to take priority. If I change the order will that make the Pulse the priority and override k_lights?
There is no priority.
Operations from the project tree are executed from top to bottom, every cycle.
If my methods don’t work for you, that means you have the switches configured differently. I assumed “k_lights” is a latching switch and “c_steering_button1” is a momentary switch.