how to send a CAN message pushing a button?
Hi, I'm new from powervision. Following the tutorials I'm able to manage the graphic and show the messages and variables on the display (PV450) but now i need to know how can i send a message pushing a button. So far I wrote the CAN message on library tab and added it to CANport1 in connections tab.
for example the variable V (length 1 bit) of message M must set to 1 when i pushing the associated button and come back to 0 when i release.
is it possible to do it?
thanks
-
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
Please sign in to leave a comment.
Comments
1 comment