TB_ShiftReg makes available a shift register with which product tracking can be implemented. Four DINT variables can be shifted. The shift register can contain up to 256 slots.
When x_Enable = TRUE, the module is activated. All data is deleted here (set to 0). Successful activation is signaled with TRUE at the x_Active output. From this point, data records can be saved and read. A data record consists of one to four data words.
Saving data:
The data record active at di_InVal0..3 is saved with the positive edge at input x_Put at position us_Position. If the data record was accepted, this is reported with TRUE at the x_PutDone output for one cycle.
Reading data:
With a positive edge at input x_Get, the data record at position us_Position is output at di_OutVal0..3. Successful output is indicated with TRUE at the x_GetDone output for one cycle.
Deleting FIFO:
With a positive edge at the x_Clock input, all data records are shifted to the next position.
Acknowledging errors:
When the enable is cancelled (x_Enable = FALSE), the shift register is deleted and all saved data records are deleted.
Recommended task: | Event / Cyclic |
Libraries used: | - |
none |
Marking: | Data type: | Description: |
---|---|---|
x_Enable | BOOL | TRUE: Enabling of the module and deleting of the shift register. Successful enabling is indicated at x_Active. |
x_Get | BOOL | With the positive edge, the data record at position us_Position is output at di_OutVal0..3. Successful output is indicated at x_PutDone. |
x_Put | BOOL | With the positive edge, the data record at di_InVal0..3 is accepted at the us_Position position. Successful acceptance is indicated at x_PutDone. |
di_InVal0 | DINT | First data word of the data record entered in the FIFO. |
di_InVal1 | DINT | Second data word of the data record entered in the FIFO. |
di_InVal2 | DINT | Third data word of the data record entered in the FIFO. |
di_InVal3 | DINT | Fourth data word of the data record entered in the FIFO. |
us_Position | USINT | Writing/reading position. |
x_Clock | BOOL | With a positive edge, all slots are shifted by one position. |
Marking: | Data type: | Description: |
---|---|---|
x_Active | BOOL | TRUE: Module active. Data records can be written and read. |
x_GetDone | BOOL | TRUE: Indicates that the data output at di_OutVal0..3 is valid for one cycle. |
x_PutDone | BOOL | TRUE: Indicates that the data active at di_InVal0..3 is accepted for one cycle. |
di_OutVal0 | DINT | First data word of the data record read out of the shift register. |
di_OutVal1 | DINT | Second data word of the data record read out of the shift register. |
di_OutVal2 | DINT | Third data word of the data record read out of the shift register. |
di_OutVal3 | DINT | Fourth data word of the data record read out of the shift register. |