Home AMX User Forum AMXForums Archive Threads AMX Hardware
Options

Relays port number

please tell me how do we assign the relay port number to device. can we give it every number we want? if i have relays buttons in my solution can we declare it like this:

DEFINE_DEVICE
Relay1 = 5001:8:0
Relays2 = 5002:8:0
does'it exsit a plage number to assignent to relay?
thanks

Comments

  • Options
    RogerSRogerS Posts: 9
    Since relay only have 1 port number you only need to defince it once.
    Portnumbers are defined in the hardware reference guide or in the AMX PI as mentioned in the other thread.

    //on a NI 2100 relays are portnumber 4
    dvRelays = 5001:4:0


    to turn on relay 1 or 2 you just need to put this in your code:

    //turn on relay 1 and 2
    on[dvRelays,1]
    on[dvRelays,2]

    //and similar to turn off relay 1 and 2
    off[dvRelays,1]
    off[dvRelays,2]
Sign In or Register to comment.