Start » Filter Reference » Data Flow » Loop Utils » LastMultipleObjects

LastMultipleObjects


Module: FoundationLite

Returns an array of most recent objects.

Name Type Range Description
Input value
inObject <T>
Input value
inMaxCount Integer* 0 - Number of last objects that are remembered
Input value
inReset Bool Reset accumulator state
Output value
outObjectArray <T>Array Array of most recent objects

The type of this filter is defined using the type variable T which represents any valid type. Read more.

Examples

Description of usage of this filter can be found in examples and tutorial: IO Serial Port Communicator.

However, to implement basic example perform following steps:
  • Using CreateArray create 1x3 dimensional array [1, 2, 3].
  • Connect created vector to inObject input of the filter
  • LastMultipleObjects will iterate through each element in inObject and will return outObjectArray of previous elements for each element of inObject, with the size of smaller of the numbers:
  • {element index(non zero-based), inMaxCount}.
  • Result will be as follows (red numbers are currently iterated elements, while green ones are result):

inMaxCount= 1
[1, 2, 3] [1]
[1, 2, 3] [2]
[1, 2, 3] [3]


inMaxCount = 2
[1, 2, 3] [1]
[1, 2, 3] [1, 2]
[1, 2, 3] [2, 3]

inMaxCount = 3
[1, 2, 3] [1]
[1, 2, 3] [1, 2]
[1, 2, 3] [1, 2, 3]

Complexity Level

This filter is available on Basic Complexity Level.