Model { Name "triggeredsub" Version 3.00 SimParamPage "Solver" SampleTimeColors off InvariantConstants off WideVectorLines off ShowLineWidths off ShowPortDataTypes off StartTime "0.0" StopTime "8" SolverMode "Auto" Solver "VariableStepDiscrete" RelTol "1e-3" AbsTol "auto" Refine "1" MaxStep ".1" InitialStep "auto" FixedStep "auto" MaxOrder 5 OutputOption "RefineOutputTimes" OutputTimes "[]" LoadExternalInput off ExternalInput "[t, u]" SaveTime on TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput on OutputSaveName "yout" LoadInitialState off InitialState "xInitial" SaveFinalState off FinalStateName "xFinal" SaveFormat "Matrix" LimitMaxRows off MaxRows "1000" Decimation "1" AlgebraicLoopMsg "warning" MinStepSizeMsg "warning" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" InheritedTsInSrcMsg "warning" IntegerOverflowMsg "none" ConsistencyChecking "off" ZeroCross on SimulationMode "normal" BlockDataTips on BlockParametersDataTip on BlockAttributesDataTip off BlockPortWidthsDataTip off BlockDescriptionStringDataTip off BlockMaskParametersDataTip off BrowserShowLibraryLinks off BrowserLookUnderMasks off OptimizeBlockIOStorage on BufferReuse on BooleanDataType off RTWSystemTargetFile "grt.tlc" RTWInlineParameters off RTWRetainRTWFile off RTWTemplateMakefile "grt_default_tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off ExtModeMexFile "ext_comm" ExtModeBatchMode off ExtModeTrigType "manual" ExtModeTrigMode "oneshot" ExtModeTrigPort "1" ExtModeTrigElement "any" ExtModeTrigDuration 1000 ExtModeTrigHoldOff 0 ExtModeTrigDelay 0 ExtModeTrigDirection "rising" ExtModeTrigLevel 0 ExtModeArchiveMode "off" ExtModeAutoIncOneShot off ExtModeIncDirWhenArm off ExtModeAddSuffixToVar off ExtModeWriteAllDataToWs off ExtModeArmWhenConnect off Created "Mon Jul 27 10:37:45 1998" Creator "ldean" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "ctrapeni" ModifiedDateFormat "%" LastModifiedDate "Fri Sep 18 11:43:26 1998" ModelVersionFormat "1.%" ConfigurationManager "none" BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Helvetica" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } AnnotationDefaults { HorizontalAlignment "center" VerticalAlignment "middle" ForegroundColor "black" BackgroundColor "white" DropShadow off FontName "Helvetica" FontSize 10 FontWeight "normal" FontAngle "normal" } LineDefaults { FontName "Helvetica" FontSize 9 FontWeight "normal" FontAngle "normal" } System { Name "triggeredsub" Location [67, 110, 672, 574] Open on ToolBar on StatusBar on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType SubSystem Name "Either" Ports [1, 1, 0, 1, 0] Position [195, 267, 265, 313] FontName "Arial" FontSize 12 ShowPortLabels on Port { PortNumber 1 Name "Either" TestPoint off RTWStorageClass "Auto" } System { Name "Either" Location [282, 339, 472, 461] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In" Position [25, 73, 55, 87] Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType TriggerPort Name "Trigger" Ports [0, 0, 0, 0, 0] Position [85, 15, 105, 35] TriggerType "either" ShowOutputPort off OutputDataType "auto" } Block { BlockType Outport Name "Out" Position [135, 73, 165, 87] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "In" SrcPort 1 DstBlock "Out" DstPort 1 } } } Block { BlockType SubSystem Name "Falling" Ports [1, 1, 0, 1, 0] Position [195, 178, 265, 222] FontName "Arial" FontSize 12 ShowPortLabels on Port { PortNumber 1 Name "Falling" TestPoint off RTWStorageClass "Auto" } System { Name "Falling" Location [282, 339, 472, 461] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In" Position [25, 73, 55, 87] Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType TriggerPort Name "Trigger" Ports [0, 0, 0, 0, 0] Position [85, 15, 105, 35] TriggerType "falling" ShowOutputPort off OutputDataType "auto" } Block { BlockType Outport Name "Out" Position [135, 73, 165, 87] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "In" SrcPort 1 DstBlock "Out" DstPort 1 } } } Block { BlockType Ground Name "Ground" Position [341, 90, 359, 105] Orientation "up" ShowName off FontName "Arial" FontSize 12 } Block { BlockType SubSystem Name "More Info" Ports [0, 0, 0, 0, 0] Position [460, 371, 585, 449] DropShadow on ShowName off FontName "Arial" FontSize 12 ShowPortLabels on MaskDisplay "disp('Double click\\nhere for\\ninformation on" "\\nthis demonstration')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "More Info" Location [74, 136, 642, 495] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Annotation { Position [20, 40] HorizontalAlignment "left" VerticalAlignment "top" Text "This demonstration shows the concept of tri" "ggered subsystems and what the \ndifferent trigger types are. A triggered su" "bsystem is executed for one time step\nonly each time the trigger port transi" "tions from false to true in a certain direction.\nThe transition of the trigg" "er port may occur when the direction of the transition\nis rising, falling or" " both rising and falling.\n\nA rising transition occurs when the trigger sign" "al transitions from zero or below\nto a positive value. A falling transition" " occurs when the trigger signal transitions\nfrom zero or above to a negaive " "value.\n\nAfter running the simulation, look closely at the top plot in the s" "cope. This shows\na sine wave, a waveform and the grounded value of zero. A" "s the waveform\ntransitions through zero, each of the subsystems is triggered" " appropriately. The\noutput of each subsystem is equal to the current value " "of the sine wave at the time.\n\nTo help view exactly what is going on, you m" "ay want to turn the scope crosshair on.\nYou can do this by double clicking o" "n the block that says Scope Crosshair. This will\nenable a set of crosshairs" " on the scope so that s you move your mouse you can line\ncorresponding value" "s up across the plots." FontName "Arial" FontSize 12 } Annotation { Position [218, 22] Text "Triggered Subsystem Demonstration" FontSize 14 FontWeight "bold" } } } Block { BlockType SubSystem Name "More Info1" Ports [0, 0, 0, 0, 0] Position [30, 371, 154, 450] DropShadow on ShowName off OpenFcn "simcad(bdroot);" FontName "Arial" FontSize 12 ShowPortLabels on MaskDisplay "disp('Double click\\nhere for\\nSimulink Help')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "More Info1" Location [128, 280, 487, 453] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" } } Block { BlockType Mux Name "Mux1" Ports [3, 1, 0, 0, 0] Position [380, 56, 385, 94] ShowName off FontName "Arial" FontSize 12 Inputs "3" DisplayOption "bar" Port { PortNumber 1 Name "Source & Trigger" TestPoint off RTWStorageClass "Auto" } } Block { BlockType Scope Name "Outputs" Ports [4, 0, 0, 0, 0] Position [425, 165, 470, 220] StartFcn "open_system(gcbh)" FontName "Arial" FontSize 12 Floating off Location [720, 35, 1211, 743] Open on NumInputPorts "4" TickLabels "on" ZoomMode "on" List { ListType AxesTitles axes1 "%" axes2 "%" axes3 "%" axes4 "%" } Grid "on" TimeRange "8" YMin "-1.5~-1.5~-1.5~-1.5" YMax "1.5~1.5~1.5~1.5" SaveToWorkspace on SaveName "trigsubdata" DataFormat "Structure" LimitMaxRows off MaxRows "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType SubSystem Name "Rising" Ports [1, 1, 0, 1, 0] Position [195, 88, 260, 132] FontName "Arial" FontSize 12 ShowPortLabels on Port { PortNumber 1 Name "Rising" TestPoint off RTWStorageClass "Auto" } System { Name "Rising" Location [284, 341, 468, 454] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In" Position [20, 68, 50, 82] Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType TriggerPort Name "Trigger" Ports [0, 0, 0, 0, 0] Position [80, 15, 100, 35] TriggerType "rising" ShowOutputPort off OutputDataType "auto" } Block { BlockType Outport Name "Out" Position [130, 68, 160, 82] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "In" SrcPort 1 DstBlock "Out" DstPort 1 } } } Block { BlockType SignalGenerator Name "Signal Generator" Position [45, 50, 75, 80] ForegroundColor "red" ShowName off AttributesFormatString "Waveform: %\\nFreq: % %" FontName "Arial" FontSize 12 WaveForm "square" Amplitude "0.5" Frequency "1" Units "Hertz" } Block { BlockType Sin Name "Sine Wave" Position [45, 275, 75, 305] ForegroundColor "orange" AttributesFormatString "Freq: % rad/sec" FontName "Arial" FontSize 12 Amplitude "1" Frequency "8" Phase "0" SampleTime "0" } Block { BlockType SubSystem Name "SubSystem" Ports [0, 0, 0, 0, 0] Position [480, 172, 576, 220] NamePlacement "alternate" ShowName off OpenFcn "if strcmp(get_param(gcb,'sch'),'on'),val='off';" "else,val='on';end;set_param(gcb,'sch',val)" FontName "Arial" FontSize 12 ShowPortLabels on MaskType "Scope Crosshair" MaskDescription "Turn on/off the crosshair pointer on the scope " "named Outputs." MaskPromptString "Scope crosshair" MaskStyleString "checkbox" MaskTunableValueString "on" MaskEnableString "on" MaskVisibilityString "on" MaskVariables "sch=&1;" MaskInitialization "f=get_param([gcs '/Outputs'],'Figure');\nif str" "cmp(sch,'on'),\n ptr='fullcrosshair';\nelse,\n ptr= 'arrow';\nend\nset(f,'p" "ointer',ptr)\n" MaskDisplay "disp(['Scope\\nCrosshair\\n' sch])" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "off" System { Name "SubSystem" Location [146, 180, 902, 673] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" } } Line { SrcBlock "Signal Generator" SrcPort 1 Points [50, 0] Branch { Points [95, 0] Branch { DstBlock "Rising" DstPort trigger } Branch { DstBlock "Mux1" DstPort 1 } } Branch { Points [0, 95] Branch { Points [0, 87; 100, 0] DstBlock "Either" DstPort trigger } Branch { Points [100, 0] DstBlock "Falling" DstPort trigger } } } Line { SrcBlock "Sine Wave" SrcPort 1 Points [85, 0] Branch { Points [0, -90] Branch { DstBlock "Falling" DstPort 1 } Branch { Points [0, -90] DstBlock "Rising" DstPort 1 } } Branch { DstBlock "Either" DstPort 1 } Branch { Points [0, 45; 165, 0; 0, -260] DstBlock "Mux1" DstPort 2 } } Line { SrcBlock "Ground" SrcPort 1 DstBlock "Mux1" DstPort 3 } Line { Name "Rising" FontName "Arial" FontSize 12 Labels [0, 1] SrcBlock "Rising" SrcPort 1 Points [125, 0; 0, 75] DstBlock "Outputs" DstPort 2 } Line { Name "Falling" FontName "Arial" FontSize 12 Labels [0, 1] SrcBlock "Falling" SrcPort 1 DstBlock "Outputs" DstPort 3 } Line { Name "Either" FontName "Arial" FontSize 12 Labels [0, 0] SrcBlock "Either" SrcPort 1 Points [120, 0; 0, -75] DstBlock "Outputs" DstPort 4 } Line { Name "Source & Trigger" FontName "Arial" FontSize 12 SrcBlock "Mux1" SrcPort 1 Points [15, 0; 0, 95] DstBlock "Outputs" DstPort 1 } Annotation { Position [258, 27] Text "Triggered Subsystem Demonstration" FontName "Arial" FontSize 18 FontWeight "bold" } } }