Skip to main content

Example 4 - Detection of a breakpoint

Example 4 - Detection of a breakpoint:

Task:

In order to be able to carry out further statistical investigations, the "STOP" status is required. This is to be set when the door release 'RELEASE_LI, RELEASE_RE' is set on the vehicle. Due to local conditions, the vehicle may have to move to a 2nd or 3rd stop position without leaving the stop.

Solution:

This example uses the distance calculation from Example 2.

_doors = FREIGABE_LI || FREIGABE_RE;
_stnDist = DIST_KM - dFF(_doors, DIST_KM); // km
HALTEPUNKT = rsFF(_stnDist > 0.100, _doors);

Functions used

Explanation:

  • Variables for internal use are marked with a _ as the first character. This improves readability.

  • _doors : The door release can be set to the left or right. Other conditions may be added here.

  • _stnDist: With the positive edge on the door release signal, the dFF() accepts the data value, i.e. the mileage at this point in time. The result of the difference is the distance traveled since the door was last opened.

  • STOP POINT: The stop point condition in the form of rsFF() is to be set when the door is opened (set) and is canceled when a distance of 100 m has been covered (reset). This distance is greater than the distance to move forward to an alternative stopping position. This process is therefore handled correctly.