home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxrtctrl.zip / RXRTCTRL.INF (.txt) < prev   
OS/2 Help File  |  1998-12-21  |  40KB  |  1,289 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Description ΓòÉΓòÉΓòÉ
  3.  
  4. rxRTCtrl ver. 2.0 - is a REXX-callable DLL providing access to the AIMS 
  5. RadioTrack FM radio card for OS/2 Warp 3 and later REXX programs. RxRTCtrl is 
  6. copyrighted freeware by N. Morrow and A. Schwarz. 
  7.  
  8.  
  9. ΓòÉΓòÉΓòÉ 2. Introduction ΓòÉΓòÉΓòÉ
  10.  
  11. RxRTCtrl.DLL allows access to the AIMS RadioTrack FM radio card through a set 
  12. of APIs. A sample REXX script is included to show how the card is controlled. 
  13. You can modify this script to your own liking or you can use a visual REXX 
  14. application generator like Vispro/REXX and create a cool-looking radio program 
  15. of your own. If you do, return the favor and consider making it available to 
  16. the OS/2 community as freeware or shareware. 
  17.  
  18. RxRTCtrl.DLL is a REXX-callable DLL and I'm quite sure C/C++ can access the 
  19. functions too, so you could create a cool-looking C/C++ radio program with skin 
  20. capabilities (user changeable look), scanning for stations, preset stations, 
  21. clock functions, you name it. RxRTCtrl.DLL may be distributed royalty free with 
  22. your programs. 
  23.  
  24. To use this DLL, you need the inexpensive AIMS RadioTrack FM radio card widely 
  25. available at computer stores or at www.aimslab.com. There are two versions of 
  26. this card. The older model has a built-in amplifier and connects directly to a 
  27. set of speakers. This card also has a programmable volume setting supported by 
  28. the rxRTCtrl API. The newer card does not have an amplifier or volume setting 
  29. and must be connected to your sound cards Line-In connector. Currently, the 
  30. rxRTCtrl API does not have a volume setting for this new card. You must use 
  31. your own mixer that supports your sound card to set the volume of the Line-In 
  32. connector. If all goes well, future upgrades to this DLL will include an API to 
  33. set the volume for most sound cards supported by OS/2. 
  34.  
  35. Because the older and newer RadioTrack cards have a different command protocol, 
  36. rxRTCtrl distinguishes between them by using the letters RT2 in the function 
  37. call. For example, RT1Freq is used to set the frequency for the older card, 
  38. RT2Freq will set the frequency for the newer cards. 
  39.  
  40. You need to know that rxRTCtrl uses TESTCFG.SYS, a generic device driver 
  41. standard to every OS/2 Warp 3.0 and 4.0 system. Installing and using rxRTCtrl 
  42. does in most cases not require to reboot the computer as TESTCFG.SYS is 
  43. installed by default on every Warp system. 
  44.  
  45. If you have any suggestions about rxRTCtrl, please let us know. 
  46.  
  47.  
  48. ΓòÉΓòÉΓòÉ 3. Performance Considerations ΓòÉΓòÉΓòÉ
  49.  
  50. Bit Manipulation Functions: 
  51.  
  52. Note: The bit manipulation functions are not needed for radio card 
  53. manipulation. They are only included for convenience. 
  54.  
  55. Using the supplied bit manipulation functions makes it convenient to do bit 
  56. operations in REXX and from looking at the code below, it appears that it will 
  57. execute much faster as well. Not so. The call to the DLL puts quite an overhead 
  58. on to the program and can take up to 20 times longer than using several of the 
  59. built-in REXX functions to do the same operation.  The native REXX function 
  60. example below will execute much faster than the call to rxRTCtrl using 
  61. RTBitClear. Both samples achieve the same result. 
  62.  
  63.    /* Native REXX Functions D2C and BITAND - MUCH FASTER */
  64.    BitVal = D2C('255')
  65.    BitResult = BITAND(BitVal, '1'x)
  66.  
  67.    /* Call to rxRTCtrl - SLOWER */
  68.    BitVal = '255'
  69.    BitResult = RTBitClear(BitVal, '0')
  70.  
  71. If your program executes the bit manipulation routines many times in a loop, 
  72. you may consider using native REXX functions to perform this operation. 
  73.  
  74. Time Delay RTDelay: 
  75.  
  76. The RTDelay function is included for convenience and provides delays for a 
  77. fraction of a second, something the SysSleep function of REXXUTIL.DLL is not 
  78. able to do. If you are using Vispro/REXX to write your program, I suggest to 
  79. use the Timer events of these programs whenever possible. This will make your 
  80. programs more responsive, especially if time delays are fairly long. RTDelay 
  81. will essentially wait for the delay to time-out and your program will not 
  82. respond during that time. Using the Timer events of the visual REXX programs 
  83. will consume less CPU cycles and it will allow you to terminate the delay 
  84. through a dedicated button for example. 
  85.  
  86.  
  87. ΓòÉΓòÉΓòÉ 4. rxRTCtrl Function Description ΓòÉΓòÉΓòÉ
  88.  
  89. Describes all functions available in rxRTCtrl.DLL and how to use them. 
  90.  
  91.    RTLoadFuncs
  92.  
  93.    RTDropFuncs
  94.  
  95.    RTRead
  96.  
  97.    RTWrite
  98.  
  99.    RTDelay
  100.  
  101.    RTBitPick
  102.  
  103.    RTBitSet
  104.  
  105.    RTBitClear
  106.  
  107.    RT1VolUp
  108.  
  109.    RT1VolDn
  110.  
  111.    RT1On
  112.  
  113.    RT1Off
  114.  
  115.    RT1Tuned
  116.  
  117.    RT1Freq
  118.  
  119.    RT2Freq
  120.  
  121.    RT2On
  122.  
  123.    RT2Off
  124.  
  125.    RT2Tuned
  126.  
  127.    RT2Present
  128.  
  129.    RTIniOpen
  130.  
  131.    RTIniClose
  132.  
  133.    RTDLLVersion
  134.  
  135.  
  136. ΓòÉΓòÉΓòÉ 4.1. RTLoadFuncs ΓòÉΓòÉΓòÉ
  137.  
  138. This function loads rxRTCtrl.DLL to be used within your REXX program. A REXX 
  139. program using rxRTCtrl must contain the following two lines to access other 
  140. functions inside rxRTCtrl: 
  141.  
  142.    CALL RXFuncAdd 'RTLoadFuncs', 'RXRTCTRL', 'RTLoadFuncs'
  143.    CALL RTLoadFuncs
  144.  
  145. Standard REXX errors are returned for this function, for example: Error 43 - 
  146. Routine not found if rxRTCtrl.DLL can't be found. 
  147.  
  148. This function also opens TESTCFG.SYS for read and write access. No errors are 
  149. returned by this function if opening TESTCFG.SYS fails. For errors returned see 
  150. each of the other functions. 
  151.  
  152.  
  153. ΓòÉΓòÉΓòÉ 4.2. RTDropFuncs ΓòÉΓòÉΓòÉ
  154.  
  155. This function drops rxRTCtrl.DLL from your REXX program and also closes access 
  156. to TESTCFG.SYS. Use it in your REXX program as shown below. 
  157.  
  158.    CALL RTDropFuncs
  159.  
  160.  
  161. ΓòÉΓòÉΓòÉ 4.3. RTRead ΓòÉΓòÉΓòÉ
  162.  
  163. Note: This function is not required to control the RadioTrack cards and is only 
  164. included for completeness. 
  165.  
  166. This function reads port_Address and returns the data in return_data. The 
  167. function format is as follows: 
  168.  
  169.    return_data = RTRead( port_Address )
  170.  
  171. The value of port_Address must be a decimal number in the range of 256 to 65535 
  172. which corresponds to the I/O range of the IBM Personal Computer. 
  173.  
  174. If the RTRead was successful, the return_data contains the following string: 
  175.  
  176. Addr: xxx Data: yyy 
  177.  
  178. where xxx is the port_Address and yyy is the data of the port read. All values 
  179. are in decimal form. The range of the data read is 0 to 255. 
  180.  
  181. If the RTRead was unsuccessful, the following errors are returned: 
  182.  
  183. Addr: xx Data: yy 
  184.  
  185.    xx = 10   TESTCFG.SYS could not be opened during RTLoadFuncs.
  186.    yy = rc   Return code of DOSOpen.
  187.  
  188.    xx = 11   Unsuccessful read.
  189.    yy = rc   Return code of DosDevIOCtl.
  190.  
  191. For error codes of DosOpen and DosDevIOCtl see the section on Error Codes. 
  192.  
  193. Examples: 
  194.  
  195. The code below reads the port at location 768 (300 hex) and results in the 
  196. following output: 
  197.  
  198. port_Address = X2D('300')
  199. return_data = RTRead( port_Address )
  200. SAY 'Data read is ' || return_data
  201.  
  202. Output:
  203. Data read is Addr: 768 Data: 255
  204.  
  205. The code below reads the port at location 888 (378 hex) which is reserved for 
  206. LPT1 and tied up by PRINT01.SYS. It results in the following read error output: 
  207.  
  208. port_Address = X2D('378')
  209. return_data = RTRead( port_Address )
  210. SAY 'Data read is ' || return_data
  211.  
  212. Output:
  213. Data read is Addr: 11 Data: 19
  214.  
  215. The error (19) given here is not listed under the return codes of DosDevIOCtl 
  216. of the Control Programming documentation. Error 19 is listed as 
  217. ERROR_WRITE_PROTECT under the disk access functions. Go figure. 
  218.  
  219. The port_Address range is not directly checked by this function, however, 
  220. TESTCFG.SYS does not allow to read or write to ranges below 256 (100 hex) as 
  221. these contain critical system parameters. Also, it does not allow to read or 
  222. write to ports that are controlled by other drivers, like the printer (LPT1) or 
  223. serial ports (COM1, COM2). 
  224.  
  225.  
  226. ΓòÉΓòÉΓòÉ 4.4. RTWrite ΓòÉΓòÉΓòÉ
  227.  
  228. Note: This function is not required to control the RadioTrack cards and is only 
  229. included for completeness. 
  230.  
  231. If you find that RTWrite is not working in a Vispro/REXX program, please read 
  232. the section Important Notes for details. 
  233.  
  234. This function writes data_Value to port_Address. The function format is as 
  235. follows: 
  236.  
  237.    return_data = RTWrite( port_Address, data_Value )
  238.  
  239. The value of port_Address must be a decimal number in the range of 256 to 65535 
  240. which corresponds to the I/O range of the IBM Personal Computer. The value of 
  241. data_Value must be in decimal and have a range of 0 to 255. 
  242.  
  243. If the RTWrite was successful, the return_data contains the following string: 
  244.  
  245. Addr: xxx Data: yyy 
  246.  
  247. where xxx is the port_Address and yyy is the data just written to the port. All 
  248. values are in decimal form. 
  249.  
  250. If the RTWrite was unsuccessful, the following errors are returned: 
  251.  
  252. Addr: xx Data: yy 
  253.  
  254.    xx = 10   TESTCFG.SYS could not be opened during RTLoadFuncs.
  255.    yy = rc   Return code of DOSOpen.
  256.  
  257.    xx = 12   Unsuccessful write.
  258.    yy = rc   Return code of DosDevIOCtl.
  259.  
  260. For error codes of DosOpen and DosDevIOCtl see the section on Error Codes. 
  261.  
  262. Example: 
  263.  
  264. The code below writes to the port at location 768 (300 hex) and results in the 
  265. following output: 
  266.  
  267. port_Address = X2D('300')
  268. data_Value = 255
  269. return_data = RTWrite( port_Address, data_Value )
  270. SAY 'Data written is ' || return_data
  271.  
  272. Output:
  273. Data written is Addr: 768 Data: 255
  274.  
  275. The port_Address range is not directly checked by this function, however, 
  276. TESTCFG.SYS does not allow to read or write to ranges below 256 (100 hex) as 
  277. these contain critical system parameters. Also, it does not allow to read or 
  278. write to ports that are controlled by other drivers, like the printer (LPT1) or 
  279. serial ports (COM1, COM2). 
  280.  
  281.  
  282. ΓòÉΓòÉΓòÉ 4.5. RTDelay ΓòÉΓòÉΓòÉ
  283.  
  284. This function provides time delay services to your REXX application. It does 
  285. not read or write to any I/O. REXX provides time delay in one second increments 
  286. only with the function SysSleep in REXXUTIL.DLL. The RTDelay function provides 
  287. time delay in the range of 1 to 1000 milliseconds and is useful if some I/O 
  288. hardware needs this short delay for proper operation. Note: This time delay is 
  289. rounded up to the next system clock tick and is therefore not accurate to the 
  290. millisecond. The format of the function is: 
  291.  
  292.    return_data = RTDelay( delay_value )
  293.  
  294. The delay_value is in the range of 1 to 1000 milliseconds. Any value outside 
  295. this range will cause an error. 
  296.  
  297. return_data returns the following values: 
  298.  
  299.     0    No errors.
  300.     1    Invalid time delay range.
  301.     322   ERROR_TS_WAKEUP (Error given by DosSleep API function).
  302.  
  303. Example: 
  304.  
  305. The code below illustrates the time delay function and shows how to verify the 
  306. delay using the REXX function TIME(). Note that TIME() has a resolution of only 
  307. 10 milliseconds. 
  308.  
  309. delay_value = 500
  310. SAY 'Start delay of ' || delay_value || ' msec...'
  311. verify_delay = TIME('R')
  312. return_data = RTDelay( delay_value )
  313. verify_delay = TIME('E')
  314. SAY "... End Delay. rc = " || return_data
  315. SAY 'elapsed time = ' || verify_delay
  316.  
  317. Output:
  318. Start delay of 500 msec...
  319. ┬╖┬╖┬╖ End Delay. rc = 0
  320. elapsed time = 0.520000
  321.  
  322.  
  323. ΓòÉΓòÉΓòÉ 4.6. RTBitPick ΓòÉΓòÉΓòÉ
  324.  
  325. This function provides an easy way to pick a certain bit from a value. It does 
  326. not access any I/O, but rather provides a much easier way to pick a bit than 
  327. standard REXX functions do. The format of the function is: 
  328.  
  329.    return_bit_value = RTBitPick( value, bit_position )
  330.  
  331. The value is in decimal with a range of 0 to 65535. 
  332.  
  333. bit_position is the position of the bit which value is to be extracted. The 
  334. right-most position (and therefore the least significant bit) is 0, the 
  335. left-most (or most significant bit) position is 15. 
  336.  
  337. return_bit_value is the value returned and can only be 0 or 1. 
  338.  
  339. There is no variable range checking, so you must insure that the right values 
  340. are passed along in the function. 
  341.  
  342. Example: 
  343.  
  344. The code below illustrates the RTBitPick function. 
  345.  
  346. SAY 'The bit position 0 of the value 254 is ' || RTBitPick( '254', '0' )
  347. SAY 'The bit position 1 of the value 254 is ' || RTBitPick( '254', '1' )
  348.  
  349. Output:
  350. The bit position 0 of the value 254 is 0
  351. The bit position 1 of the value 254 is 1
  352.  
  353.  
  354. ΓòÉΓòÉΓòÉ 4.7. RTBitSet ΓòÉΓòÉΓòÉ
  355.  
  356. This function provides an easy way to set a certain bit in a value. It does not 
  357. access any I/O, but rather provides a much easier way to set a bit than 
  358. standard REXX functions do. The format of the function is: 
  359.  
  360.    return_value = RTBitSet( value, bit_position )
  361.  
  362. The value is in decimal with a range of 0 to 65535. 
  363.  
  364. bit_position is the position of the bit which value is to be set. The 
  365. right-most position (and therefore the least significant bit) is 0, the 
  366. left-most (or most significant bit) position is 15. 
  367.  
  368. return_value is the value returned after the bit has been set. Range is 1 to 
  369. 65535. 
  370.  
  371. There is no variable range checking, so you must insure that the right values 
  372. are passed along in the function. 
  373.  
  374. Example: 
  375.  
  376. The code below illustrates the RTBitSet function. 
  377.  
  378. SAY 'Setting bit position 0 of the value 254 results in ' || RTBitSet( '254', '0' )
  379. SAY 'Setting bit position 1 of the value 0 results in ' || RTBitSet( '0', '1' )
  380.  
  381. Output:
  382. Setting bit position 0 of the value 254 results in 255
  383. Setting bit position 1 of the value 0 results in 2
  384.  
  385.  
  386. ΓòÉΓòÉΓòÉ 4.8. RTBitClear ΓòÉΓòÉΓòÉ
  387.  
  388. This function provides an easy way to clear a certain bit in a value. It does 
  389. not access any I/O, but rather provides a much easier way to clear a bit than 
  390. standard REXX functions do. The format of the function is: 
  391.  
  392.    return_value = RTBitClear( value, bit_position )
  393.  
  394. The value is in decimal with a range of 0 to 65535. 
  395.  
  396. bit_position is the position of the bit which value is to be cleared. The 
  397. right-most position (and therefore the least significant bit) is 0, the 
  398. left-most (or most significant bit) position is 15. 
  399.  
  400. return_value is the value returned after the bit has been cleared. Range is 0 
  401. to 65535. 
  402.  
  403. There is no variable range checking, so you must insure that the right values 
  404. are passed along in the function. 
  405.  
  406. Example: 
  407.  
  408. The code below illustrates the RTBitClear function. 
  409.  
  410. SAY 'Clearing bit position 0 of the value 255 results in ' || RTBitClear( '255', '0' )
  411. SAY 'Clearing bit position 1 of the value 65535 results in ' || RTBitClear( '65535', '1' )
  412.  
  413. Output:
  414. Clearing bit position 0 of the value 255 results in 254
  415. Clearing bit position 1 of the value 65535 results in 65533
  416.  
  417.  
  418. ΓòÉΓòÉΓòÉ 4.9. RT1VolUp ΓòÉΓòÉΓòÉ
  419.  
  420. For older style RadioTrack cards only. 
  421.  
  422. This function increases the volume on the old-style RadioTrack cards with a 
  423. speaker output jack. This card has 16 discrete volume levels. You must keep 
  424. track of the volume setting in your own program. To establish a known level at 
  425. initial program start, you can decrease the volume 16 times and then increase 
  426. it to a preset level. The format of the function is: 
  427.  
  428.    return_data = RT1VolUp( rt_address )
  429.  
  430. The rt_address is the decimal value of the card's I/O location 780 (30C hex) or 
  431. 524 (20C hex). 
  432.  
  433. return_data returns the following values: 
  434.  
  435.      0    No errors.
  436.     1    Volume can't be set.
  437.     10   TESTCFG.SYS could not be opened.
  438.  
  439.  
  440. ΓòÉΓòÉΓòÉ 4.10. RT1VolDn ΓòÉΓòÉΓòÉ
  441.  
  442. For older style RadioTrack cards only. 
  443.  
  444. This function decreases the volume on the old-style RadioTrack cards with a 
  445. speaker output jack. This card has 16 discrete volume levels. You must keep 
  446. track of the volume setting in your own program. To establish a known level at 
  447. initial program start, you can decrease the volume 16 times and then increase 
  448. it to a preset level. The format of the function is: 
  449.  
  450.    return_data = RT1VolDn( rt_address )
  451.  
  452. The rt_address is the decimal value of the card's I/O location 780 (30C hex) or 
  453. 524 (20C hex). 
  454.  
  455. return_data returns the following values: 
  456.  
  457.      0    No errors.
  458.     1    Volume can't be set.
  459.     10   TESTCFG.SYS could not be opened.
  460.  
  461.  
  462. ΓòÉΓòÉΓòÉ 4.11. RT1On ΓòÉΓòÉΓòÉ
  463.  
  464. For older style RadioTrack cards only. 
  465.  
  466. This function turns on the old-style RadioTrack cards. The format of the 
  467. function is: 
  468.  
  469.    return_data = RT1On( rt_address )
  470.  
  471. The rt_address is the decimal value of the card's I/O location 780 (30C hex) or 
  472. 524 (20C hex). 
  473.  
  474. return_data returns the following values: 
  475.  
  476.      0    No errors.
  477.     1    Radio card can't be turned on.
  478.     10   TESTCFG.SYS could not be opened.
  479.  
  480.  
  481. ΓòÉΓòÉΓòÉ 4.12. RT1Off ΓòÉΓòÉΓòÉ
  482.  
  483. For older style RadioTrack cards only. 
  484.  
  485. This function turns off the old-style RadioTrack cards. The format of the 
  486. function is: 
  487.  
  488.    return_data = RT1Off( rt_address )
  489.  
  490. The rt_address is the decimal value of the card's I/O location 780 (30C hex) or 
  491. 524 (20C hex). 
  492.  
  493. return_data returns the following values: 
  494.  
  495.      0    No errors.
  496.     1    Radio card can't be turned off.
  497.     10   TESTCFG.SYS could not be opened.
  498.  
  499.  
  500. ΓòÉΓòÉΓòÉ 4.13. RT1Tuned ΓòÉΓòÉΓòÉ
  501.  
  502. For older style RadioTrack cards only. 
  503.  
  504. This function checks if the old-style RadioTrack card is tuned to a station. It 
  505. can be used to check for a valid station when doing station scans. The format 
  506. of the function is: 
  507.  
  508.    return_data = RT1Tuned( rt_address, delay1, delay2 )
  509.  
  510. The rt_address is the decimal value of the card's I/O location 780 (30C hex) or 
  511. 524 (20C hex). 
  512.  
  513. The delay1 and delay2 deal with getting the tuned status from the radio card. 
  514. Depending on your system and/or programming language used, these values may be 
  515. variable. Use delay1 = 150 and delay2 = 100 to try for starters. The units of 
  516. the delays are in milliseconds and they may not be less than 1 or greater than 
  517. 1000. The same rules for these delays apply as the RTDelay function of this 
  518. library. 
  519.  
  520. return_data returns the following values: 
  521.  
  522.      0    No station tuned.
  523.     1    Station tuned.
  524.     10    TESTCFG.SYS could not be opened.
  525.     11    Invalid time delay range.
  526.     28    Error reading radio card.
  527.  
  528.  
  529. ΓòÉΓòÉΓòÉ 4.14. RT1Freq ΓòÉΓòÉΓòÉ
  530.  
  531. For older style RadioTrack cards only. 
  532.  
  533. This function tunes the old-style RadioTrack cards to the given frequency. The 
  534. format of the function is: 
  535.  
  536.    return_data = RT1Freq( rt_address, freq, fine_tune )
  537.  
  538. The rt_address is the decimal value of the card's I/O location 780 (30C hex) or 
  539. 524 (20C hex). 
  540.  
  541. freq is the frequency in MHz x 10. Tuning to 90.1MHz would mean freq must be 
  542. set to the decimal integer 901. Note: Valid frequency range is 87.0MHz to 
  543. 109.0MHz. No range check is performed in rxRTCtrl.DLL. 
  544.  
  545. fine_tune allows to fine tune the set frequency freq in steps of 0.025MHz. 
  546. fine_tune has possible values of 0, 1, 2, 3, 4, -1, -2, -3 and -4. A value of 0 
  547. means there is no fine tuning requested and the set frequency would be as given 
  548. by freq. A value of 1 would add 0.025 MHz to freq before the frequency is 
  549. actually set in the card. A value of -1 would subtract 0.025 MHz from freq 
  550. before the frequency is actually set in the card. Similarly, 2 corresponds to 
  551. adding/subtracting 0.05MHz, 3 to 0.075MHz and 4 to 0.1MHz. There is not value 
  552. check of the fine_tune parameter, so you must assure it stays within the range 
  553. given. 
  554.  
  555.  return_data returns the following values: 
  556.  
  557.      0    No errors.
  558.     1    Frequency can't be tuned.
  559.     10   TESTCFG.SYS could not be opened.
  560.  
  561. Note: Scanning for stations can be implemented by setting the frequency to a 
  562. certain value then wait for a few seconds, increment to the next frequency and 
  563. so on. When a station is found, you can either use the function RT2Tuned (newer 
  564. RadioTrack only) or provide a way to manually stop scanning. 
  565.  
  566.  
  567. ΓòÉΓòÉΓòÉ 4.15. RT2Freq ΓòÉΓòÉΓòÉ
  568.  
  569. For newer style RadioTrack cards only. 
  570.  
  571. This function tunes the new-style RadioTrack cards to the given frequency. The 
  572. format of the function is: 
  573.  
  574.    return_data = RT2Freq( rt_address, freq, fine_tune )
  575.  
  576. The rt_address is the decimal value of the card's I/O location 780 (30C hex) or 
  577. 524 (20C hex). 
  578.  
  579. freq is the frequency in MHz x 10. Tuning to 90.1MHz would mean freq must be 
  580. set to the decimal integer 901. Note: Valid frequency range is 87.0MHz to 
  581. 109.0MHz. No range check is performed in rxRTCtrl.DLL. 
  582.  
  583. fine_tune allows to fine tune the set frequency freq in steps of 0.025MHz. 
  584. fine_tune has possible values of 0, 2, 4, 6, 8, -2, -4, -6 and -8. A value of 0 
  585. means there is no fine tuning requested and the set frequency would be as given 
  586. by freq. A value of 2 would add 0.025 MHz to freq before the frequency is 
  587. actually set in the card. A value of -2 would subtract 0.025 MHz from freq 
  588. before the frequency is actually set in the card. Similarly, 4 corresponds to 
  589. adding/subtracting 0.05MHz, 6 to 0.075MHz and 8 to 0.1MHz. There is not value 
  590. check of the fine_tune parameter, so you must assure it stays within the range 
  591. given. 
  592.  
  593. return_data returns the following values: 
  594.  
  595.      0    No errors.
  596.     1    Frequency can't be tuned.
  597.     10   TESTCFG.SYS could not be opened.
  598.  
  599. Note: Scanning for stations can be implemented by setting the frequency to a 
  600. certain value then wait for a few seconds, increment to the next frequency and 
  601. so on. When a station is found, you can either use the function RT2Tuned (newer 
  602. RadioTrack only) or provide a way to manually stop scanning. 
  603.  
  604.  
  605. ΓòÉΓòÉΓòÉ 4.16. RT2On ΓòÉΓòÉΓòÉ
  606.  
  607. For newer style RadioTrack cards only. 
  608.  
  609. This function turns on the new-style RadioTrack cards. This function can also 
  610. be used to unmute the radio. The format of the function is: 
  611.  
  612.    return_data = RT2On( rt_address )
  613.  
  614. The rt_address is the decimal value of the card's I/O location 780 (30C hex) or 
  615. 524 (20C hex). 
  616.  
  617. return_data returns the following values: 
  618.  
  619.      0    No errors.
  620.     1    Radio card can't be turned on.
  621.     10   TESTCFG.SYS could not be opened.
  622.  
  623.  
  624. ΓòÉΓòÉΓòÉ 4.17. RT2Off ΓòÉΓòÉΓòÉ
  625.  
  626. For new style RadioTrack cards only. 
  627.  
  628. This function turns off the new-style RadioTrack cards. This function can also 
  629. be used to mute the radio. The format of the function is: 
  630.  
  631.    return_data = RT2Off( rt_address )
  632.  
  633. The rt_address is the decimal value of the card's I/O location 780 (30C hex) or 
  634. 524 (20C hex). 
  635.  
  636. return_data returns the following values: 
  637.  
  638.      0    No errors.
  639.     1    Radio card can't be turned off.
  640.     10   TESTCFG.SYS could not be opened.
  641.  
  642.  
  643. ΓòÉΓòÉΓòÉ 4.18. RT2Tuned ΓòÉΓòÉΓòÉ
  644.  
  645. For new style RadioTrack cards only. 
  646.  
  647. This function checks if the new-style RadioTrack card is tuned to a station. It 
  648. can be used to check for a valid station when doing station scans. The format 
  649. of the function is: 
  650.  
  651.    return_data = RT2Tuned( rt_address, delay1 )
  652.  
  653. The rt_address is the decimal value of the card's I/O location 780 (30C hex) or 
  654. 524 (20C hex). 
  655.  
  656. The delay1 deals with getting the tuned status from the radio card. Depending 
  657. on your system and/or program language used, this value may be variable. Use 
  658. delay1 = 250 to try for starters. The units of the delay is in milliseconds and 
  659. it may not be less than 1 or greater than 1000. The same rules for this delay 
  660. applies as the RTDelay function of this library. 
  661.  
  662. Note: If RT2Tuned is not working reliably in your Vispro/REXX program even if a 
  663. station is playing properly, then issue a return_data = RTDelay( 250 ) before 
  664. calling RT2Tuned. We have found that this will make RT2Tuned work every time. 
  665. The source of this problem may be in the multithreading of Vispro/REXX code, 
  666. but we were not able to pinpoint it exactly. Classical REXX programs do not 
  667. reflect this problem. If you have any insight into this problem, let us know. 
  668.  
  669. return_data returns the following values: 
  670.  
  671.      0    No station tuned.
  672.     1    Station tuned.
  673.     10    TESTCFG.SYS could not be opened.
  674.     11    Invalid time delay range.
  675.     28    Error reading radio card.
  676.  
  677.  
  678. ΓòÉΓòÉΓòÉ 4.19. RT2Present ΓòÉΓòÉΓòÉ
  679.  
  680. For new style RadioTrack cards only. 
  681.  
  682. This function checks if the new-style RadioTrack card is present in the system 
  683. at the particular I/O location. It is not a fool-proof way of detecting the 
  684. radio card, but in most cases it will work. The format of the function is: 
  685.  
  686.    return_data = RT2Present( rt_address )
  687.  
  688. The rt_address is the decimal value of the card's I/O location 780 (30C hex) or 
  689. 524 (20C hex). 
  690.  
  691. return_data returns the following values: 
  692.  
  693.      0    Not present.
  694.     1    Present.
  695.     10    TESTCFG.SYS could not be opened.
  696.     27    Error reading radio card.
  697.  
  698.  
  699. ΓòÉΓòÉΓòÉ 4.20. RTIniOpen ΓòÉΓòÉΓòÉ
  700.  
  701. This call is not needed to control the RadioTrack cards. If you want to save 
  702. settings to an OS/2-style ini file using SysIni, this call will considerably 
  703. increase speed to access the ini file. This function uses the API call 
  704. PrfOpenProfile. The format of the function is: 
  705.  
  706.    iniHandle = RTIniOpen( iniFile )
  707.  
  708. The iniFile is the filename of the ini file. It can contain drive and directory 
  709. information, i.e. C:\MyDir\MyApp.ini 
  710.  
  711. iniHandle returns the file handle as follows: 
  712.  
  713.      0     Error occurred
  714.     other  File handle of opened ini file.
  715.  
  716. Sample code to use RTIniOpen and RTIniClose to save the variable port_Address 
  717. in an Ini file. Note that in this example, if the RTIniOpen fails, the variable 
  718. is still saved to the ini file. 
  719.  
  720.    inifile = 'APP.INI'
  721.    AppKey = 'myApp'
  722.    port_Address = X2D( '300' )
  723.    IniHandle = RTIniOpen( inifile )
  724.    iniRC = SysIni( inifile, AppKey, 'port_Address', port_Address )
  725.    IF IniHandle <> 0 THEN
  726.     rc = RTIniClose( IniHandle )
  727.  
  728.  
  729. ΓòÉΓòÉΓòÉ 4.21. RTIniClose ΓòÉΓòÉΓòÉ
  730.  
  731. This call is not needed to control the RadioTrack cards. If you want to save 
  732. settings to an OS/2-style ini file using SysIni, this call will considerably 
  733. increase speed to access the ini file. This function uses the API call 
  734. PrfCloseProfile. The format of the function is: 
  735.  
  736.    rc = RTIniClose( iniHandle )
  737.  
  738. The iniHandle is the file handle of the ini file as returned by RTIniOpen. 
  739.  
  740. rc returns errors as follows: 
  741.  
  742.      0     Error occurred
  743.     1     Success
  744.  
  745. Sample code to use RTIniOpen and RTIniClose to save the variable port_Address 
  746. in an Ini file. Note that in this example, if the RTIniOpen fails, the variable 
  747. is still saved to the ini file. 
  748.  
  749.    inifile = 'APP.INI'
  750.    AppKey = 'myApp'
  751.    port_Address = X2D( '300' )
  752.    IniHandle = RTIniOpen( inifile )
  753.    iniRC = SysIni( inifile, AppKey, 'port_Address', port_Address )
  754.    IF IniHandle <> 0 THEN
  755.     rc = RTIniClose( IniHandle )
  756.  
  757.  
  758. ΓòÉΓòÉΓòÉ 4.22. RTDLLVersion ΓòÉΓòÉΓòÉ
  759.  
  760. This call is not needed to control the RadioTrack cards. It returns the name of 
  761. the DLL along with the version. The format of the function is: 
  762.  
  763.    version = RTDLLVersion()
  764.  
  765. version returns the following string: rxRTCtrl vx.yy where x is the major 
  766. revision and yy the minor revision number. 
  767.  
  768.  
  769. ΓòÉΓòÉΓòÉ 5. Error Codes ΓòÉΓòÉΓòÉ
  770.  
  771. Error Codes Returned: 
  772.  
  773. If the port address is not returned by the RTRead and RTWrite functions, then 
  774. the data portion of the returned value indicates the type of error that 
  775. occurred. 
  776.  
  777. DosOpen returns one of the following values as rc: 
  778.  
  779.     0     NO_ERROR
  780.     2     ERROR_FILE_NOT_FOUND
  781.     3     ERROR_PATH_NOT_FOUND
  782.     4     ERROR_TOO_MANY_OPEN_FILES
  783.     5     ERROR_ACCESS_DENIED
  784.     12     ERROR_INVALID_ACCESS
  785.     26     ERROR_NOT_DOS_DISK
  786.     32     ERROR_SHARING_VIOLATION
  787.     36     ERROR_SHARING_BUFFER_EXCEEDED
  788.     82     ERROR_CANNOT_MAKE
  789.     87     ERROR_INVALID_PARAMETER
  790.     99     ERROR_DEVICE_IN_USE
  791.     108    ERROR_DRIVE_LOCKED
  792.     110    ERROR_OPEN_FAILED
  793.     112    ERROR_DISK_FULL
  794.     206    ERROR_FILENAME_EXCED_RANGE
  795.     231    ERROR_PIPE_BUSY
  796.  
  797. DosDevIOCtl returns one of the following values as rc: 
  798.  
  799.     0     NO_ERROR
  800.     1     ERROR_INVALID_FUNCTION
  801.     6     ERROR_INVALID_HANDLE
  802.     15     ERROR_INVALID_DRIVE
  803.     31     ERROR_GEN_FAILURE
  804.     87     ERROR_INVALID_PARAMETER
  805.     111    ERROR_BUFFER_OVERFLOW
  806.     115    ERROR_PROTECTION_VIOLATION
  807.     117    ERROR_INVALID_CATEGORY
  808.     119    ERROR_BAD_DRIVER_LEVEL
  809.     163    ERROR_UNCERTAIN_MEDIA
  810.     165    ERROR_MONITORS_NOT_SUPPORTED
  811.  
  812. Note: If you get an error 10 - TESTCFG.SYS could not be opened, then 
  813. TESTCFG.SYS is not on your system. 
  814.  
  815. If any of the API calls do not work and return errors, then most likely your 
  816. radio card I/O setting conflicts with another adapter in your system. If you 
  817. have a network card at 300 hex and your radio card is set to 30C hex, you will 
  818. not be able to access the radio card as TESTCFG.SYS prevents that. Set the 
  819. radio card to 20C hex in this case. 
  820.  
  821.  
  822. ΓòÉΓòÉΓòÉ 6. Important Notes ΓòÉΓòÉΓòÉ
  823.  
  824. It has been reported that the RTWrite function will sometimes not write to the 
  825. selected port when using Vispro/REXX based programs. This especially is the 
  826. case when the RTWrite function is the last statement in an event. To fix this 
  827. problem, simply add any other statement after the RTWrite function call. A 
  828. simple NOP (no operation) right after the RTWrite call will fix the problem. 
  829.  
  830. This problem does not occur with classical REXX scripts. 
  831.  
  832. I have observed this behaviour in the past but can not duplicate it anymore. I 
  833. have tested this on a relay card, by actually checking if the correct outputs 
  834. are turned on and I also have tested it with my FM radio card by changing 
  835. frequency and volume. It appears to work fine. 
  836.  
  837. I would suspect that the reason could be in how Vispro/REXX poll keyboard and 
  838. mouse events. If anyone has any suggestions why this happens and how to fix it, 
  839. please let me know. 
  840.  
  841.  
  842. ΓòÉΓòÉΓòÉ 7. Example REXX Program ΓòÉΓòÉΓòÉ
  843.  
  844. The program below shows how to use rxRTCtrl with the older-style RadioTrack 
  845. card. 
  846.  
  847.  
  848. /* RTrack1.CMD */
  849. /* Sample REXX Program to control the older RadioTrack FM Radio card */
  850.  
  851. /* Load RXRTCTRL.DLL */
  852. CALL RXFuncAdd 'RTLoadFuncs', 'RXRTCTRL', 'RTLoadFuncs'
  853. CALL RTLoadFuncs
  854.  
  855. SAY ''
  856. SAY '--- Sample REXX Program to access RadioTrack FM card (older version).---'
  857. SAY ''
  858. SAY 'CAUTION: This program is capable of writing to I/O directly.'
  859. SAY '     Make sure the rt_Address is set to the same value'
  860. SAY '     as your RadioTrack card.'
  861. SAY '     rt_Address is set to 20C hex by default.'
  862. SAY ''
  863.  
  864. rt_Address = X2D('20C')   /* enter radio address in hex. rt_address variable is converted from hex to decimal */
  865.  
  866. keyhit = ""
  867. DO FOREVER
  868.   SAY "---------------------------------------------------"
  869.   SAY "Type 'x' to eXit..."
  870.   SAY "Commands below are for older RadioTrack only"
  871.   SAY "(type commands without the quotes):"
  872.   SAY "Type 'on' for radio on; 'off' for radio off;"
  873.   SAY "'f' to set radio to 90.1 MHz;"
  874.   SAY "'tu' fine tune 90.1 MHz up; 'td' to fine tune 90.1 MHz down;"
  875.   SAY "'vu' for volume up; 'vd' for volume down;"
  876.   SAY "'t' to check if station is tuned; 'v' for DLL version."
  877.   SAY ""
  878.   SAY "--------------------------------------------------"
  879.   SAY 'Enter selection: '
  880.   PARSE PULL keyhit
  881.   keyhit = Translate(keyhit)
  882.   SELECT
  883.  
  884.    when keyhit = "F" then   /* set frequency  */
  885.     do
  886.      freq_value = 901   /* frequency is MHZ x 10, must be integer!!!! So 90.1 MHz = 901; 101.1 MHz = 1011 */
  887.                 /* valid range is 87.0MHz to 109MHz. There is no range check, so that must be done in the REXX program */
  888.  
  889.      return_data = RT1Freq( rt_Address, freq_value, '0' )
  890.      SAY "Set freq to 90.1 MHz: " || return_data
  891.      keyhit = ""
  892.     end
  893.  
  894.    when keyhit = "OFF" then   /* Radio off */
  895.     do
  896.      return_data = RT1Off( rt_Address )   /* rt_address must be decimal */
  897.      SAY "Set Radio off: " || return_data
  898.  
  899.      keyhit = ""
  900.     end
  901.  
  902.    when keyhit = "ON" then   /* Radio on */
  903.     do
  904.      return_data = RT1On( rt_Address )   /* rt_address must be decimal */
  905.      SAY "Set Radio on: " || return_data
  906.      keyhit = ""
  907.     end
  908.  
  909.    when keyhit = "VU" then   /* volume up */
  910.     do
  911.      return_data = RT1Volup( rt_Address )   /* rt_address must be decimal */
  912.      SAY "Set volume up: " || return_data
  913.      keyhit = ""
  914.     end
  915.  
  916.    when keyhit = "VD" then   /* volume down */
  917.     do
  918.      return_data = RT1VolDn( rt_Address )   /* rt_address must be decimal */
  919.      SAY "Set volume down: " || return_data
  920.      keyhit = ""
  921.     end
  922.  
  923.    when keyhit = "TU" then   /* tune frequency  */
  924.     do
  925.      freq_value = 901   /* frequency is MHZ x 10, must be integer!!!! So 90.1 MHz = 901 */
  926.                 /* there is no range check, so that must be done in the REXX program */
  927.  
  928.      fine_tune = fine_tune + 1    /* use this to fine tune the frequency to a resolution of 0.025MHz */
  929.                      /* No range check takes place and fine_tune should be kept inside this range: */
  930.                      /* -4, -3, -2, -1, 0, 1, 2, 3, 4 since this corresponds to +/-0.1MHz */
  931.      IF fine_tune > 4 THEN
  932.       fine_tune = 0
  933.  
  934.      return_data = RT1Freq( rt_Address, freq_value, fine_tune )
  935.      SAY "Tune freq (90.1 MHz+) up: " || return_data
  936.  
  937.      keyhit = ""
  938.     end
  939.  
  940.    when  keyhit = "TD" then   /* tune frequency  */
  941.     do
  942.      freq_value = 901   /* frequency is MHZ x 10, must be integer!!!! So 90.1 MHz = 901 */
  943.                 /* there is no range check, so that must be done in the REXX program */
  944.  
  945.      fine_tune = fine_tune - 1    /* use this to fine tune the frequency to a resolution of 0.025MHz */
  946.                      /* No range check takes place and fine_tune should be kept inside this range: */
  947.                      /* -4, -3, -2, -1, 0, 1, 2, 3, 4 since this corresponds to +/-0.1MHz */
  948.      IF fine_tune < -4 THEN
  949.       fine_tune = 0
  950.  
  951.      return_data = RT1Freq( rt_Address, freq_value, fine_tune )
  952.      SAY "Tune freq (90.1 MHz-) down: " || return_data
  953.  
  954.      keyhit = ""
  955.     end
  956.  
  957.    when keyhit = "T" then   /* Radio tuned */
  958.     do
  959.      return_data = RT1Tuned( rt_Address, '150', '100' )   /* rt_address must be decimal */
  960.      SAY "Radio is (1=tuned, 0=not tuned): " || return_data
  961.      keyhit = ""
  962.     end
  963.  
  964.    when keyhit = "V" then   /* rxRTCtrl.DLL version */
  965.     do
  966.      return_data = RTDLLVersion()   /* no parameters passed on */
  967.      SAY "DLL version is: " || return_data
  968.      keyhit = ""
  969.     end
  970.  
  971.   otherwise
  972.    DO
  973.     IF keyhit = "X" THEN
  974.      DO
  975.       CALL RTDropFuncs
  976.       SAY 'RXRTCTRL dropped.'
  977.       EXIT
  978.      END
  979.     ELSE
  980.      SAY "Invalid Input."
  981.    END
  982.   end  /* select */
  983. end /* do */
  984.  
  985. EXIT
  986.  
  987. The program below shows how to use rxRTCtrl with the newer-style RadioTrack 
  988. card. 
  989.  
  990.  
  991. /* Load RXRTCTRL.DLL  */
  992. CALL RXFuncAdd 'RTLoadFuncs', 'RXRTCTRL', 'RTLoadFuncs'
  993. CALL RTLoadFuncs
  994.  
  995. SAY ''
  996. SAY '--- Sample REXX Program to access newer RadioTrack FM card.---'
  997. SAY ''
  998.  
  999. SAY 'CAUTION: This program is capable of writing to I/O directly.'
  1000. SAY '     Make sure the rt_Address is set to the same'
  1001. SAY '     address as your RadioTrack card.'
  1002. SAY '     rt_Address is set to 20C hex by default.'
  1003. SAY ''
  1004.  
  1005. rt_Address = X2D('20C')  /* enter rt_address in hex. rt_address variable is converted from hex to decimal */
  1006.  
  1007. keyhit = ""
  1008. DO FOREVER
  1009.   SAY "---------------------------------------------------"
  1010.   SAY "Type 'x' to eXit..."
  1011.   SAY "Commands below are for newer RadioTrack only"
  1012.   SAY "(type commands without the quotes):"
  1013.   SAY "Type 'on' for radio On; 'off' for radio Off;"
  1014.   SAY "'90' to set radio to 90.1 MHz;"
  1015.   SAY "'99' to set radio to 99.5 MHz; "
  1016.   SAY "'101' to set radio to 101.1 MHz; "
  1017.   SAY "'tu' fine tune 90.1 MHz up; 'td' to fine tune 90.1 MHz down;"
  1018.   SAY "'t' to check if station is tuned; 'p' to check if radio card is present;"
  1019.   SAY "'v' for DLL version."
  1020.   SAY "--------------------------------------------------"
  1021.   SAY 'Enter selection: '
  1022.   PARSE PULL keyhit
  1023.   keyhit = Translate(keyhit)
  1024.   SELECT
  1025.  
  1026.    when keyhit = "90" then   /* set frequency  */
  1027.     do
  1028.      freq_value = 901   /* frequency is MHZ x 10, must be integer!!!! So 90.1 MHz = 901 */
  1029.                 /* there is no range check, so that must be done in the REXX program */
  1030.  
  1031.      fine_tune = 0    /* use this to fine tune the frequency to a resolution of 0.025MHz */
  1032.                /* No range check takes place and fine_tune should be kept inside this range: */
  1033.                /* -8, -6, -4, -2, 0, 2, 4, 6, 8 since this corresponds to +/-0.1MHz */
  1034.  
  1035.      return_data = RT2Freq( rt_Address, freq_value, fine_tune )
  1036.      SAY "Set Freq, to 90.1 MHz: " || return_data
  1037.      keyhit = ""
  1038.     end
  1039.  
  1040.    when keyhit = "99" then   /* set frequency  */
  1041.     do
  1042.      freq_value = 995   /* frequency is MHZ x 10, must be integer!!!! So 90.1 MHz = 901 */
  1043.                 /* there is no range check, so that must be done in the REXX program */
  1044.  
  1045.      fine_tune = 0    /* use this to fine tune the frequency to a resolution of 0.025MHz */
  1046.                /* No range check takes place and fine_tune should be kept inside this range: */
  1047.                /* -8, -6, -4, -2, 0, 2, 4, 6, 8 since this corresponds to +/-0.1MHz */
  1048.  
  1049.      return_data = RT2Freq( rt_Address, freq_value, fine_tune )
  1050.      SAY "Set Freq. to 99.5 MHz: " || return_data
  1051.      keyhit = ""
  1052.     end
  1053.  
  1054.    when keyhit = "101" then   /* set frequency  */
  1055.     do
  1056.      freq_value = 1011   /* frequency is MHZ x 10, must be integer!!!! So 90.1 MHz = 901 */
  1057.                 /* there is no range check, so that must be done in the REXX program */
  1058.  
  1059.      fine_tune = 0    /* use this to fine tune the frequency to a resolution of 0.025MHz */
  1060.                /* No range check takes place and fine_tune should be kept inside this range: */
  1061.                /* -8, -6, -4, -2, 0, 2, 4, 6, 8 since this corresponds to +/-0.1MHz */
  1062.  
  1063.      return_data = RT2Freq( rt_Address, freq_value, fine_tune )
  1064.      SAY "Set Freq. 101.1 MHz: " || return_data
  1065.      keyhit = ""
  1066.     end
  1067.  
  1068.    when keyhit = "TU" then   /* tune frequency  */
  1069.     do
  1070.      freq_value = 901   /* frequency is MHZ x 10, must be integer!!!! So 90.1 MHz = 901 */
  1071.                 /* there is no range check, so that must be done in the REXX program */
  1072.  
  1073.      fine_tune = fine_tune + 2    /* use this to fine tune the frequency to a resolution of 0.025MHz */
  1074.                      /* No range check takes place and fine_tune should be kept inside this range: */
  1075.                      /* -8, -6, -4, -2, 0, 2, 4, 6, 8 since this corresponds to +/-0.1MHz */
  1076.      IF fine_tune > 8 THEN
  1077.       fine_tune = 0
  1078.  
  1079.      return_data = RT2Freq( rt_Address, freq_value, fine_tune )
  1080.      SAY "Tune freq (90.1 MHz+) up: " || return_data
  1081.  
  1082.      keyhit = ""
  1083.     end
  1084.  
  1085.    when  keyhit = "TD" then   /* tune frequency  */
  1086.     do
  1087.      freq_value = 901   /* frequency is MHZ x 10, must be integer!!!! So 90.1 MHz = 901 */
  1088.                 /* there is no range check, so that must be done in the REXX program */
  1089.  
  1090.      fine_tune = fine_tune - 2    /* use this to fine tune the frequency to a resolution of 0.025MHz */
  1091.                      /* No range check takes place and fine_tune should be kept inside this range: */
  1092.                      /* -8, -6, -4, -2, 0, 2, 4, 6, 8 since this corresponds to +/-0.1MHz */
  1093.      IF fine_tune < -8 THEN
  1094.       fine_tune = 0
  1095.  
  1096.      return_data = RT2Freq( rt_Address, freq_value, fine_tune )
  1097.      SAY "Tune freq (90.1 MHz-) down: " || return_data
  1098.  
  1099.      keyhit = ""
  1100.     end
  1101.  
  1102.    when keyhit = "OFF" then   /* Radio Off / mute */
  1103.     do
  1104.      return_data = RT2Off( rt_Address )   /* rt_address must be decimal */
  1105.      SAY "Turn radio off or mute: " || return_data
  1106.      keyhit = ""
  1107.     end
  1108.  
  1109.    when keyhit = "ON" then   /* Radio On / unmute  */
  1110.     do
  1111.      return_data = RT2On( rt_Address )   /* rt_address must be decimal */
  1112.      SAY "Turn radio on or unmute: " || return_data
  1113.      keyhit = ""
  1114.     end
  1115.  
  1116.    when keyhit = "T" then   /* Radio tuned */
  1117.     do
  1118.      return_data = RT2Tuned( rt_Address, '250' )   /* rt_address must be decimal */
  1119.      SAY "Radio is (1=tuned, 0=not tuned): " || return_data
  1120.      keyhit = ""
  1121.     end
  1122.  
  1123.    when keyhit = "P" then   /* New RadioTrack card present */
  1124.     do
  1125.      return_data = RT2Present( rt_Address )   /* rt_address must be decimal */
  1126.      SAY "New RadioTrack is (1=present, 0=not present): " || return_data
  1127.      keyhit = ""
  1128.     end
  1129.  
  1130.    when keyhit = "V" then   /* rxRTCtrl.DLL version */
  1131.     do
  1132.      return_data = RTDLLVersion()   /* no parameters passed on */
  1133.      SAY "DLL version is: " || return_data
  1134.      keyhit = ""
  1135.     end
  1136.  
  1137.   otherwise
  1138.    DO
  1139.     IF keyhit = "X" THEN
  1140.      DO
  1141.       CALL RTDropFuncs
  1142.       SAY 'RXRTCTRL dropped.'
  1143.       EXIT
  1144.      END
  1145.     ELSE
  1146.      SAY "Invalid Input."
  1147.    END
  1148.   end  /* select */
  1149. end /* do */
  1150.  
  1151. EXIT
  1152.  
  1153.  
  1154. ΓòÉΓòÉΓòÉ 8. Installation ΓòÉΓòÉΓòÉ
  1155.  
  1156. Note:  REXX must be installed on your system for this program to work. REXX is 
  1157. installed by default, but if you did not install it, then run Warp installation 
  1158. again and selectively install REXX support. 
  1159.  
  1160. rxRTCtrl.DLL requires the presence of the following statements in the 
  1161. CONFIG.SYS: 
  1162.  
  1163.   IOPL=YES,FXPRINT
  1164.   DEVICE=D:\OS2\BOOT\TESTCFG.SYS
  1165.  
  1166. These statements are present by default on any OS/2 Warp 3.0 or Warp 4.0 
  1167. systems. 
  1168.  
  1169. If you write your own REXX programs, only rxRTCtrl.DLL is required to access 
  1170. the I/O. I suggest to keep rxRTCtrl.DLL in the same directory as your REXX 
  1171. program so it will be able to find it when rxRTCtrl.DLL is loaded. 
  1172.  
  1173. As an alternative, put rxRTCtrl.DLL into a directory called out by the LIBPATH 
  1174. in the CONFIG.SYS. A reboot is required for this. Any program loading 
  1175. rxRTCtrl.DLL will then automatically find it. 
  1176.  
  1177. The following files belong to this program: 
  1178.  
  1179.        rxRTCtrl.DLL      REXX-callable Dynamic Link Library for the RadioTrack 
  1180.                          card. 
  1181.  
  1182.        rxRTCtrl.INF      Documentation for rxRTCtrl in INF format. 
  1183.  
  1184.        HTMLDoc.ZIP       Documentation for rxRTCtrl in HTML format, frame 
  1185.                          based. HTML documentation must be installed on HPFS 
  1186.                          drives because of long filenames. 
  1187.  
  1188.        RT2.CMD           Sample REXX program to show how to use rxRTCtrl.DLL. 
  1189.  
  1190.        README.TXT        Short program description. 
  1191.  
  1192.  
  1193. ΓòÉΓòÉΓòÉ 9. References ΓòÉΓòÉΓòÉ
  1194.  
  1195. To get more information on programming for OS/2, especially for hardware I/O, 
  1196. visit the sites listed below: 
  1197.  
  1198. www.edm2.com
  1199. Look through back issues of articles published on hardware I/O and device drivers.
  1200. Also offers online classes for programming for OS/2.
  1201.  
  1202. http://avenger.mri.psu.edu/os2page.html
  1203. Information and source code on how to access I/O ports in OS/2.
  1204.  
  1205. http://femto.ssp.ameslab.gov
  1206. Contains OS/2 Warp Programming information for digital I/O
  1207. and GPIB devices.
  1208.  
  1209. To get information on interfacing to a PC or to get information on digital I/O 
  1210. products, visit the sites listed below: 
  1211.  
  1212. http://shell.rmi.net/~hisys/parport.html
  1213. IBM Parallel Port FAQ/Tutorial.
  1214.  
  1215. http://www.senet.com.au/~cpeacock/
  1216. Craig Peacock's Interfacing the PC. Online tutorial to interface any
  1217. device to the parallel or serial ports.
  1218. Many additional links to other sites about interfacing to computers.
  1219.  
  1220. http://www.industry.net/indcompsrc
  1221. Industrial Computer Source. Industrial computers and data acquisition products.
  1222.  
  1223. http://www.acces-usa.com
  1224. Acces I/O Products. Carries low-cost digital I/O products.
  1225.  
  1226. To get more information on programming for OS/2 using REXX visit the sites 
  1227. listed below: 
  1228.  
  1229. http://rexx.hursley.ibm.com/rexx/
  1230. Main REXX site.
  1231.  
  1232. http://www.vispro.com/
  1233. Visual programming for OS/2 using REXX. Hockware's Vispro/REXX site.
  1234.  
  1235. Helpful books about programming for OS/2 using REXX: 
  1236.  
  1237. Teach Yourself REXX in 21 Days. Schindler&Schindler, SAMS, ISBN 0-672-30529-1
  1238.  
  1239. REXX Reference Summary Handbook, Dick Goran, CFS Nevada, ISBN 0-9639854-3-4
  1240. http://www.cfsrexx.com
  1241.  
  1242. OS/2 REXX, From Bark to Byte, Document Number GG24-4199-00, read online at:
  1243. http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/GG244199/contents
  1244.  
  1245.  
  1246. ΓòÉΓòÉΓòÉ 10. The Legal Stuff ΓòÉΓòÉΓòÉ
  1247.  
  1248. RxRTCtrl.DLL is free, however the authors retain the copyright to the source 
  1249. code. It may be distributed electronically at no fee or a minimum fee to cover 
  1250. media and distribution costs as long as all files are kept together. 
  1251.  
  1252. RxRTCtrl.DLL may be distributed royalty free with any freeware or shareware 
  1253. program controlling the RadioTrack cards. Please give credit to the authors and 
  1254. include information where RxRTCtrl.DLL can be found. 
  1255.  
  1256. RxRTCtrl.DLL is based on rxPortIO which you can also find at 
  1257. http://home.att.net/~ASchw 
  1258.  
  1259. DISCLAIMER 
  1260.  
  1261. rxRTCtrl has been successfully tested on a variety of systems with the AIMS 
  1262. RadioTrack cards. Use this software at your own risk. The authors of rxRTCtrl 
  1263. are in no way responsible for any damage this program may cause to computer 
  1264. equipment or other property by running this software on it. 
  1265.  
  1266. CREDIT 
  1267.  
  1268. Many thanks to Dennis Bareis for making the RTIniOpen and RTIniClose routines 
  1269. possible. They are based on his FASTINI.DLL and you can find more information 
  1270. at http://www.labyrinth.net.au/~dbareis/index.html 
  1271.  
  1272.  
  1273. ΓòÉΓòÉΓòÉ 11. Contact ΓòÉΓòÉΓòÉ
  1274.  
  1275. For comments and questions on this program, you can contact the authors 
  1276. directly via e-mail. 
  1277.  
  1278. Our e-mail addresses are: 
  1279.  
  1280.   Armin Schwarz at ASchw@worldnet.att.net 
  1281.  
  1282. or 
  1283.  
  1284.   Nicky Morrow at nrmorrow@cybertron.com 
  1285.  
  1286. Visit "The Warped Code Cellar" at http://home.att.net/~ASchw for other 
  1287. information and applications for OS/2 like HOUSE/2, a home automation program 
  1288. using X10 devices, UPS Monitor for most APC UPS models, Memory Game and Leave 
  1289. One, two speech-navigation-enabled games.