Interface with Paradox

Discussion in 'General Discussion' started by garouproxy, Jul 5, 2010.

  1. garouproxy

    garouproxy

    Joined:
    May 5, 2010
    Messages:
    6
    Likes Received:
    0
    Location:
    South Africa
    Greetings. My company is currently working on a project where the owner has now specified that he wants a Paradox alarm system to be integrated with the C-BUS. I am aware of the Paradox PRT3 printer module but I believe it needs a serial C-BUS PC interface unit to communicate with C-BUS.

    What I'm curious about is whether its possible to connect the Paradox PRT3 via ethernet instead of serial, since I've already ordered a ethernet PC interace and would prefer not having to order an extra unit.

    Regards
     
    garouproxy, Jul 5, 2010
    #1
  2. garouproxy

    djaggar

    Joined:
    Jul 18, 2009
    Messages:
    66
    Likes Received:
    0
    Location:
    New Zealand
    I use a Moxa 5150 to interface a PRT3 to ethernet. I also have a IP100 Paradox IP interface, but I think it only speaks HTML (and very slowly at that) ... you can load web pages from the IP100 which show that status of the Paradox, but it's pretty hit and miss as its very slow (maybe 30 seconds to load a basic screen) ... it's in fact so pathetic I gave up on it and installed the PRT3 connected to the Moxa. I control Moxa from a Wiser, and it all works very nicely (the PRT3 speaks both CBUS and ASCII). The MOXA could be any serial to IP interface box, I just like that one because in a past life I designed the ARM processor in it ...

    Dave
     
    djaggar, Jul 5, 2010
    #2
  3. garouproxy

    garouproxy

    Joined:
    May 5, 2010
    Messages:
    6
    Likes Received:
    0
    Location:
    South Africa
    Thank You Dave. I'll Look into that.

    Regards
    Michael
     
    garouproxy, Jul 5, 2010
    #3
  4. garouproxy

    garouproxy

    Joined:
    May 5, 2010
    Messages:
    6
    Likes Received:
    0
    Location:
    South Africa
    Has anyone ever worked with the Paradox IP100 module? I was wondering if I could use Homegate to get info over TCP/IP from this module and use logic to link the Paradox PIR's with lighting group adresses.

    I know this is a bit off topic, but I'm also wondering if anyone knows of a Crestron module for Paradox, because I'm not sure how I'm going to display the Paradox alarm and zone information on my clients Crestron touch panels. I suppose I can just use the IP100's web interface, but I'm looking for a more customizable display.
     
    garouproxy, Jul 13, 2010
    #4
  5. garouproxy

    MJS

    Joined:
    Sep 1, 2005
    Messages:
    29
    Likes Received:
    0
    Location:
    Port Elizabeth, ZA
    Moxa 5150 & Paradox

    @Dave,

    I have got my grubby paws on a Moxa 5150 and am experimenting with connecting it to a PRT3 module.
    Would you mind passing on some of your configuration and sample code knowledge?

    Regards
    Michael
     
    MJS, Jul 14, 2010
    #5
  6. garouproxy

    djaggar

    Joined:
    Jul 18, 2009
    Messages:
    66
    Likes Received:
    0
    Location:
    New Zealand
    Hi Michael,

    Have you got PRT3 programming guides? I put the MOXA into server mode so you can connect to in from the Wiser as a

    client. Here is the guts of the code I'm using. The only tricky bit is the Paradox sends out Group Commands in the

    form of GxxNyyAzz where the xx is the group, the yy the number and zz the area every time a zone status changes. So

    if you issue a command to the Paradox, when you go to read the result, the input buffer might be full of these

    results. So in the procedure ParadoxHandleResult I just process them all into a array of 48 booleans

    (ParadoxZoneClosed) whose values are True if and only if the Zone is Closed. Then you can Update CBus groups with

    the Zone status values you care about on every loop ... So you need to put code in HandleResult to catch every type

    of Paradox Message you care about ...

    Have fun,
    Dave

    Code:
    // Constants
    
    ParadoxHandle = 3;
    ParadoxIP = '192.168.0.246';
    ParadoxPort = 4001;
    
    // Variables
    
    TempString: string;
    
    ParadoxError: integer;
    ParadoxBuffer: string;
    
    ParadoxZoneClosed: array[1..48] of boolean;
    
    // Module
    
    
    // The following code tries to be robust about keeping the socket open ...'
    
    if NOT ClientSocketConnected(ParadoxHandle) then begin
      repeat
        OpenClientSocket(ParadoxHandle, ParadoxIP, ParadoxPort);
        delay(1);
        WaitUntil(ClientSocketConnected(ParadoxHandle) OR (ClientSocketError(ParadoxHandle)<>0));
        until ClientSocketConnected(ParadoxHandle);
      delay(2);
      end;
    
    
    // Here you want to issue commands to the paradox, like
    // if ParadoxPutPacket('RZ036') then // request status of status 36
         // handle error
    
    repeat
      ReadClientSocket(ParadoxHandle,ParadoxBuffer,#13);
      ParadoxError := ClientSocketError(ParadoxHandle);
      if (length(ParadoxBuffer) > 0) and (ParadoxError = 0) then begin
         ParadoxHandleResult(ParadoxBuffer);
         end;
      until (ParadoxBuffer = '') or (ParadoxError <> 0);
    
    // here you want to do something with, for example, the contents of the ParadoxZoneClosed array
    // like if HasChanged(ParadoxZoneClosed[36]) then 
    //            SetLightingState("Zone36", ParadoxZoneClosed[36]);
    
    delay(1.0);
    
    // end of module
    
    
    
    // This is a wee debug function for Wiser
    // Display a widget with SystemIoString ParadoxErrorMessage on the Wiser to see the output
    
    procedure ParadoxEcho(errmess: String);
    var
      CurrentTime: string;
    begin
      TimeToString(time,CurrentTime);
      Append(errmess,' ');
      Append(errmess,CurrentTime);
      SetStringSystemIO("ParadoxErrorMessage", errmess);
    end;
    
    // This function wraps up sending a command to the Paradox and catching any errors
    
    function ParadoxPutPacket(command: string) : integer; 
    begin
      append(command,#13);
      WriteClientSocket(ParadoxHandle,command);
      ParadoxPutPacket := ClientSocketError(ParadoxHandle);
    end;
    
    // This function processes any pending commands from the Paradox
    
    procedure ParadoxHandleResult(result: string);
    var
      areastring, numberstring, groupstring: string;
      area, number, group: integer;
    begin
      if (result[1] = 'G') AND (result[5] = 'N') and (result[9] = 'A') then begin
        copy(groupstring,result,2,3);
        copy(numberstring,result,6,3);
        copy(areastring,result,10,3);
        group := StringToIntDef(groupstring,-1);
        number := StringToIntDef(numberstring,-1);
        area := StringToIntDef(areastring,-1);
    
        if (group <= 3) and (number >= 1) and (number <= 48) then begin
          if group = 0 then
            ParadoxZoneClosed[number] := true
          else begin
            ParadoxZoneClosed[number] := false;
      //    ShowZoneStatus(number);
            end;
      //  else if (group = 48) and (area = 0) then begin
      //    Format(TempString,'Utility Key ',result);
      //    ParadoxEcho(TempString);
      //    end
      //  else begin
      //    Format(TempString,'Badcom1 ',result,' len=',length(result):1);
      //    ParadoxEcho(TempString);
          end;
        end
      else if (result[1] = 'R') and (result[2] = 'Z') then begin // Zone Status
        copy(numberstring,result,3,3);
        number := StringToIntDef(numberstring,-1);
        if (result[6] = 'C') then
          ParadoxZoneClosed[number] := true
        else
          ParadoxZoneClosed[number] := false;
     //   end
     // else begin
     //   Format(TempString,'Badcom2 ',result,' len=',length(result):1);
     //   ParadoxEcho(TempString);
        end;
      end;
     
    djaggar, Jul 14, 2010
    #6
  7. garouproxy

    MJS

    Joined:
    Sep 1, 2005
    Messages:
    29
    Likes Received:
    0
    Location:
    Port Elizabeth, ZA
    Moxa 5150 & Paradox

    Hi Dave,

    Wow, lots of information, thanks, it's going to take me some time, in between other stuff, to work through it.

    Some initial feed back is that we may have different versions of the PRT3 as the format of data that I am receiving is GxxxNyyyAzzz which is the same as the detail on the Ascii manual on page 17 to 21. (Link)
    (The link goes to Dropbox for free online storage.)

    Thanks
    Michael
     
    MJS, Jul 15, 2010
    #7
  8. garouproxy

    djaggar

    Joined:
    Jul 18, 2009
    Messages:
    66
    Likes Received:
    0
    Location:
    New Zealand
    Sorry that was just a typo ... I'm away from my development machine and its a while since I looked at this ... my PRT3 had 3 digit numbers there too (and the code reflects that) ...

    Dave
     
    djaggar, Jul 15, 2010
    #8
  9. garouproxy

    MJS

    Joined:
    Sep 1, 2005
    Messages:
    29
    Likes Received:
    0
    Location:
    Port Elizabeth, ZA
    Thanks that makes more sense to me now.

    Michael
     
    MJS, Jul 15, 2010
    #9
  10. garouproxy

    djaggar

    Joined:
    Jul 18, 2009
    Messages:
    66
    Likes Received:
    0
    Location:
    New Zealand
     
    djaggar, Jul 15, 2010
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.