Block level functions

To interface smoothly with Embed, Embed can call eight Pascal-style functions that share the base DLL function name and have an event code suffix corresponding to an Embed event. You should supply a function for each event that you want your DLL code to manage. The additional functions are described below:

Function name


When it’s called


Block time step

Each simulation time step


Block event handler

On occurrence of a block-related event


Block parameter allocation

Block creation


Block parameter change

Right button click


Block parameter initialization

Immediately after userBlockPA()


Block simulation end

Simulation end time

userBlock SS()

Block simulation start

Simulation start time


Block window painting

All stages of block window lifecycle


The term userBlock is a placeholder for your DLL base function name. You specify the DLL base function name when you bind the DLL to a userFunction block.

You can have any number of user-written blocks in a single DLL file.

All definitions are stored in VSUSER.H. This file should be included in every user DLL.