An example using LIN Cache Transforms.
Click here to download the project: https://github.com/DanlawMxTeam/Samples/raw/master/MultiLINCache.rar
Applies to: •MxSuite 3.36 or later Other Requirements: •A supported version of Visual Studio is required. •The user should have an understanding of MxSuite Scenarios, TestCases, and Transforms. |
This sample includes examples of the following features: •LIN Receive Driver Transforms •LIN Cache Transforms •An MxVMC configured to act as a LIN slave node
![]() Multi Lin Cache Harness The VMC is configured as a client of both LIN Cache Transforms. Click ![]() LIN Cache Properties ![]() LIN Cache Clients The client VMC updates data in the cache, but does not send messages itself. For more information, see LIN Cache. |
You may need to use the MSVS conversion wizard and convert the solution to run the sample. See Retargeting a Visual Studio solution. In the code sample below, you can see the MxVuC_LIN_Tx((mxI32)1 ,&lin_tx_message) method is used to update the LIN Cache. The first argument ((mxI32)1 in this sample) is the Cache Id, which corresponds to the Cache Id property on the Transform. void SendToBus1(void) { MxVuC_LIN_Message lin_tx_message = {0}; mxU8 payload[1]; payload[0] = LIN1Value;
MxVuC_LIN_MakeMessage(&lin_tx_message, (mxU32)0x18, (mxU8)2, (mxU8)0, (const mxU8*)&payload); MxVuC_LIN_Tx((mxI32)1 ,&lin_tx_message); }
void SendToBus2(void) { MxVuC_LIN_Message lin_tx_message = {0}; mxU8 payload[1]; payload[0] = LIN2Value;
MxVuC_LIN_MakeMessage(&lin_tx_message, (mxU32)0x18, (mxU8)2, (mxU8)0, (const mxU8*)&payload); MxVuC_LIN_Tx((mxI32)2, &lin_tx_message); }
|
To run the Default Scenario, click the run button ( The LIN1Value and LIN2Value Signals are stimulus Signals transmitted to the VMC Transform. SendToBus1 and SendToBus2 are task Signals which execute the SendToBus1 and SendToBus2 methods in the VMC. These methods write the LIN messages to the corresponding LIN Cache. LIN1Value and LIN2Value are included in the payload of the messages. LIN1_Frm_MstrNodeLIN1_Value and LIN1_Frm_MstrNodeLIN2_Value are read from the LIN bus by the LIN Receive Drivers and transmitted from their outports to the TestCase. |