(saveFormat "2.0")
(date "Tue 19/Dec/1995 09:22:43 MST")
(veerev "3.2")
(platform "HP9000s700")
(SaveCF no)
(filterNAN 0)
(component 0 ROOTCONTEXT
 (name "Using Wait For SRQ")
 (implementation
  (retainGlobals YES)
  (locked no)
  (trigMode deg)
  (nextID 23)
  (component 0 ONCYCLE
   (name "On Cycle")
   (interface
	(output 1
	 (lock name constraints)
	)
   )
   (implementation
	(cycle 2)
   )
  )
  (component 1 ONCYCLE
   (interface
	(output 1
	 (lock name constraints)
	)
   )
   (implementation
	(cycle 1)
   )
  )
  (component 2 REPEATUNTILBREAK
   (interface
	(output 1
	 (name "Continuous")
	 (lock name constraints)
	)
   )
  )
  (component 3 NOTE
   (name "Threads #2 & #3")
   (implementation
	(text2 7
	  "These threads just "
	  "count at different "
	  "rates.  They are here"
	  "to show that other"
	  "threads continue to "
	  "execute while a Wait"
	  "For SRQ is pending."
	)
   )
  )
  (component 4 COUNTER
   (interface
	(input 1
	 (name "Data")
	)
	(output 1
	 (name "Count")
	 (tag "Count")
	 (lock name constraints)
	)
   )
   (implementation
   )
  )
  (component 5 COUNTER
   (interface
	(input 1
	 (name "Data")
	)
	(output 1
	 (name "Count")
	 (tag "Count")
	 (lock name constraints)
	)
   )
   (implementation
   )
  )
  (component 6 TEXTDISPLAY
   (name "Number")
   (interface
	(input 1
	 (name "Data")
	)
   )
   (implementation
   )
  )
  (component 7 TEXTDISPLAY
   (name "Number")
   (interface
	(input 1
	 (name "Data")
	)
   )
   (implementation
   )
  )
  (component 8 NOTE
   (name "Thread #4")
   (implementation
	(text2 2
	  "This thread"
	  "services SRQs."
	)
   )
  )
  (component 9 NOTE
   (name "Thread #1")
   (implementation
	(text2 4
	  "This thread simply"
	  "sets up the instruments"
	  "and enables them to"
	  "generate SRQs."
	)
   )
  )
  (component 10 NOTE
   (name "Info About")
   (implementation
	(text2 68
	  "Overview:"
	  "  This program shows how to service interrupts "
	  "using the \"Wait For SRQ\" object.  "
	  ""
	  "Details:"
	  "  This program uses the HP 54504A oscilloscope"
	  "  and the HP 3478A voltmeter to generate "
	  "  interrupts.  You MUST have these "
	  "  instruments connected to your computer to "
	  "  actually run this program. However, the "
	  "  techniques illustrated here apply to any"
	  "  instruments."
	  ""
	  "  Note that you must properly configure your "
	  "  instruments before running this program using"
	  "  \"I/O-->Instruments...\" menu selection."
	  ""
	  "This is how to operate the program:"
	  ""
	  "  1. Click on \"Run\" in the VEE title bar. "
	  "  This way, all threads will operate "
	  "  simultaneously to illustrate how execution"
	  "  time is shared among threads.  You may wish"
	  "  to set"
	  "            \"Edit-->Animate\""
	  "  to more clearly reveal this behavior."
	  ""
	  "  2. Press the SRQ front panel button on the"
	  "  HP 3478A or any key on the front panel of "
	  "  the HP 54504A."
	  ""
	  "This is how the program works:"
	  ""
	  "  When you click on \"Run\", VEE starts "
	  "  executing each thread.  Thread #1 resets"
	  "  the instruments and configures them to"
	  "  generate service requests (SRQs).  The "
	  "  HP 3478A will generate an SRQ when you "
	  "  press its SRQ front panel button; the "
	  "  HP 54504A will generate an SRQ when you "
	  "  press any of its front panel buttons.  "
	  "  Threads #2 & #3 continuously count at one "
	  "  and two second intervals respectively."
	  "  Thread #4 waits for an SRQ and reports the "
	  "  identity of the requesting device when an "
	  "  SRQ is received. "
	  ""
	  "  Note that Threads #2 & #3 continue to "
	  "  count while the \"Wait For SRQ\" is pending."
	  "  Once \"Wait For SRQ\" detects an SRQ, the "
	  "  subthread attached to it executes to the "
	  "  exclusion of all others; counting on "
	  "  Threads #2 & #3 does not resume until the"
	  "  SRQ has been serviced."
	  ""
	  "  Note that different steps are required to"
	  "  re-enable interrupts for different "
	  "  instruments as shown in Thread #4.  The "
	  "  HP 3478A requires only a serial poll to "
	  "  clear the RQS bit of the status byte and"
	  "  thus re-enable interrupts.  This is typical"
	  "  of older, simpler instruments.  The "
	  "  HP 54504A requires the additional step of"
	  "  clearing the event register that records"
	  "  front panel key press events.  This"
	  "  behavior is typical of more modern, complex "
	  "  instruments.  READ YOUR INSTRUMENT "
	  "  PROGRAMMING MANUAL CAREFULLY."
	)
   )
  )
  (component 11 NOTE
   (name "Warranty Disclaimer")
   (implementation
	(text2 4
	  "This example is provided as an"
	  "illustration \"as is\", and Hewlett-Packard"
	  "Company makes no warranty of any kind"
	  "with regard to this example."
	)
   )
  )
  (component 12 IFTHENELSE
   (interface
	(input 1
	 (name "A")
	 (optional yes)
	)
	(output 1
	 (name "Then")
	 (lock name constraints)
	)
	(output 2
	 (name "Else")
	 (lock name constraints)
	)
   )
   (implementation
	(expr "bit(a, 6)")
   )
  )
  (component 13 CONTEXT
   (name "HP 54504 did it")
   (implementation
	(locked no)
	(trigMode deg)
	(nextID 3)
	(popupMoveable)
	(component 0 LITERALCONSTANT
	 (interface
	  (output 1
	   (name "Text")
	   (lock name constraints)
	  )
	 )
	 (implementation
	  (value Text
	   (data  "SRQ from HP 54504A")
	  )
	  (initValue Text
	   (data  "")
	  )
	 )
	)
	(component 1 CONFIRM25
	 (name "Press To Continue...")
	 (interface
	  (output 1
	   (name "Go")
	   (lock name constraints)
	  )
	 )
	 (implementation
	  (component enterButton yes)
	  (component escapeButton yes)
	 )
	)
	(component 2 TEXTDISPLAY
	 (interface
	  (input 1
	   (name "Data")
	  )
	 )
	 (implementation
	 )
	)
	(configuration
	 (connect D2:0 D1:0)
	 (connect D0:1 D2:1)
	)
	(ShowOnExecPanel
	 (geometry 328 225 346 272)
	 (panel
	  (geometry 589 473 342 234)
	  (widget 2 detail
	   (title off)
	   (borderStyle flat)
	   (geometry 609 516 305 42)
	  )
	  (widget 1 detail
	   (title off)
	   (borderStyle flat)
	   (geometry 662 583 202 37)
	  )
	 )
	)
   )
  )
  (component 14 CONTEXT
   (name "Unknown did it")
   (implementation
	(locked no)
	(trigMode deg)
	(nextID 3)
	(popupMoveable)
	(component 0 CONFIRM25
	 (name "Press To Continue...")
	 (interface
	  (output 1
	   (name "Go")
	   (lock name constraints)
	  )
	 )
	 (implementation
	  (component enterButton yes)
	  (component escapeButton yes)
	 )
	)
	(component 1 TEXTDISPLAY
	 (interface
	  (input 1
	   (name "Data")
	  )
	 )
	 (implementation
	 )
	)
	(component 2 LITERALCONSTANT
	 (interface
	  (output 1
	   (name "Text")
	   (lock name constraints)
	  )
	 )
	 (implementation
	  (value Text
	   (data  "SRQ from unknown device")
	  )
	  (initValue Text
	   (data  "")
	  )
	 )
	)
	(configuration
	 (connect D1:0 D0:0)
	 (connect D2:1 D1:1)
	)
	(ShowOnExecPanel
	 (geometry 32767 32767 0 0)
	 (panel
	  (geometry 579 503 342 234)
	  (widget 1 detail
	   (title off)
	   (borderStyle flat)
	   (geometry 599 546 305 42)
	  )
	  (widget 0 detail
	   (title off)
	   (borderStyle flat)
	   (geometry 652 613 202 37)
	  )
	 )
	)
   )
  )
  (component 15 IODEVICE
   (name "Clear ESR(NOT LIVE)")
   (implementation
	(transactions 1
	  "WRITE TEXT \"*ESR?\" EOL"
	)
	(comp iopath "scope")
   )
  )
  (component 16 CONTEXT
   (name "HP 3478 did it")
   (implementation
	(locked no)
	(trigMode deg)
	(nextID 3)
	(popupMoveable)
	(component 0 CONFIRM25
	 (name "Press To Continue...")
	 (interface
	  (output 1
	   (name "Go")
	   (lock name constraints)
	  )
	 )
	 (implementation
	  (component enterButton yes)
	  (component escapeButton yes)
	 )
	)
	(component 1 TEXTDISPLAY
	 (interface
	  (input 1
	   (name "Data")
	  )
	 )
	 (implementation
	 )
	)
	(component 2 LITERALCONSTANT
	 (interface
	  (output 1
	   (name "Text")
	   (lock name constraints)
	  )
	 )
	 (implementation
	  (value Text
	   (data  "SRQ from HP 3478A")
	  )
	  (initValue Text
	   (data  "")
	  )
	 )
	)
	(configuration
	 (connect D1:0 D0:0)
	 (connect D2:1 D1:1)
	)
	(ShowOnExecPanel
	 (geometry 328 225 346 272)
	 (panel
	  (geometry 279 243 342 234)
	  (widget 1 detail
	   (title off)
	   (borderStyle flat)
	   (geometry 299 286 305 42)
	  )
	  (widget 0 detail
	   (title off)
	   (borderStyle flat)
	   (geometry 352 353 202 37)
	  )
	 )
	)
   )
  )
  (component 17 IFTHENELSE
   (interface
	(input 1
	 (name "A")
	 (optional yes)
	)
	(output 1
	 (name "Then")
	 (lock name constraints)
	)
	(output 2
	 (name "Else")
	 (lock name constraints)
	)
   )
   (implementation
	(expr "bit(a, 6)")
   )
  )
  (component 18 SERIALPOLL
   (name "Spoll: scope (hp54504a @ (NOT LIVE))")
   (interface
	(output 1
	 (name "status")
	 (lock name constraints)
	)
   )
   (implementation
	(comp iopath "scope")
	(comp busType 1)
	(comp event "spoll")
	(comp sense "nowait")
	(comp mask "0")
   )
  )
  (component 19 SERIALPOLL
   (name "Spoll: dvm (hp3478a @ (NOT LIVE))")
   (interface
	(output 1
	 (name "status")
	 (lock name constraints)
	)
   )
   (implementation
	(comp iopath "dvm")
	(comp busType 1)
	(comp event "spoll")
	(comp sense "nowait")
	(comp mask "0")
   )
  )
  (component 20 WAITSRQ
   (name "SRQ: hpib7")
   (interface
	(output 1
	 (name "SRQ")
	 (lock name constraints)
	)
   )
   (implementation
	(component gateway "This host")
	(component channel 7)
	(component busType 1)
	(component sense "wait")
	(component event "srq")
	(comp timeout 5)
   )
  )
  (component 21 IODEVICE
   (name "dvm (hp3478a @ (NOT LIVE))")
   (implementation
	(transactions 2
	  "EXECUTE CLEAR"
	  "WRITE TEXT \"M20\" EOL"
	)
	(comp iopath "dvm")
   )
  )
  (component 22 IODEVICE
   (name "scope (hp54504a @ (NOT LIVE))")
   (implementation
	(transactions 3
	  "WRITE TEXT \"*RST\" EOL"
	  "WRITE TEXT \"*CLS;*ESE 64;*SRE 32\" EOL"
	  "EXECUTE LOCAL"
	)
	(comp iopath "scope")
   )
  )
  (configuration
   (connect D1:1 D4:1)
   (connect D0:1 D5:1)
   (connect D5:1 D6:1)
   (connect D4:1 D7:1)
   (connect D18:1 D12:1)
   (connect D15:0 D13:0)
   (connect D12:2 D14:0)
   (connect D12:1 D15:0)
   (connect D17:1 D16:0)
   (connect D19:1 D17:1)
   (connect D17:2 D18:0)
   (connect D20:1 D19:0)
   (connect D2:1 D20:0)
   (connect D22:0 D21:0)
  )
 )
 (viewFor -1
  (active detail)
  (detail
   (geometry 0 53 900 447)
   (configuration
	(viewFor 0
	 (active detail)
	 (icon
	  (geometry 235 318 110 64)
	  (iconImage "loop.icn")
	 )
	 (detail
	  (geometry 280 583 160 34)
	 )
	)
	(viewFor 1
	 (active detail)
	 (icon
	  (geometry 55 498 110 64)
	  (iconImage "loop.icn")
	 )
	 (detail
	  (geometry 280 663 160 34)
	 )
	)
	(viewFor 2
	 (active icon)
	 (icon
	  (geometry 535 158 110 64)
	  (iconImage "loop.icn")
	 )
	 (detail
	 )
	 (terminals on)
	)
	(viewFor 3
	 (active detail)
	 (icon
	  (geometry 0 0 145 0)
	 )
	 (detail
	  (geometry 29 571 242 158)
	  (editing disabled)
	 )
	)
	(viewFor 4
	 (active icon)
	 (icon
	  (geometry 461 668 78 25)
	 )
	 (detail
	  (geometry 155 513 150 34)
	 )
	)
	(viewFor 5
	 (active icon)
	 (icon
	  (geometry 461 588 78 25)
	 )
	 (detail
	  (geometry 205 533 150 34)
	 )
	)
	(viewFor 6
	 (active detail)
	 (icon
	  (geometry 0 0 78 0)
	 )
	 (detail
	  (geometry 565 583 111 35)
	 )
	)
	(viewFor 7
	 (active detail)
	 (icon
	  (geometry 0 0 78 0)
	 )
	 (detail
	  (geometry 565 663 111 35)
	 )
	)
	(viewFor 8
	 (active detail)
	 (icon
	  (geometry 805 358 110 25)
	 )
	 (detail
	  (geometry 785 272 151 56)
	  (editing disabled)
	 )
	)
	(viewFor 9
	 (active detail)
	 (icon
	  (geometry 0 0 110 0)
	 )
	 (detail
	  (geometry 30 412 241 97)
	  (editing disabled)
	 )
	)
	(viewFor 10
	 (active detail)
	 (icon
	  (geometry 0 0 110 0)
	 )
	 (detail
	  (geometry 24 88 493 264)
	  (editing disabled)
	 )
	)
	(viewFor 11
	 (active icon)
	 (icon
	  (geometry 531 66 338 48)
	  (iconImage "disclaim.icn")
	  (label off)
	 )
	 (detail
	  (geometry 572 119 397 82)
	  (editing disabled)
	 )
	)
	(viewFor 12
	 (active icon)
	 (icon
	  (geometry 866 494 109 32)
	 )
	 (detail
	  (geometry 551 455 149 70)
	 )
	 (terminals on)
	)
	(viewFor 13
	 (active icon)
	 (icon
	  (geometry 928 678 145 25)
	 )
	 (detail
	  (geometry 589 453 322 214)
	  (configuration
	   (viewFor 0
		(active icon)
		(icon
		 (geometry 607 518 46 25)
		)
		(detail
		 (geometry 430 416 201 28)
		)
	   )
	   (viewFor 1
		(active detail)
		(icon
		 (geometry -73 -7 147 15)
		)
		(detail
		 (geometry 669 592 202 37)
		)
		(title off)
	   )
	   (viewFor 2
		(active detail)
		(icon
		)
		(detail
		 (geometry 675 513 190 35)
		)
	   )
	   (connect D2:0 D1:0
		(points 2 770 550 770 589)
	   )
	   (connect D0:1 D2:1
		(points 2 655 530 672 530)
	   )
	  )
	  (stackingOrder 0 1 2)
	 )
	 (terminals on)
	)
	(viewFor 14
	 (active icon)
	 (icon
	  (geometry 732 578 136 25)
	 )
	 (detail
	  (geometry 499 453 322 214)
	  (configuration
	   (viewFor 0
		(active detail)
		(icon
		 (geometry -73 -7 147 15)
		)
		(detail
		 (geometry 579 592 202 37)
		)
		(title off)
	   )
	   (viewFor 1
		(active detail)
		(icon
		)
		(detail
		 (geometry 585 513 190 35)
		)
	   )
	   (viewFor 2
		(active icon)
		(icon
		 (geometry 517 518 46 25)
		)
		(detail
		 (geometry 430 486 201 28)
		)
	   )
	   (connect D1:0 D0:0
		(points 2 680 550 680 589)
	   )
	   (connect D2:1 D1:1
		(points 2 565 530 582 530)
	   )
	  )
	  (stackingOrder 0 1 2)
	 )
	 (terminals on)
	)
	(viewFor 15
	 (active icon)
	 (icon
	  (geometry 909 575 182 70)
	  (iconImage "io.icn")
	 )
	 (detail
	  (geometry 316 458 308 105)
	 )
	 (terminals on)
	)
	(viewFor 16
	 (active icon)
	 (icon
	  (geometry 932 448 136 25)
	 )
	 (detail
	  (geometry 589 263 322 214)
	  (configuration
	   (viewFor 0
		(active detail)
		(icon
		 (geometry -73 -7 147 15)
		)
		(detail
		 (geometry 729 402 202 37)
		)
		(title off)
	   )
	   (viewFor 1
		(active detail)
		(icon
		)
		(detail
		 (geometry 735 323 190 35)
		)
	   )
	   (viewFor 2
		(active icon)
		(icon
		 (geometry 667 328 46 25)
		)
		(detail
		 (geometry 280 306 201 28)
		)
	   )
	   (connect D1:0 D0:0
		(points 2 830 360 830 399)
	   )
	   (connect D2:1 D1:1
		(points 2 715 340 732 340)
	   )
	  )
	  (stackingOrder 0 1 2)
	 )
	 (terminals on)
	)
	(viewFor 17
	 (active icon)
	 (icon
	  (geometry 852 374 116 33)
	 )
	 (detail
	  (geometry 541 345 149 70)
	 )
	 (terminals on)
	)
	(viewFor 18
	 (active icon)
	 (icon
	  (geometry 565 448 271 64)
	  (iconImage "io.icn")
	 )
	 (detail
	  (geometry 503 490 305 120)
	 )
	 (terminals on)
	)
	(viewFor 19
	 (active icon)
	 (icon
	  (geometry 568 358 244 64)
	  (iconImage "io.icn")
	 )
	 (detail
	  (geometry 565 387 305 120)
	 )
	 (terminals on)
	)
	(viewFor 20
	 (active icon)
	 (icon
	  (geometry 625 258 110 64)
	  (iconImage "io.icn")
	 )
	 (detail
	  (geometry 470 280 195 91)
	 )
	 (terminals on)
	)
	(viewFor 21
	 (active icon)
	 (icon
	  (geometry 285 448 251 65)
	  (iconImage "io.icn")
	 )
	 (detail
	  (geometry 226 438 308 105)
	 )
	 (terminals on)
	)
	(viewFor 22
	 (active icon)
	 (icon
	  (geometry 282 367 256 66)
	  (iconImage "io.icn")
	 )
	 (detail
	  (geometry 246 338 308 105)
	 )
	 (terminals on)
	)
	(connect D1:1 D4:1
	 (points 2 442 680 458 680)
	)
	(connect D0:1 D5:1
	 (points 2 442 600 458 600)
	)
	(connect D5:1 D6:1
	 (points 2 541 600 562 600)
	)
	(connect D4:1 D7:1
	 (points 2 541 680 562 680)
	)
	(connect D18:1 D12:1
	 (points 4 838 480 850 480 850 510 863 510)
	)
	(connect D15:0 D13:0
	 (points 2 1000 647 1000 675)
	)
	(connect D12:2 D14:0
	 (points 5 977 520 990 520 990 550 800 550 800 575)
	)
	(connect D12:1 D15:0
	 (points 3 977 500 1000 500 1000 572)
	)
	(connect D17:1 D16:0
	 (points 3 970 380 1000 380 1000 445)
	)
	(connect D19:1 D17:1
	 (points 2 814 390 849 390)
	)
	(connect D17:2 D18:0
	 (points 5 970 400 990 400 990 430 700 430 700 445)
	)
	(connect D20:1 D19:0
	 (points 5 737 290 760 290 760 340 690 340 690 355)
	)
	(connect D2:1 D20:0
	 (points 3 647 190 680 190 680 255)
	)
	(connect D22:0 D21:0
	 (points 2 410 435 410 445)
	)
   )
   (stackingOrder 11 10 9 21 3 0 1 17 2 8
	 20 19 22 16 18 12 15 14 13 6
	 7 5 4)
  )
  (titleBg "Gray")
  (titleFg "Black")
  (numberFormats
   (realFormat standard)
   (realSigDigits 4)
   (realRadixSpec 4)
   (integerBase decimal)
  )
 )
)
