(saveFormat "2.0")
(date "Tue 19/Dec/1995 09:23:39 MST")
(veerev "3.2")
(platform "HP9000s700")
(SaveCF no)
(filterNAN 0)
(component 0 ROOTCONTEXT
 (name "Multiple User Function Calls")
 (implementation
  (UserFunctions
   (nextID 1)
   (context 0
	(name "noiseUF")
	(interface
	 (input 1
	  (name "Y")
	  (optional yes)
	 )
	 (output 1
	  (type data)
	  (name "Y+Noise")
	  (lock constraints)
	  (optional yes)
	 )
	)
	(implementation
	 (locked no)
	 (trigMode deg)
	 (nextID 3)
	 (component 0 VNOISEGENERATOR
	  (interface
	   (input 1
		(name "Amplitude")
		(tag "Amplitude")
		(requires
		 (datatype Real)
		 (shape "Scalar")
		)
		(lock constraints)
		(optional yes)
		(buffer YES)
	   )
	   (output 1
		(name "noise WF")
		(tag "noiseWF")
		(lock name constraints)
	   )
	  )
	  (implementation
	   (amplitude 0.281)
	   (numPoints 256)
	   (interval 0.02)
	  )
	 )
	 (component 1 FORMULA
	  (name " + ")
	  (interface
	   (input 1
		(name "X")
		(optional yes)
	   )
	   (input 2
		(name "Y")
		(optional yes)
	   )
	   (output 1
		(name "Result")
		(lock name constraints)
	   )
	  )
	  (implementation
	   (expr 1 "X+Y")
	  )
	 )
	 (component 2 FROMGLOBAL
	  (interface
	   (output 1
		(name "Data")
		(tag "Data")
		(lock name constraints)
	   )
	  )
	  (implementation
	   (globalName ampl)
	  )
	 )
	 (configuration
	  (connect D2:1 D0:1)
	  (connect D0:1 D1:1)
	  (connect I1:1 D1:2)
	  (connect D1:1 O1:1)
	 )
	)
	(viewFor 0
	 (active detail)
	 (detail
	  (geometry -241 -163 453 303)
	  (configuration
	   (viewFor 0
		(active detail)
		(icon
		 (iconImage "virtual.icn")
		)
		(detail
		 (geometry -112 -1 140 86)
		)
		(terminals on)
	   )
	   (viewFor 1
		(active icon)
		(icon
		 (geometry 140 100 46 25)
		)
		(detail
		)
		(terminals on)
	   )
	   (viewFor 2
		(active detail)
		(icon
		)
		(detail
		 (geometry -201 -129 89 62)
		)
		(terminals on)
	   )
	   (connect D2:1 D0:1
		(points 6 -70 -98 -37 -98 -37 -58 -217 -58 -217 42 -195 42)
	   )
	   (connect D0:1 D1:1
		(points 6 100 42 133 42 133 82 123 82 123 102 137 102)
	   )
	   (connect I1:1 D1:2
		(points 4 -241 -16 -227 -16 -227 122 137 122)
	   )
	   (connect D1:1 O1:1
		(points 4 188 112 203 112 203 -16 211 -16)
	   )
	  )
	  (stackingOrder 0 2 1)
	 )
	 (terminals on)
	)
   )
  )
  (retainGlobals YES)
  (locked no)
  (trigMode rad)
  (nextID 14)
  (component 0 SLIDER
   (name "ampl")
   (interface
	(output 1
	 (name "Real")
	 (lock name constraints)
	)
   )
   (implementation
	(value Real
	 (values range 0 1)
	 (data  0.281)
	)
	(initValue Real
	 (data  0)
	)
	(detents 0.001)
   )
  )
  (component 1 YPLOT
   (name "XY Trace")
   (interface
	(input 1
	 (name "Trace1")
	 (lock constraints)
	)
   )
   (implementation
	(tracePin 1)
	(graphMode rectangular)
   )
  )
  (component 2 CALL
   (name "Call Function")
   (interface
	(input 1
	 (name "Y")
	 (optional yes)
	)
	(output 1
	 (name "Y+Noise")
	 (lock name constraints)
	 (optional yes)
	)
   )
   (implementation
	(callFunc "noiseUF")
	(parmMode "rev2x_22rules")
   )
  )
  (component 3 TOGLOBAL
   (interface
	(input 1
	 (name "Data")
	 (tag "Data")
	)
   )
   (implementation
	(globalName ampl)
   )
  )
  (component 4 FORMULA
   (interface
	(input 1
	 (name "Y")
	 (optional yes)
	)
	(output 1
	 (name "Result")
	 (lock name constraints)
	)
   )
   (implementation
	(expr 1 "abs(noiseUF(Y))")
   )
  )
  (component 5 YPLOT
   (name "XY Trace")
   (interface
	(input 1
	 (name "Trace1")
	 (lock constraints)
	)
   )
   (implementation
	(tracePin 1)
	(graphMode rectangular)
   )
  )
  (component 6 YPLOT
   (name "XY Trace")
   (interface
	(input 1
	 (name "Trace1")
	 (lock constraints)
	)
   )
   (implementation
	(tracePin 1)
	(graphMode rectangular)
   )
  )
  (component 7 VFUNCTIONGENERATOR
   (name "Function Generator")
   (interface
	(output 1
	 (name "Func")
	 (lock name constraints)
	)
   )
   (implementation
	(function Sine)
	(frequency 100)
	(amplitude 1)
	(dcOffset 0)
	(phaseShift 0)
	(numPoints 256)
	(interval 0.02)
	(degRad Rad)
	(errorOnAlias 1)
   )
  )
  (component 8 FORMULA
   (interface
	(input 1
	 (name "Y")
	 (optional yes)
	)
	(output 1
	 (name "Result")
	 (lock name constraints)
	)
   )
   (implementation
	(expr 1 "abs(noiseUF(Y))-1.5")
   )
  )
  (component 11 CONTEXT
   (name "Press For")
   (description2 10
	"This User Object is the outermost \"context\""
	"for the InfoAbout help device.  Within this"
	"device is the pop-up panel containing the info"
	"Notepad.  If all you can see is a device with"
	"\"Press For\", you should double-click the left"
	"mouse button on the Press For to restore the"
	"Panel View of the device.  To see how this device"
	"operates, click on the Info About button first,"
	"then press the Detail button in the \"Press For\""
	"title bar."
   )
   (implementation
	(locked no)
	(trigMode deg)
	(nextID 4)
	(component 0 TOGGLE25
	 (name "Info About")
	 (description2 17
	  "This is a toggle device with the name changed to"
	  "reflect it\'s function.  The output of the device"
	  "is \"0\" when the button is up, and \"1\" when the"
	  "button is down.  "
	  ""
	  "A Reset Control Input terminal has been added to"
	  "to always pop the button back out after showing"
	  "the pop-up help (Info About This Example) User"
	  "Object."
	  ""
	  "The Toggle has set the \"AutoExecute\" option to let"
	  "it operate even when the RUN button in the title"
	  "bar has not been pressed.  Note, however, that"
	  "AutoExecute only works when no other threads are"
	  "operating, either from their Start buttons or from"
	  "the RUN button."
	  ""
	 )
	 (interface
	  (input 1
	   (type control)
	   (name "Reset")
	   (lock name constraints)
	   (optional yes)
	  )
	  (output 1
	   (lock name constraints)
	  )
	 )
	 (implementation
	  (value Int32
	   (data  0)
	  )
	  (autoTrigger on)
	  (initValue Int32
	   (data  0)
	  )
	 )
	)
	(component 2 CONTEXT
	 (name "Info About This Example")
	 (description2 10
	  "This is a User Object that has both a detail view"
	  "and a Panel view.  If this device is visible as"
	  "an icon, you must double-click the left mouse"
	  "button to \"open up\" the non-iconic view."
	  ""
	  "Since the User Object has both a Panel and Detail"
	  "view, when you double-click on the icon, you will"
	  "first see the Panel view.  To see the components"
	  "of the User Object, press the Detail button in"
	  "the \"Info About This Example\" title bar."
	 )
	 (implementation
	  (locked no)
	  (trigMode deg)
	  (nextID 2)
	  (popupMoveable)
	  (component 0 NOTE
	   (name "NotePad")
	   (description2 11
		"This notepad is displayed as a Show on Execute"
		"panel to present the information to the reader."
		""
		"It has been \"Added to Panel\" of the \"Info About"
		"This Example\" user object, thus it is not "
		"necessary to keep it as an open device inside the"
		"Detail view; you can edit the notepad from the"
		"Panel view of this User Object.  You can also"
		"set/clear the \"Enable Edit\" flag in this Notepad\'s"
		"Object Menu to keep the pop-up notepad from being"
		"altered by the user."
	   )
	   (implementation
		(text2 17
		  "PURPOSE: Illustrates multiple calls to a User Function, using the Call "
		  "    Function object as well as expressions calling the User Function by name."
		  ""
		  "USER INPUT REQUIRED:  Press \"Run\"."
		  ""
		  "EXPLANATION:"
		  "\tA User Function can be called by either a Call Function object or from "
		  "    any expression evaluated at run time.  This example shows a Call "
		  "    Function object and two Formula objects that call a User Function.  The "
		  "    Call Function object calls the User Function noiseUF and returns a sine "
		  "    wave with an added noise component.  The expression abs(noiseUF(Y)) in "
		  "    the first Formula object returns the absolute value of the waveform "
		  "    returned by the User Function noiseUF.  Thus, the displayed noisy sine "
		  "    wave is \"rectified\" in the positive direction.  The expression "
		  "    abs(noiseUF(Y))-1.5 in the second Formula object does the same, but also "
		  "    adds a negative \"dc offset\" to the waveform.  Note that the sequence pins"
		  "\tare used to ensure correct propagation with the global variable."
		)
	   )
	  )
	  (component 1 CONFIRM25
	   (name "DONE")
	   (description2 7
		"This tiny \"thread\" begins running when the "
		"enclosing UserObject is executed.  When the user"
		"acknowledges the OK/DONE button, there is nothing"
		"left to execute, so the thread ends.  Since there"
		"are not other threads running, the User Object"
		"is completed and will exit, removing the Show on"
		"Execute pop-up display."
	   )
	   (interface
		(output 1
		 (name "Go")
		 (lock name constraints)
		)
	   )
	   (implementation
		(component enterButton yes)
		(component escapeButton yes)
	   )
	  )
	  (configuration
	  )
	  (ShowOnExecPanel
	   (geometry 4 35 809 463)
	   (panel
		(geometry 38 129 805 442)
		(widget 0 detail
		 (title off)
		 (borderStyle flat)
		 (geometry 44 134 788 385)
		 (editing disabled)
		)
		(widget 1 detail
		 (title off)
		 (borderStyle flat)
		 (geometry 404 526 68 35)
		)
	   )
	  )
	 )
	)
	(component 3 IFTHENELSE
	 (name "!= 0")
	 (description2 5
	  "If no threads are running, the Toggle can generate"
	  "it\'s output data whenever the button is changed"
	  "(using the Toggle\'s AutoExecute mode).  In this"
	  "case, either the User Object is executed or the"
	  "Autoexecute sequence terminates."
	 )
	 (interface
	  (input 1
	   (name "A")
	   (optional yes)
	  )
	  (output 1
	   (name "Then")
	   (lock name constraints)
	  )
	  (output 2
	   (name "Else")
	   (lock name constraints)
	  )
	 )
	 (implementation
	  (expr "a!=0")
	 )
	)
	(configuration
	 (connect D1:0 D0:1)
	 (connect D2:1 D1:0)
	 (connect D0:1 D2:1)
	)
   )
  )
  (component 12 NOTE
   (implementation
   )
  )
  (configuration
   (connect D2:1 D1:1)
   (connect D3:0 D2:0)
   (connect D7:1 D2:1)
   (connect D0:1 D3:1)
   (connect D2:0 D4:0)
   (connect D7:1 D4:1)
   (connect D4:1 D5:1)
   (connect D8:1 D6:1)
   (connect D4:0 D8:0)
   (connect D7:1 D8:1)
  )
 )
 (viewFor -1
  (active detail)
  (detail
   (geometry 0 53 900 447)
   (configuration
	(viewFor 0
	 (active detail)
	 (icon
	  (geometry 0 0 46 0)
	 )
	 (detail
	  (geometry 65 105 110 150)
	  (layout vertical)
	  (fastmode off)
	 )
	)
	(viewFor 1
	 (active detail)
	 (icon
	  (iconImage "display.icn")
	 )
	 (detail
	  (geometry 604 218 153 124)
	  (displayMode graphOnly)
	  (graphType cartesian)
	  (gridType off)
	  (scale 0
	   (name "Y name")
	   (domainName "X name")
	   (pen 3)
	   (show 1)
	   (range -1.5 1.5 4 linear)
	  )
	  (domain 0 0.02 4 linear)
	  (trace 0 onScale 0
	   (name "Trace1")
	   (pen 4)
	   (lineType 1)
	   (pointType 0)
	  )
	 )
	)
	(viewFor 2
	 (active detail)
	 (icon
	 )
	 (detail
	  (geometry 296 282 199 77)
	 )
	 (terminals on)
	)
	(viewFor 3
	 (active detail)
	 (icon
	 )
	 (detail
	  (geometry 371 149 89 62)
	 )
	 (terminals on)
	)
	(viewFor 4
	 (active detail)
	 (icon
	  (iconImage "formula.icn")
	 )
	 (detail
	  (geometry 322 423 157 55)
	 )
	 (terminals on)
	)
	(viewFor 5
	 (active detail)
	 (icon
	  (iconImage "display.icn")
	 )
	 (detail
	  (geometry 604 388 153 124)
	  (displayMode graphOnly)
	  (graphType cartesian)
	  (gridType off)
	  (scale 0
	   (name "Y name")
	   (domainName "X name")
	   (pen 3)
	   (show 1)
	   (range -1.5 1.5 4 linear)
	  )
	  (domain 0 0.02 4 linear)
	  (trace 0 onScale 0
	   (name "Trace1")
	   (pen 4)
	   (lineType 1)
	   (pointType 0)
	  )
	 )
	)
	(viewFor 6
	 (active detail)
	 (icon
	  (iconImage "display.icn")
	 )
	 (detail
	  (geometry 604 558 153 124)
	  (displayMode graphOnly)
	  (graphType cartesian)
	  (gridType off)
	  (scale 0
	   (name "Y name")
	   (domainName "X name")
	   (pen 3)
	   (show 1)
	   (range -1.5 1.5 4 linear)
	  )
	  (domain 0 0.02 4 linear)
	  (trace 0 onScale 0
	   (name "Trace1")
	   (pen 4)
	   (lineType 1)
	   (pointType 0)
	  )
	 )
	)
	(viewFor 7
	 (active icon)
	 (icon
	  (geometry 42 411 177 78)
	  (iconImage "virtual.icn")
	 )
	 (detail
	  (geometry 40 502 201 196)
	 )
	 (terminals on)
	)
	(viewFor 8
	 (active detail)
	 (icon
	  (iconImage "formula.icn")
	 )
	 (detail
	  (geometry 307 543 187 55)
	 )
	 (terminals on)
	)
	(viewFor 11
	 (active panel)
	 (icon
	  (geometry 55 908 110 25)
	 )
	 (panel
	  (geometry 531 102 319 77)
	  (widget 0 detail
	   (title off)
	   (borderStyle flat)
	   (geometry 634 120 114 39)
	   (scaled on)
	   (format button)
	  )
	 )
	 (detail
	  (geometry 4 75 912 591)
	  (configuration
	   (viewFor 0
		(active detail)
		(icon
		 (geometry -40 -7 81 15)
		)
		(detail
		 (geometry 203 301 114 39)
		 (scaled on)
		 (format button)
		)
		(title off)
	   )
	   (viewFor 2
		(active icon)
		(icon
		 (geometry 372 348 217 25)
		)
		(detail
		 (geometry 47 150 866 520)
		 (configuration
		  (viewFor 0
		   (active detail)
		   (icon
			(geometry 440 416 78 25)
		   )
		   (detail
			(geometry 56 202 848 437)
			(editing enabled)
		   )
		  )
		  (viewFor 1
		   (active detail)
		   (icon
			(geometry -22 -7 45 15)
		   )
		   (detail
			(geometry 451 472 58 37)
		   )
		   (title off)
		  )
		 )
		 (stackingOrder 1 0)
		)
	   )
	   (viewFor 3
		(active icon)
		(icon
		 (geometry 377 308 46 25)
		)
		(detail
		 (geometry 349 328 73 64)
		)
		(terminals on)
	   )
	   (connect D1:0 D0:1
		(points 5 480 375 480 390 180 390 180 320 200 320)
	   )
	   (connect D2:1 D1:0
		(points 3 425 310 480 310 480 345)
	   )
	   (connect D0:1 D2:1
		(points 2 319 320 374 320)
	   )
	  )
	  (stackingOrder 0 2 1)
	 )
	)
	(viewFor 12
	 (active icon)
	 (icon
	  (geometry 31 656 338 48)
	  (iconImage "disclaim.icn")
	  (label off)
	 )
	 (detail
	  (geometry 830 250 200 100)
	  (editing enabled)
	 )
	)
	(connect D2:1 D1:1
	 (points 4 557 320 580 320 580 280 601 280)
	)
	(connect D3:0 D2:0
	 (points 2 410 213 410 261)
	)
	(connect D7:1 D2:1
	 (points 4 221 450 240 450 240 320 263 320)
	)
	(connect D0:1 D3:1
	 (points 2 177 180 328 180)
	)
	(connect D2:0 D4:0
	 (points 2 410 361 410 402)
	)
	(connect D7:1 D4:1
	 (points 2 221 450 289 450)
	)
	(connect D4:1 D5:1
	 (points 2 531 450 601 450)
	)
	(connect D8:1 D6:1
	 (points 4 546 570 570 570 570 620 601 620)
	)
	(connect D4:0 D8:0
	 (points 2 410 480 410 522)
	)
	(connect D7:1 D8:1
	 (points 4 221 450 240 450 240 570 274 570)
	)
   )
   (stackingOrder 5 10 6 1 9 0 2 4 8 3
	 7)
  )
  (titleBg "Gray")
  (titleFg "Black")
  (numberFormats
   (realFormat standard)
   (realSigDigits 4)
   (realRadixSpec 4)
   (integerBase decimal)
  )
 )
)
