how to send a CAN message pushing a button?


1 comment

  • Avatar
    Sean Gibson

    I will attempt to keep this as simple as I can. Note that there are probably better ways to do this, but it's what I found works, so it's what I use. I don't know all of your details, so this is fairly basic and is based off of having the message defined with the variable correctly defined as well. I'm also assuming you don't need this message broadcasting all the time, just when the variable changes value. I have used free form CAN messages, not the library for many of my custom tasks, including this one. I'm not covering how to set up a free form message in this reply. I can help with that later, if you need it.

    1. create an event in the programming tab.

    2. go to the actions tab in on the event and press the + on the right

    3. in the action builder window, select J1939 Port Manager on the left, Tx Ext Free Form or Tx Std Free Form in the middle, and your message on the right

    4. go to your variable in the programming tab and choose the event you just created in the "Fire on change" box

    5. on the same page, create a calculation event using the + on the right

    6. in the Expression box type "if(V,0,1)" without quotes

    7. go to the page designer window and set both the key up and key down events to the calculation event just created





    Comment actions Permalink

Please sign in to leave a comment.