Jump to content

Generic CAN DI as increment button


Laminar

Recommended Posts

Hey all,

I'm struggling with how to use CAN increment buttons without having one of the supported keypads. I have an ECUMaster CAN Switch Board V3. I have two rotary knobs wired to A1 and A2, five momentary buttons wired to S1 through S5, and lights for four of the buttons wired to L1 to L4.

image.png.e825ee8613a947d4084b4e025b6f0202.png

Per this thread:

I was able to get the missing receive stream set up, plus I added a couple of parameters to read out the knob positions, as the Switch Board will automatically convert voltage to knob position for its knobs and send that with the DI statuses.

image.png.9d9741f32f436a722a463fd8a06228cd.png

All of that works great, now I'm trying to get an incremental button set up. In the examples I've seen, it's assumed I'm using a supported complete CAN keypad and the buttons get assigned to the Increment function in the keypad setup. In my case, I'm not sure how to tell the ECU which CAN DI is the input for my increment button. 

Video of testing yesterday:

 

rx8-xtremex.pclx

Link to comment
Share on other sites

The increment button is part of the CAN keypad functionality, it cant be used without one of the listed supported keypads.  Probably the closest you will get is to use the Edge function in a math block.  You may be able to play around with 2 math blocks, one to increase, the other to decrease.  

Link to comment
Share on other sites

Here's what I came up with. With every press of CAN DI 4, Math Block 1 sees a rising edge and increments its value. Math Block 2 is monitoring the output of MB1. If MB1 is less than 5, its output is 1. Once MB1 is no longer less than 5, MB2's output is 0. MB1 uses MB2's output as its reset input, where a value of 0 resets MB1.

math-block-1.png

math-block-2.png

 

At powerup, the value of MB1 is 0. I can click CAN DI 4 up through 4, but once I hit 5, MB2 goes to 0 and MB1 resets. The only issue I see is that MB1 is immediately set to 1 instead of zero. From then on, MB1 cycles 1-4 normally.

If I hold down the CAN DI 4 button at a value of 4, MB2 goes to zero and resets MB1 to 0. There is no rising edge, but MB1 automatically counts up to 1. After a reset, does it rescan the input and see that as a rising edge for some reason? Maybe I could map CAN DI 4 to MB2 parameter b, then give MB2 two conditions, like "a<5 & b=0" that way it basically triggers the reset on the falling edge of CAN DI 4.

Link to comment
Share on other sites

Wait that wouldn't work as I need the result to be true all of the time unless I want a reset. I'm not sure exactly how the syntax works; can I do something like "(a<5) | (a=5 & b = 1)" so that as long as a is less than five, we hold the reset output at 1, but once 'a' gets to 5, as soon as I let go of the button and b goes to zero so that neither statement is true, the output of MB2 goes to 0 and MB1 resets to 0?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...