In order to realize K-wire communication, SDF-V3 defines new protocol types in the protocol sectionKLine Raw. All BabyLIN devices capable of running the SDF-V3 file (LinWorks version V.2.29.4 or above) and using the latest firmware (firmware version V.6.18 or above) can execute the KLine Raw protocol, and this article describes the KLine Raw protocol implementation for BabyLIN products.
KLine Raw Realization
As with other protocol implementations, you need to create a new session in SessionConf.ProtocolsDefinitionsKLine RawType Agreement.

services can be customized in the agreement.ServiceIt consists of a request frame and a response frame. By selecting theRequest onlyIf the response frame is not defined, then the definition of the response frame can be omitted.

The serial transfer rate and byte format of the LIN bus interface using the K-wire protocol can be configured with the macro commandSet Speed (Write Speed)Modification.

Definition of frame
The length of the frame in the K-line protocol can be a constant, a variable or a value retrieved from the signal. If the frame length is defined as a variable, the frame length is calculated from the actual mapped length.

1. Constant mapping
As shown in the following figure, the steps of constant mapping are: first add a mapping item (1), then define the starting position and size of the mapping item (2), then define the constant value of the mapping item (3), and finally save the data (4).

2. signal mapping
As shown in the following figure, the steps of signal mapping definition are: first, select the requested signal in the right signal list (1), add it to the mapping list (2), and finally adjust the offset to the payload (3), add all the signals needed in this frame and click OK to finish (4).

The two payload definition methods can be combined, in which case the constant mapping is applied first and then the signal mapping is merged; the unmapped area of the frame will be filled with the padding bytes given in the generic protocol attributes.

The definition of the response frame proceeds in the same way, except that the constant load mapping has no meaning here.
Activate K-line communication
When the LIN bus communication is started, the first dispatch of the LDF or the dispatch given by the start command is automatically started. When using K-wire communication on the LIN bus, it should be done by using the air scheduling table. It is necessary to set up a scheduling table in the LDF for diagnostic request frames only, which is used to start the bus. From there, an “empty” dispatch can be run, and then the K-wire protocol service can be executed using macro commands to transmit and receive K-wire frames on the bus. By default, a LIN bus startup will generate a wakeup pulse event. To avoid this, you can use theVirtual SignalSignal of the Zhongguang System@@SYSCFG307This is accomplished by setting the initial value of the

| Note: The implementation of K-line communication for BabyLIN series products requires additional activation, please contact Honghong for the activation method.
Based on the Baby-LIN series, Honghong's LIN bus simulation and test solutions are capable of master-slave simulation and analysis of LIN and CAN nodes/systems, and support event-based signal configuration, sequence control, error determination and triggering actions, which are widely used in automotive parts and production line testing. The products are equipped with free LINWorks software, which creates a friendly interaction between the functional operation of the test pieces and the software interface. In addition, MAXTRON also supports customized secondary development and testing services, please contact MAXTRON for more details!

If you have any questions, please feel free toContact Us!
