0

I have a configuration setup with two CAN nodes and an attached database. I have added a CANOEILNLVECTOR.dll to both the nodes. By adding this Dll file all my messages are sent cyclic as I see in trace window. Now I set some value for a signal in a message, For Eg:

variables
{
  message Battery_Traction Batt_msg;
}

on start
{
  Batt_msg.Isolation_Signal = 0x02; //0x02:On
  output(Batt_msg);
}

What I see on trace is: The message is cyclic but only for the first instance the value set by me above appears in trace. For all of the rest times the signal value in the message in set to default.

As seen in the image value 0x02 is sent only once.

Trace.asc

I am not sure what could be the problem, as seen in image attached value set by me is only sent once.

Nikhil
  • 139
  • 1
  • 5
  • 14

2 Answers2

1

When using output you are putting the message directly onto the CAN bus, but you are not changing the value inside of your (simulated) node, so the interaction layer is still sending the old value.

You can change the signal value in the interaction layer by just putting a $ in front of the signal name and set the value.

In your case most likely $Isolation_Signal = 0x02

Outputting the message on the CAN bus at the right time, with the right cycle time and so on will be handled by the interaction layer.

MSpiller
  • 3,500
  • 2
  • 12
  • 24
  • I am not sure where $ sign is to be added. Are you asking to put out a $ in CAPL script ? That will result into a compilation error. How should I change a value inside IL ? – Nikhil Dec 08 '18 at 08:30
  • As said "put a $ in front of the signal name". The signal name can be gotten easily by just dragging & dropping from the symbol explorer. – MSpiller Dec 14 '18 at 10:56
0

You have two ways to influence dynamically the value of your message: IL DLLs and custom message sending.

Custom message sending is the basic way, where

  • you define the message ex.: message Battery_Traction Batt_msg;
  • you trigger its sending(output function)
  • you set up cyclic sending on timer Cycletimemsg1 {output(msg1);} and so on.

IL DLLs are doing this all for you, without much coding effort from your side, but they rely heavily on the dbc settings and attributes you have linked as database to your CAN Channel.

Unfortunately, they don't play well together, meaning you need advanced CANoe know-how of them to use both in the same environment. You basically bypassed your CANOEILNLVECTOR.dlls working by sending explicit message.

So your code if you are accessing your signal through IL, should look like this:

variables
{
 /*no need to define custom message object, they are already "known" to IL by dbc*/
}

on start
{
  $Batt_msg::Isolation_Signal = 0x02; //0x02:On
 /*NO need for output either (IF YOUR MESSAGE IS defined Cyclic in dbc), */
}

If your signal is not identified at $Batt_msg::Isolation_Signal, just dragndrop the signal from the CAPL browsers Symbols panel, and add the $ sign before it.

Through dollar($) sign, you access the dbsignal class objects signal value attribute.

VioletVynil
  • 502
  • 5
  • 11
  • yes you are right that the IL dll rely heavily on the dbc settings and attributes. Most of the times I have used timers to send cyclic values as I see my database has not defined cyclic attribute for messages (mostly event periodic). Thanks a lot for your input. – Nikhil Dec 09 '18 at 06:22