Home AMX User Forum AMX General Discussion

Too easy to control a relay controller?

Hi!

I´ve got a very easy relay controller.
There are only two bytes to send:
$00 (command for setting the relays) and the sum of the values for the relays.
Relay#1 is value 1, relay#2 is value 2, relay#3 is value 4 and so on.

There are eight relays on the board.

All relays OFF would be "$00,$00".
To switch relay#1 AND relay#4 ON, the command would be "$00,$09".
To switch all relays ON, the command would be "$00,$FF".

It seems, the onboard controller needs a kind of limiter (like $0D), but this is my problem.
If I send send "$00,$01" to switch ON the first relay, nothing happens.
If I send "$00,$01,$0D", I have to send it twice, until relay#1 switches ON.
That´s a problem I could live with, but if I send "$00,$00,$0D" (all OFF), relay#1, relay#3 and relay#4 switching ON.
The added values of these three relays are 13 ($0D).
If I repeat sending "$00,$00,$0D", the relays 1, 3 and 4 are toggeling from ON to OFF.
If I repeat sending "$00,$01,$0D", relay 1 keeps staying ON (no toggeling).

The settings for the COM port are correct.
The board needs 4800 bauds, 8 data bits, 1 stop bit, NO parity.
The settings of my Axcent2 dip switches are ON-ON-ON-ON-ON-OFF-OFF-ON.

I checked the outgoing data with a terminal program - my Axcent2 is sending what it should to send.

Are there any possibilities to send a limiter without sending a limiter?

Many thanks in advance.

BlackLabel

Comments

  • dthorsondthorson Posts: 103
    What's the device?
    Do you have a protocol manual.

    It sounds like the commands have a different effect depending on the state of the relay.

    Is $0D the correct delimiter?
  • HedbergHedberg Posts: 671
    I don't know what the device is, but it sounds similar to a kit I recently put together (DIY kit #108) though the one I have has a little bit different protocol.

    I'm not sure, of course, but it may be that the device is not handling the received bytes quickly enough Rather than sending one string expression, have you tried sending separate strings -- one for each byte? Instead of:

    send_string device,"$00,$09,$0D"

    try
    send_string device,"$00"
    send_string device,"$09"
    send_string device,"$0D"

    If yours works in a manner similar to mine, it holds the states until the $0D shows up and you could put waits in between the send_string commands.

    Also, the device should be sending some sort of ready string when it is ready to receive and a response to the bytes you send. Can you control your data flow depending on the response from the device? If so, you could use wait_until to control the sending of bytes -- waiting until you properly receive a response from the device.
  • Hi,

    now, it works.

    Harold was right.
    My relay board can not handle strings - I have to send "1-byte-strings":

    SEND_STRING device,"$00"
    SEND_STRING device,"$01"

    The time between the two "strings" doesn´t matter - I tried sending "$01" more than one hour after the "$00".

    No delimiter!

    It´s a cheap, assembled relay controller board (about $US 50.00 incl. shipping inside Germany).
    It offers eight high power relays (250V AC / 10 A each). You´ll need a 12V power supply.
    Picture: http://www.shop.mattronik.com/images/big/ir-ser-8x-karte.jpg

    Many thanks for help.
    BlackLabel
  • HedbergHedberg Posts: 671
    Glad your problem is solved.

    While searching the internet for something else, I stumbled upon the kit that I mentioned earlier. It's a nice little serial controlled 8-relay (spdt) device with four isolated inputs besides. Assembly took about 45 minutes and was easy and straight forward. Cost in the US is about $60 + shipping depending on which retailer you get it from (there are a bunch of retailers carrying this line of kits). The result is very clean and presentable -- I would not hesitate to leave such a device with a customer's installation if I needed to add some relays to a system with a spare serial port.

    The reason I bought it in the first place is because I have a cheap ethernet/serial converter (SitePlayer telnet) and a spare 80211b router/wap/switch. By adding the relay box, I can put it anywhere in the house and control it with an NI700.

    For anybody who's interested in this sort of thing, you can see the available kits at "kitsrus.com (oh, my). Also a list of retailers there.
  • Hi Harold,

    thanks for the link about the kit#108.
    This looks really great (especially because the housing and screw terminals are included).

    I took a look on the other kits, but there are no more highlights like #108, maybe the temperature sensor (#145) could be useful for control systems.

    Best regards
Sign In or Register to comment.