home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / x10rex.zip / EXAMPLE.CMD next >
OS/2 REXX Batch file  |  1995-02-07  |  2KB  |  45 lines

  1. /* Copyright (C) - 1994 by Douglas A. Bebber. All rights reserved */
  2. /* Home Automation SDK (TM) - REXX Example Program      */
  3. /* This example simply turns on, then off, the device at       */
  4. /* HouseCode B, UnitNumber 1.                                  */
  5.  
  6. /* NOTE: In order for this code to actually do anything you must */
  7. /* have a DBTX10A controller card installed in the PC.        */
  8. /* You must also have the DBTX10A controller card I/O address     */
  9. /* set to 300 hex (768 decimal) or change the I/O port reference */
  10. /* to the appropriate address in the following code.        */
  11. /* You must also have access to the X10OS2 Dynamic Link Library */
  12. /* (X10OS2.DLL).                        */
  13.  
  14. /* First register the X-10 external REXX functions             */
  15. call RxFuncAdd 'X10AddFuncs', 'X10OS2', 'X10AddFuncs'
  16. call X10AddFuncs
  17.  
  18. /* Now synchronize the hardware and software    */
  19. /* We will use the DBTX10A default address of 300 hex (768 decimal)   */
  20. /* note that if the DBTX10A controller card is at a different address     */
  21. /* that address must be substituted for the default used in this example. */
  22.  
  23. call RxSynchronize '768'
  24.  
  25. /* Now we will set the appropriate device (HouseCode=B, Unit=1)        */
  26. call RxSendX10Command '768', '7', '6', '2'
  27. X10Command = RxRetrieveX10Command('768')
  28. /* Now turn that device on...                                                */
  29. call RxSendX10Command '768', '7', '20', '2'
  30.  
  31.  
  32. say Press a key to turn the device OFF...
  33. pull
  34.  
  35. /* Now shut it off      */
  36. call RxSendX10Command '768', '7', '28', '2'
  37.  
  38. /* Ok we are finished. We will now deregister the X-10 external REXX  */
  39. /* Functions.                                                                */
  40. call X10DropFuncs
  41.  
  42.  
  43.  
  44.  
  45.