Page 5 of 5 FirstFirst ... 345
Results 41 to 49 of 49

Thread: paralell or serial plugin to drive external relays ???

  1. #41
    Join Date
    Apr 2003
    Location
    Florida
    Posts
    44

    Default http://www.electronickits.com/kit/complete/elec/ck1601.htm

    I have built a relay and can control it with software i found here http://www.electronickits.com/kit/co...lec/ck1601.htm, but there driver wont work with xp, I use xp's printer port diver and it does work but it sets all pins high at the same time, for now thats ok with me I am only useing one relay , does any one know of a driver for xp? I have also tryed the above script and it does turn on my relay but it wont shut it off, what can I do to make it shut it off???

  2. #42
    Join Date
    Apr 2003
    Location
    Florida
    Posts
    44

    Default

    ok, PORTIO_WriteBYTE( 888, 0) turns it off, now this is ok for 0ne relay how would I break it down to each pin for other relays?

  3. #43
    Rakonhere Guest

    Default

    the Portiowritebyte writes the binary parallel data through the D0-D7 lines, a value of 0 to 255. So to control individual D0,D1,D2... lines you simply need to try numbers 1,2,4,8,16,32,64,128 decimal for each pin and then addition of each of these numbers to turn on multiple pins at once such as 1+2+4=7 have fun
    I've already had a little fun with this
    Might i suggest you read the port value then binary add or binary subtract the port you wish to turn off. then write to the port.
    if you need a sample let me know

  4. #44
    Join Date
    Aug 2002
    Location
    New York, NY
    Posts
    253

    Default

    Could you post some sample code for what you are talking about?

    I built a parallel-relay system and use it control the buzzer panel in my brownstone from my cell phone. I've been using the command-line software that i found online, but I'd love to integrate it more fully into Girder.

    Thanks!

  5. #45
    Join Date
    Apr 2003
    Location
    Florida
    Posts
    44

    Default

    PORTIO_WriteBYTE( 888, 0) is off
    PORTIO_WriteBYTE( 888, 1) is on

  6. #46
    Rakonhere Guest

    Default

    Here is some sample code i found.


    This section makes certain to write only a 0 to portIO location D0 without changeing other port lines
    --this code turns only one port pin off or on
    PortValue = PORTIO_ReadBYTE( 888 )
    --THis code sets the port value to 0
    NewPort= bxor(1,PortValue)
    PortValue = band(NewPort,PortValue)
    PORTIO_WriteBYTE( 888, PortValue)


    This section Makes certain to write only a 1 to portio location D0 without changeing other point lines
    --THis code sets the port value to 1
    PortValue = (bor (1,PortValue))
    print (PortValue)--simple debugging line
    PORTIO_WriteBYTE( 888, PortValue)


    Suppose you wish to toggle any one of the ports try this code

    PortValue = PORTIO_ReadBYTE( 888 )
    -- this line toggles the D# line
    PortValue = bxor(pld1,PortValue)
    PORTIO_WriteBYTE( 888, PortValue )
    PortValue = PORTIO_ReadBYTE( 888 )
    However pld1 must be a decimal number of 1,2,4,8,16,32,64,128 for each of the d0,d1,d2,d3,d4,d5,d6,d7 ports
    I use the the menu osd to send the pld1 to the scripts.

  7. #47
    Rakonhere Guest

    Default

    i also found this link here for a simple device.
    http://ourworld.compuserve.com/homep...wden/page6.htm
    it shows several ways to hook a relay to the lpt port and i know if you power the 5V relay from a sacrificed USB cable you should not need to worry about spikes as much.
    add a few filter caps into the design and it works.

    P.S. i used figure c with 5V supply and didn't have to change anything other than a 5V relay.

  8. #48
    Join Date
    May 2003
    Location
    Manchester UK
    Posts
    28

    Default

    Hi
    I have been using the RS232 Port to drive relays for some time
    First with basic, then qbasic now Homeseer
    Could anyone tell me the syntax to output from Girder please?
    I am used to outputting something like CHR$(45) will this work in Girder
    If anyone needs information on switching relays please ask
    David

  9. #49
    Join Date
    Aug 2002
    Location
    New York, NY
    Posts
    253

    Default

    What exactly are people using these relays for?

    I already mentioned that I use mine to connect to the com-box for my brownstone, allowing me to unlock my front door with cell phone. Works great for when i forget my keys and wow-factor.

    But my driver has 8 relays and I only use 3. What are some nifty things I can do with the other 5?

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •