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-4000000.
Size
Defines overall size of the memory which block reads data from. Value must be a multiple of Vector size.
Properties : Type int, range 1-4000000.
Vector size
Defines size of signal read by block.
Properties : Type int, range 1-4000000.
Init value
Allows user to initialize memory with provided value. If single number is provided then whole memory will be initialized with that number. When vector of numbers is provided then only first indexes of memory are initialized. Vector type is only allowed with Mode 1 (circular read, use init value) and Size equal to Vector Size parameter, it could be used in order to set PID regulator settings through single mdaq_mem_read block.
Example usage:
Size: 6, Vector size: 3, Init value: 3.14 - result: memory = [3.14 3.14 3.14 3.14 3.14 3.14]
Size: 3, Vector size: 3, Init value: [1 2 3] - result: memory = [1 2 3]
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.