11.12.2012 Views

1 PLIN-API Documentation - PEAK-System

1 PLIN-API Documentation - PEAK-System

1 PLIN-API Documentation - PEAK-System

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.7 Processing Event Frames <strong>PLIN</strong> <strong>API</strong> <strong>Documentation</strong><br />

Schedule processing example<br />

A schedule table contains different frames for response transfers like ID 25, ID 40, etc. and an event frame ID 9. The first<br />

time the event frame header is sent, no slave will respond to it. The slot is empty and will be ignored. After other frames the<br />

event frame will be triggered a second time. Since the last event frame, both slaves have new data pending for transmission,<br />

a collision will occur. The master then branches to the resolving schedule directly after the event slot responsible for the<br />

collision. Returning from the resolving schedule will resume the main schedule with the slot subsequent to the event frame<br />

where the collision occurred. Triggering the event frame a third time, only slave 2 will respond to it.<br />

Setting up the example with <strong>PLIN</strong>-<strong>API</strong><br />

For this example is assumed that 2 application exist, one for each Slave. Both have all initialization and configuration needed<br />

and they have a button, with will be used to call the function LIN_UpdateByteArray ( see page 127).<br />

1. Set up FrameId 9 with LIN_SetFrameEntry ( see page 125) using the values listed bellow. This step must be done for<br />

both slave, Slave 1 and Slave 2:<br />

• Direction: dirPublisher<br />

• Length: 4<br />

• Type: cstClassic<br />

• Flags: FRAME_FLAG_RESPONSE_ENABLE Or FRAME_FLAG_SINGLE_SHOT<br />

2. Set up FrameId 10 with LIN_SetFrameEntry ( see page 125) using the values listed bellow and remap the publisher<br />

response of ID 10 to ID 9, with LIN_SetResponseRemap ( see page 144). This step must be done for Slave 1 only:<br />

• Direction: dirPublisher<br />

• Length: 4<br />

• Type: cstClassic<br />

• Flags: FRAME_FLAG_RESPONSE_ENABLE<br />

3. Set up FrameId 11 with LIN_SetFrameEntry ( see page 125) using the values listed bellow and remap the publisher<br />

response of ID 11 to ID 9, with LIN_SetResponseRemap ( see page 144). This step must be done for Slave 2 only:<br />

• Direction: dirPublisher<br />

• Length: 4<br />

• Type: cstClassic<br />

• Flags: FRAME_FLAG_RESPONSE_ENABLE<br />

4. Update the ID 9 from both Slaves, using the function LIN_UpdateByteArray ( see page 127), eg. using a button.<br />

22<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!