This kind of state variable allows using a dynamic structure to keep the state values in the simulator. All other state variables have a static size, defined during the modeling.
FloatQueue and IntegerQueue variables can be viewed as double-ended queues. The commands save_at_head(), save_at_tail(), restore_from_head(), and restore_from_tail manipulate these queues. restore_from_head and restore_from_tail remove the element from the queue. One limitation is that Tangram-II dqueue operations only support vectors, and Tangram's vectors must have dimensions .
Declaration = Var: FloatQueue: Statusqueue(2);Inside an event or message:
float b[2]; FloatQueue statusqueue(2); ... get_st(statusqueue, "Statusqueue"); b[0] = 1.0; b[1] = 2.5; save_at_tail(statusqueue,b); set_st("Statusqueue", statusqueue);Inside another event or Message:
float a[2]; FloatQueue statusqueue(2); ... get_st(statusqueue, "Statusqueue"); restore_from_head(statusqueue, a); set_st("Statusqueue", statusqueue);For more information, see the fluid server FIFO example.