Model { Name "quanserlib" Version 5.0 SaveDefaultBlockParams on SampleTimeColors off LibraryLinkDisplay "none" WideLines off ShowLineDimensions off ShowPortDataTypes off ShowLoopsOnError on IgnoreBidirectionalLines off ShowStorageClass off ExecutionOrder off RecordCoverage off CovPath "/" CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeVarName "covCumulativeData" CovCumulativeReport off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" MinMaxOverflowArchiveMode "Overwrite" BlockNameDataTip off BlockParametersDataTip on BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off Created "Fri Jul 16 09:55:35 1999" Creator "Raymond de Callafon" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "callafon" ModifiedDateFormat "%" LastModifiedDate "Tue Feb 17 22:59:12 2004" ModelVersionFormat "1.%" ConfigurationManager "none" SimParamPage "RTW" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" TryForcingSFcnDF off ExtModeMexFile "ext_xpc" 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 ExtModeSkipDownloadWhenConnect off ExtModeLogAll on ExtModeAutoUpdateStatusClock on BufferReuse on RTWExpressionDepthLimit 5 SimulationMode "normal" Solver "ode4" SolverMode "Auto" StartTime "0.0" StopTime "0.2" MaxOrder 5 MaxStep "auto" MinStep "auto" MaxNumMinSteps "-1" InitialStep "auto" FixedStep "1e-3" RelTol "1e-3" AbsTol "auto" OutputOption "RefineOutputTimes" OutputTimes "[]" Refine "1" LoadExternalInput off ExternalInput "[t, u]" LoadInitialState off InitialState "xInitial" SaveTime on TimeSaveName "tout" SaveState on StateSaveName "xout" SaveOutput on OutputSaveName "yout" SaveFinalState off FinalStateName "xFinal" SaveFormat "Array" Decimation "1" LimitDataPoints off MaxDataPoints "1000" SignalLoggingName "sigsOut" ConsistencyChecking "none" ArrayBoundsChecking "none" AlgebraicLoopMsg "warning" BlockPriorityViolationMsg "warning" MinStepSizeMsg "warning" InheritedTsInSrcMsg "warning" DiscreteInheritContinuousMsg "warning" MultiTaskRateTransMsg "error" SingleTaskRateTransMsg "none" CheckForMatrixSingularity "none" IntegerOverflowMsg "warning" Int32ToFloatConvMsg "warning" ParameterDowncastMsg "error" ParameterOverflowMsg "error" ParameterPrecisionLossMsg "warning" UnderSpecifiedDataTypeMsg "none" UnnecessaryDatatypeConvMsg "none" VectorMatrixConversionMsg "none" InvalidFcnCallConnMsg "error" SignalLabelMismatchMsg "none" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" SfunCompatibilityCheckMsg "none" RTWInlineParameters off BlockReductionOpt off BooleanDataType off ConditionallyExecuteInputs on ParameterPooling on OptimizeBlockIOStorage off ZeroCross on AssertionControl "UseLocalSettings" ProdHWDeviceType "Microprocessor" ProdHWWordLengths "8,16,32,32" RTWSystemTargetFile "xpctarget.tlc" RTWTemplateMakefile "xpc_default_tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off RTWRetainRTWFile off TLCProfiler off TLCDebug off TLCCoverage off TLCAssertion off RTWOptions " -aEnforceIntegerDowncast=1 -aExtMode=1 -aFoldNonRo" "lledExpr=1 -aForceParamTrailComments=0 -aGenerateComments=1 -aGenerateReport=" "0 -aIncDataTypeInIds=0 -aIncHierarchyInIds=0 -aInlineInvariantSignals=0 -aInl" "ineParameters=0 -aInlinedPrmAccess=\"Literals\" -aLocalBlockOutputs=0 -aMaxRT" "WIdLen=31 -aPrefixModelToSubsysFcnNames=1 -aRL32IRQSourceModifier=\"Timer\" -" "aRL32LogBufSizeModifier=100000 -aRL32LogTETModifier=1 -aRL32ModeModifier=\"Re" "al-Time\" -aRL32ObjectName=\"tg\" -aRTWVerbose=1 -aRollThreshold=5 -aShowElim" "inatedStatements=1 -axPCIOIRQSlot=-1 -axPCIRQSourceBoard=\"None/Other\" -axpc" "DblBuff=0 -axpcObjCom=0" BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Helvetica" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } BlockParameterDefaults { Block { BlockType "S-Function" FunctionName "system" PortCounts "[]" SFunctionModules "''" } } 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 "quanserlib" Location [35, 84, 564, 393] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType "S-Function" Name "MultiQ AD" Ports [0, 1] Position [45, 34, 160, 116] FunctionName "admultiq3" Parameters "convBaseAddr, Channels, [SampleTime SampleOffse" "t]" MaskType "ADmultiQ3" MaskDescription "MultiQ3 AD\nQuanser\nAnalog Input\n(R.A. de Cal" "lafon, Dept. of MAE, UCSD)" MaskHelp "This S-function implements the driver for the A" "D operation of the MultiQ3 ISA board\nby Quanser. The first parameter is the " "channel vector = vector of all the channel you\nlike to sample, e.g. [1 2] to" " use channels 1 and 2. The second parameter is the \nsampling time. The third" " parameter is the base address of the board (typically 0x320).\n\nNote that t" "he board has a fixed range of -5/+5 Volts, 13 bit (12 bit signed) conversion." "\nIn specifying the sampling time, keep in mind that the conversion of each c" "hannel\ntakes approximately 11 micro seconds." MaskPromptString "Channel vector|Sample time|Base address (0xd000" ")" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskToolTipString "on,on,on" MaskVarAliasString ",," MaskVariables "Channels=@1;Sample=@2;BaseAddr=&3;" MaskInitialization "% Check Base Address\n\nBaseAddr(find(BaseAddr=" "='''')) = [];\nindex = findstr(lower(BaseAddr),'0x');\nif ~isempty(index) & i" "ndex==1\n BaseAddr = BaseAddr(3:end);\n baLength = length (BaseAddr);\n ba" "seStringMember = [abs('0'):abs('9'),abs('a'):abs('f'),abs('A'):abs('F')];\n " "for i = 1:baLength\n if ~ismember(BaseAddr(i),baseStringMember)\n err" "ordlg ('Invalid character in hexadecimal string');\n set_param(gcb,'" "MaskDisplay','disp(''MultiQ3 AD\\nQuanser\\nERROR in parameters'');');" " \n error ('Invalid character in hexadecimal string'); " " \n end\n end\n convBaseAddr = hex2dec(BaseAddr);\nelse\n convBaseAddr " "= str2num(BaseAddr);\nend\n\n% Check channel vector\n\nMAX_CHANNEL=8;\nchnLen" "gth = length(Channels);\nfor i=1:chnLength\n if (Channels(i)<1 | Channels(i" ")>MAX_CHANNEL)\n errordlg(['The number of channels must be in the range " "1..',num2str(MAX_CHANNEL)]);\n set_param(gcb,'MaskDisplay','disp(''M" "ultiQ3 AD\\nQuanser\\nERROR in parameters'');'); \n error(['The" " number of channels must be in the range 1..',num2str(MAX_CHANNEL)]);\n end" "\nend\n\n% Check sample time\n\nsampleLength = length (Sample);\n\nif (sample" "Length > 2)\n errordlg ('Sample length vector cannot exceed two elements');" "\n set_param(gcb,'MaskDisplay','disp(''MultiQ3 AD\\nQuanser\\nERROR in param" "eters'');'); \n error ('Sample length vector cannot exceed two elem" "ents');\nend\n\nif (sampleLength == 2)\n SampleTime = Sample(1);\n SampleOf" "fset = Sample(2);\nelse\n SampleTime = Sample(1);\n SampleOffset = 0;\nend" "\n\n% Update Simulink Display\n\nchnDisplay=['disp(''MultiQ3 AD\\nQuanser\\nA" "nalog Input'');'];\nfor i = 1:chnLength\n chnDisplay = strcat(chnDisplay,'po" "rt_label(''output'', ');\n chnDisplay = strcat(chnDisplay,num2str (i));\n c" "hnDisplay = strcat(chnDisplay,' , ''');\n chnDisplay = strcat(chnDisplay, nu" "m2str (Channels(1,i)));\n chnDisplay = strcat(chnDisplay, ''') ');\nend\nset" "_param(gcb,'MaskDisplay',chnDisplay);\n" MaskDisplay "disp('MultiQ3 AD\\nQuanser\\nAnalog Input');por" "t_label('output',1 , '1')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "1|1e-3|0x320" } Block { BlockType "S-Function" Name "MultiQ DA" Ports [1] Position [335, 34, 450, 116] FunctionName "damultiq3" Parameters "convBaseAddr, Channels, [SampleTime SampleOffse" "t]" MaskType "DAmultiQ3" MaskDescription "MultiQ3 DA\nQuanser\nAnalog Output\n(R.A. de Ca" "llafon, Dept. of MAE, UCSD)" MaskHelp "This S-function implements the driver for the D" "A operation of the MultiQ3 ISA board\nby Quanser. The first parameter is the " "channel vector = vector of all the channel you\nlike to convert to analog sig" "nals via sample/hold, e.g. [1 2] to use channels 1 and 2.\nThe second paramet" "er is the sampling time. The third parameter is the base \naddress of the boa" "rd (typically 0x320).\n\nNote that the board has a fixed range of -5/+5 Volts" ", 12 bit conversion.\nIn specifying the sampling time, keep in mind that the " "conversion of each channel\ntakes approximately 2 micro seconds." MaskPromptString "Channel vector|Sample time|Base address (0xd000" ")" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskToolTipString "on,on,on" MaskVarAliasString ",," MaskVariables "Channels=@1;Sample=@2;BaseAddr=&3;" MaskInitialization "% Check Base Address\n\nBaseAddr(find(BaseAddr=" "='''')) = [];\nindex = findstr(lower(BaseAddr),'0x');\nif ~isempty(index) & i" "ndex==1\n BaseAddr = BaseAddr(3:end);\n baLength = length (BaseAddr);\n ba" "seStringMember = [abs('0'):abs('9'),abs('a'):abs('f'),abs('A'):abs('F')];\n " "for i = 1:baLength\n if ~ismember(BaseAddr(i),baseStringMember)\n err" "ordlg ('Invalid character in hexadecimal string');\n set_param(gcb,'" "MaskDisplay','disp(''MultiQ3 DA\\nQuanser\\nERROR in parameters'');');" " \n error ('Invalid character in hexadecimal string'); " " \n end\n end\n convBaseAddr = hex2dec(BaseAddr);\nelse\n convBaseAddr " "= str2num(BaseAddr);\nend\n\n% Check channel vector\n\nMAX_CHANNEL=8;\nchnLen" "gth = length(Channels);\nfor i=1:chnLength\n if (Channels(i)<1 | Channels(i" ")>MAX_CHANNEL)\n errordlg(['The number of channels must be in the range " "1..',num2str(MAX_CHANNEL)]);\n set_param(gcb,'MaskDisplay','disp(''M" "ultiQ3 DA\\nQuanser\\nERROR in parameters'');'); \n error(['The" " number of channels must be in the range 1..',num2str(MAX_CHANNEL)]);\n end" "\nend\n\n% Check sample time\n\nsampleLength = length (Sample);\n\nif (sample" "Length > 2)\n errordlg ('Sample length vector cannot exceed two elements');" "\n set_param(gcb,'MaskDisplay','disp(''MultiQ3 DA\\nQuanser\\nERROR in param" "eters'');'); \n error ('Sample length vector cannot exceed two elem" "ents');\nend\n\nif (sampleLength == 2)\n SampleTime = Sample(1);\n SampleOf" "fset = Sample(2);\nelse\n SampleTime = Sample(1);\n SampleOffset = 0;\nend" "\n\n% Update Simulink Display\n\nchnDisplay=['disp(''MultiQ3 DA\\nQuanser\\nA" "nalog Input'');'];\nfor i = 1:chnLength\n chnDisplay = strcat(chnDisplay,'po" "rt_label(''input'', ');\n chnDisplay = strcat(chnDisplay,num2str (i));\n ch" "nDisplay = strcat(chnDisplay,' , ''');\n chnDisplay = strcat(chnDisplay, num" "2str (Channels(1,i)));\n chnDisplay = strcat(chnDisplay, ''') ');\nend\nset_" "param(gcb,'MaskDisplay',chnDisplay);\n" MaskDisplay "disp('MultiQ3 DA\\nQuanser\\nAnalog Input');por" "t_label('input',1 , '1')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "1|1e-3|0x320" } Annotation { Name "Quanser Library for xPC" Position [264, 245] } } }