A button to set data in a j1939 message

Discuss issues and ideas you have to configuring displays with PowerVision
rtackett
Posts: 15
Joined: Tue May 03, 2011 9:58 am

A button to set data in a j1939 message

Post by rtackett » Tue Sep 13, 2011 3:27 pm

I'm trying to configure a PV450 button to set / reset a bit in a byte of a j1939 message. Please assist.

Thanks,
Russell T.
ksaenz
Enovation Controls Development
Enovation Controls Development
Posts: 263
Joined: Thu Aug 19, 2010 7:53 am

Re: A button to set data in a j1939 message

Post by ksaenz » Tue Sep 13, 2011 4:11 pm

Hello Russell,

The attached configuration broadcasts the parameter Auxiliary I/O #1 (SPN 701) and you can change the value of it from 0 to 1 by holding button 2.

To be able to broadcast the parameter you need to add it to the Transmit Device under CANPort1 in Environment Setup. This will create a variable in the Database called "J1939.Transmit Auxiliary I/O #1"

To be able to change the values of the variable you need to create calculation events for it in the database. In the attached configuration the calculation event "Calculate J1939.Transmit.Auxiliary I/O #01 ON" changes the value to 1 and the calculation event "Calculate J1939.Transmit.Auxiliary I/O #01 OFF" changes the value to 0.

To change the value to 1 when you press the button and change it back to 0 when you let go you need to create a state machine in Programming.
In the attached configuration the name of the state machine is "Aux I/O 1".
The state machine has two state, OFF and ON.
The initial state is OFF.
There is a transition going from OFF to ON called "Turn ON".
There is a transition going from ON to OFF called "Turn OFF".
On entering the state OFF it executes the calculation event "Calculate J1939.Transmit.Auxiliary I/O #01 OFF".
On entering the state ON it enables key up and executes the calculation event "Calculate J1939.Transmit.Auxiliary I/O #01 ON".
On exiting the state ON it disables key up.

To fire the transition set the page buttons in Page Designer.
In the attached configuration button 2 fires the event "Turn ON" for Key Press and the event "Turn OFF" for Key Up.
You can toggle the key action ( Key Press / Key Hold / Key Up ) by pressing the button on the lower left corner next to the screen orientation ( Landscape / Portrait ).

Regards,

ksaenz
Attachments
Hold button to change value.db3
(740 KiB) Downloaded 19 times
rtackett
Posts: 15
Joined: Tue May 03, 2011 9:58 am

Re: A button to set data in a j1939 message

Post by rtackett » Wed Sep 14, 2011 9:52 am

Kristian,
Thanks for the quick response. When I download the program into the PV450 and run a CAN analzer, I have no data being transmitted? Do you have an idea what may be wrong?
ksaenz
Enovation Controls Development
Enovation Controls Development
Posts: 263
Joined: Thu Aug 19, 2010 7:53 am

Re: A button to set data in a j1939 message

Post by ksaenz » Wed Sep 14, 2011 1:26 pm

Russell,

Try defining the rest of the PGN, at least the last parameter.

Thank you,

ksaenz
ksaenz
Enovation Controls Development
Enovation Controls Development
Posts: 263
Joined: Thu Aug 19, 2010 7:53 am

Re: A button to set data in a j1939 message

Post by ksaenz » Thu Sep 15, 2011 7:50 am

Here is the configuration with bytes 1, 7 and 8 defined.
Attachments
Hold button to change value.db3
(748 KiB) Downloaded 17 times