2

I have a FlexRay PDU called TEMP in our case, which is getting filled in every cycle, and i would like to simulate a timeout on this PDU, but it has no updatebit.

I have a panel where i check the enable button to decide if it should be sent out or not.

frPdu FR::TEMP_Pdu;

on preStart {
  if (@FR_namespace::TEMP_Enablebutton)
  {
     FRSetSendPDU(TEMP_Pdu); 
  }
}

on frStartCycle * {
   if (@FR_namespace::TEMP_Enablebutton)
      FrUpdatePDU(TEMP_Pdu, 1, 1));
}

Whatever I set my button to, the PDU gets transmitted every loop.

vakesz
  • 58
  • 1
  • 7
  • CANoe version? Do you use IL dlls? Which one do you use? You need to know, that PDUs are Packet Data Units; They are virtualization of a physical frame. Therefore, you have to ensure you stop the frame also, not only the PDU. – VioletVynil Dec 13 '18 at 12:19

2 Answers2

1

FRUpdatePDU() is not sending another instance of PDU, it is just updating the next iteration with data from the frPDU object, since we are talking about PDU of a static frame, once the VN starts sending it, you cannot stop it individually by PDU control. enter image description here

Frame vs. PDU A frame is physical Flexray Frame on the network. a PDU, is a virtualization of a part (or of the entire) of the frame payload. Analogy: The postal truck is the FlexRay Frame, and the boxes in it are PDUs. For the Postal service (Flexray Protocol - OSI layer 1) the important unit is the truck itself, and for you (the client), the boxes in it. You will never be interested in what kind of truck delivered your goodies in a box, you are interested only in the content itself.

When you call the FrUpdatePDU(), you not only start sending the PDU, but you activate (send non-null frames) its slot also. By setting the frame underneath to non-null frame, you ensured (in a case of static frame) that it will be sent cyclically from that point, automatically, regardless what you want to do with the PDU (the trucks are going anyway, even if you don't want to send boxes in them).

Solution: I presume you do not have IL DLLs to aid you, therefore you are limited to the functions CANoe environment provides as General FlexRay IL functions.

  1. You need to identify the frame carrying the PDU.
  2. You need to manipulate the frame also with frUpdateStatFrame().

frframe FramefromDBCofTEMPPDU InstanceofFrameTemp;

on frStartCycle * {

if (@FR_namespace::TEMP_Enablebutton==1)

{

mframe.fr_flags=0x0;

frUpdateStatFrame(mframe);

TEMP_Pdu.byte(0xAA);

FrUpdatePDU(TEMP_Pdu, 1, 1));

}

else 

{

mframe.fr_flags=0x80;

frUpdateStatFrame(mframe);

}

}

So, in fact you need to modify the frame also. About the frame flags, check out the definition of the frframe in Help.

enter image description here

VioletVynil
  • 502
  • 5
  • 11
  • Thanks, it worked. Also i'd like to ask that we can only throw boxes into the postcar(Frame), but we can't set how many will be there. Cause the lack of the updatebit on the boxes(pdu). @VioletVynil – vakesz Dec 13 '18 at 14:52
  • The amount of PDUs assigned to a frame is defined pre-compile time, in the database. It is called PDU-mapping, usually in a fibex (xml),AUTOSAR(arxml) file format. So you can define as many PDUs as you wish to your frame, and map them, but that is not that efficient, several refferences will be missing. Basically you obtain the fibex file as an output from a master configuration tool, which integrates PDUs, frames and settings nicely. But you still can define more PDUs and their update bits. I hope I answered your question, I am not sure this was what you asked. – VioletVynil Dec 13 '18 at 14:58
  • Nagyon szivesen :) – VioletVynil Dec 14 '18 at 09:53
0

I don't use Vector CANoe or CANalyzer myself and there is almost no public documentation, so I can only offer some general debugging hints:

  • Have you checked that @FR_namespace::TEMP_Enablebutton has the expected value, i.e. that it is really false when you turn the button off? You could add a write() before the if() inside "on frStartCycle" to check this.
  • This question looks similar: Sending Periodic CAN signals on button press using CAPL and CANalyzer - they use "on sysvar" to react to the button press, maybe you have to do something similar. Namely: React to the button press, set an environment variable, check that variable in "on frStartCycle"
  • Since there is not a lot of public documentation, you can also try asking around inside your company, there might be some people around you who can help you.
user766308
  • 103
  • 7
  • Simulation of CAN messages is completely different to Flexray frame schedule. Flexray frame schedule IL is working differently. – VioletVynil Dec 13 '18 at 12:23
  • I did try to debug it, value changes are present in the TEMP_Enablebutton.Also not so many people use CAPL around here, but i talked about this issue with few of my colleagues, but they had no idea other than this. But thanks – vakesz Dec 13 '18 at 13:09