Reads MicroDAQ memory
This block reads MicroDAQ volatile memory. Block can be used to pass data to Standalone or Ext application generated from Xcos diagram.
In order to write data (which will be read by this block) mdaqMemWrite() toolbox function can be used.
Start index
Points to beginning of memory area.
Properties : Type int, range 1-250000.
Number of vectors
Defines overall size of the memory which block reads data from. That size can be calculated with the formula: Number of vectors * Vector Size.
Properties : Type int, range 1-(250000/Vector size).
Vector size
Defines size of signal read by block.
Properties : Type int, range 1-10000.
Init value
Allows the user to initialize memory with the provided value in Mode=1 and Mode=2. If a single number is provided then whole memory will be initialized with that number. Otherwise lenght of Init value vector has to be equal to (Vector size * Number of vectors).
Example usage:
Number of vectors: 2, Vector size: 3, Init value: 3.14 - result: memory = [3.14 3.14 3.14 3.14 3.14 3.14]
Number of vectors: 2, Vector size: 3, Init value: [1 2 3 4 5 6] - result: memory = [1 2 3 4 5 6]
Properties : Type float or vector.
Mode
Determines how data will be read - if "circular read" is enabled (value 1,3) block returns data in every model step, if the end of memory region is reached blocks starts from beginning of the memory area. If 'single read' (value 0,2) is enabled block returns data in every model step, if the end of memory region is reached block returns value from the end of memory region.
Values:
0 - single read, ignore init value.
1 - circular read, use init value.
2 - single read, use init value.
3 - circular read, ignore init value.
Properties : Type int, range 0-3.
Trigger input
If input is enabled (value 1), rising edge on trigger input will reset data index to index 0, block will reads data from the beginning.
Properties : Type int, 0 or 1.