How can I switch on and off a switch or element during a dynamic simulation?
Refer to the 2 example projects:
The first example 'EvtSwitchExt' shows, how to call a switch event (EvtSwitch) out of a DSL model (general model). In this example the switch events are predefinided in the DSL model 'Chopper Model', the event function in the 'Chopper Model' equations page is then calling and executing the predefined event using the name of the predefined event.
The second example 'EvtSwitchInt' shows, how to create and call switch events out of a DSL model. In this example the event is created, using the event type 'EvtSwitch' and executed by the event function in the 'Chopper Model' equations page. The switch events work on an element, in this case the 'general load', which is linked in a slot in the composite model. Note in this example the frame includes an slot for the load, which is used in the event command to assign the target element, in this example 'target=SwLoad' .
Both examples use the DSL command 'event', for more information refer to the User Manual, section 'DSL Special Functions'.