Logging Data on a MCU with Embed

Markus_20691
Markus_20691 Altair Community Member
edited November 2023 in Community Q&A

Dear Altair Embed Support Team,
I have another question regarding the use of Embed:
I would like to know, if it is possible to log data from a sensor on the Target interface (F28069M) in a table and transfer the table (or dataset) to the host-computer.
Is something like this possible?

Kind regards 

Markus 

Answers

  • Anthony Boon_20414
    Anthony Boon_20414
    Altair Employee
    edited October 2023

    Hi Markus,

    This is certainly possible and there are many ways to do this. Perhaps the simplest way is to write the data to a monitor buffer, triggered at the desired data rate, and include a corresponding monitor buffer read block in your Embed target interface diagram. The data can then be manipulated in any desired way within the target interface diagram for analytical or graphical analysis.

  • Markus_20691
    Markus_20691 Altair Community Member
    edited November 2023

    Hallo Anthony,

    I have a question regarding the use of the Monitor-Buffer-Write-Block:
    Every time I trigger the Write-Block, a new set of data is buffered into the
    block. That means, when the trigger is low no more data can bufferd into the
    buffer-write-block? Or can I write into it until the buffer is full, regardless if the trigger is still high?
    How do I write a new dataset into the block?
    I ask, because I have the problem that I get a data vector (with a buffersize of 1000), in which I have twelve times the exact same value before a new value comes up.

    Thank you for help

    Kind regards 

    Markus

  • Anthony Boon_20414
    Anthony Boon_20414
    Altair Employee
    edited November 2023

    Hi Markus,

    When you trigger the monitor buffer block, the block will be written to at the diagram execution rate until full. To empty the monitor buffer, you need to read it out in the target interface diagram and the monitor buffer will fill up again on the next trigger.

    If you have repeatedly twelve times the same consecutive data in the monitor buffer, then the process being written is executing at twelve times a slower rate than the diagram rate. You can overcome this by putting the monitor buffer in its own compound block and run that block at 12 times a slower rate by setting the "Local time step" in the compound properties:

    image

    Make sure the trigger signal is long enough to be seen at the slower compound block rate. If you have multiple monitor buffer blocks, you can ensure synchronisation by using the monitor buffer empty blocks ANDed with the trigger signal so that the monitor blocks will be triggered only after all have been read out.