Abstract

The VxWorks Double Buffer blocks are meant to be used to interface signals to asynchronous function-call subsystems in a model. This is needed whenever a function-call subsystem has input or output signals and its control input utimately sources to the VxWorks Interrupt Block.

Because the asynchronous function-call subsystem can preempt or be prempted by the model code, an inconsistency can arise when more than 1 signal element is connected to it. The issue is that signals passed to and/or from the function-call subsystem can be in the process of being written or read when the preemption occurs. Thus, partial old and partial new data will be used. For some applications this may not be an issue, but if it is, the Double Buffer blocks can be used to guarantee the data passed to and/or from the function-call subsystem is all from the same iteration.

The Double Buffer blocks are used in pairs, with a Write Side driving the Read Side. To ensure the data integrity, no other connections are allowed between the 2 Double Buffer blocks. The pair work by using 2 buffers to pass the Signal and, by using mutually-exclusive control, allow only exclusive access to each buffer. For example, if the Write Side is currently writing into one buffer, the Read Side can only read from the other buffer.

Sample Time

The sample time should be set to -1 inside a function-call and to the desired time otherwise.