graphic panel 0x0 007 (hey there James!)

I’m just having some more time on a travel, so lets use it for some more content.
I’d like to introduce my gfx panel, with which I plan to handle my functions.
Since you can imagine, its much more easier to control your messages and functions with a graphical interface, than tiping code in a console er something.
so this is a working screen from my panel:

panel1
You will know, that you can create or modify panels with the ‚Panel Designer‘ (which is for instance be included with CANoe full version -> Tools Panel Designer)
The view from Panel Designer is pretty much the same, as its later on on the screen.
So how do we create a button, that is connected to a message in a CAPL node, we’d like to send via CAN?

It’s not that hard. Lets for example take the „ECU reset“, since this is a simple function.
– First of all, its important to create variables in CANoe, you will later link in the panel. Its really strong recommended from Vector, that you create well defined variables in tables (e.g. as system variables), because you might share your code with colleagues or even work on it together. If you just define variables somewhere in the code, it might get really confusing in the end.
ya da da, ya da da, you can read this whole stuff in the documents I linked in my „First Aid Section“, so no need I tell you)
To do so, go to CANoe -> Configuration -> system variables.
You can now add User-Defined variables.

systemvar1
Fill in a Namespace, e.g. „myCAPLmsgs“ and than name the variable in some kind you will know what they mean, for our example maybe „EcuReset“.
You can also edit your variable that it fits your needs. For a button, we just need an Integer (for an on/off button, no further values have to be set).
– go to a the Panel Designer and grab a button and drag it somewhere
– the most important thing now is, that you assign your button to the variable you defined.This can be done under the properties/symbol -> choose ‚System Variable‘ (the one you created before)
– now you can  connect your button to CAPL code: in CAPL browser:

on sysvar sysvar::Namespace::Name /* (Namespace + Name are the attributes of the system variable you defined before in CANoe) */
{
 SomeCodeToDoSomething;
}

You can load the panels after you created them via ‚Configuration -> Panels‘, and, if they’re already implemented in your configuration file via ‚View->Panels‘.

graphic panel 0x0 007 (hey there James!)

Hinterlasse einen Kommentar