You can use a two-input Max block, with one input being the signal itself, and a second being the output of the Max block being fed though a Memory block. Attached is a simple example (PLECS Standalone) model and screenshots. Let me know if you have any questions.
overall_maximum_of_signal.plecs (9.48 KB)

