Use of RS232 Port on PAC

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by jamesng, Oct 31, 2005.

  1. jamesng

    jamesng

    Joined:
    Jun 6, 2005
    Messages:
    38
    Likes Received:
    0
    Does one need to enable the RS232 ports (software wise) on the PAC controller before they are available to receive RS232 commands? I've already connected a 24vac power supply and updated to firmware version 2.2

    I am able to trigger lighting scenes and turn individal loads on and off using commands sent from Windws Hyperterminal to the PCI on the same network (so I know the RS232 commands I am sending work ok).

    Here is the command I am attempting to send to the network via the PAC
    \053800790243u

    I'm using a DB9 female to RSJ45 adapter with a standard ethernet cable to make the connection.

    The DB9 end (pin 2 is receive, pin 3 is transmit & pin 5 is ground) map to the pins on the RJ45 conector (pin 4 is common, pin 5 is receive data & pin 6 is transmit data).

    Should I be using a different connecting cable?



    Regards
    James
     
    jamesng, Oct 31, 2005
    #1
  2. jamesng

    JasonCox

    Joined:
    Aug 17, 2004
    Messages:
    75
    Likes Received:
    0
    I assume you are doing this just to test RS232 out, because it sounds like a little weird set-up?

    anyway, pin outs are:

    DB9 - RJ45

    5 - - - 4
    2 - - - 6
    3 - - - 5

    you need to swap send/receive on one end for serial comms to work.
     
    JasonCox, Oct 31, 2005
    #2
  3. jamesng

    jamesng

    Joined:
    Jun 6, 2005
    Messages:
    38
    Likes Received:
    0
    Thanks Jason,

    Still no go though. Can you buy these cables / adapters pre-made, just to rule out this a the source of the problem (although I think I have followed the pin out descriptions correctly).

    Cheers
    James
     
    jamesng, Oct 31, 2005
    #3
  4. jamesng

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You need to open the serial port before you can use it.
    Why are you sending C-Bus commands from the PAC via a PCI ? The PAC has in-built functions to do this. These consist of thousands of lines of very carefully written and tested code. To write your own code to replicate this would be a (large) waste of time.
     
    Darren, Oct 31, 2005
    #4
  5. jamesng

    jamesng

    Joined:
    Jun 6, 2005
    Messages:
    38
    Likes Received:
    0
    We're wanting to send RS232 commands into the cbus network (via the RS232 ports on the PAC) from a third party system to trigger lighting scenes.

    I only made mention of the PCI and Hyperterminal to highlight that the RS232 commands that we're sending do work.

    So, unlike the DB9 port on the PCI, on the PAC I need to enable the RS232 port with some logic before they are able to receive commands?

    Cheers
    James
     
    jamesng, Oct 31, 2005
    #5
  6. jamesng

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    OpenSerial

    You do need to open a serial port before using it. The full description of the following script is on page 109 in the "logic.pdf" in the manuals section of the PICED software. Your code would need to look somthing like this:

    {Initialisation}

    OpenSerial (1,1,9600,8,1,0,0); {this is the most typical config however many other configurations are possible}

    {Module}
    once {condition} then
    begin
    WriteSerial (1,'053800790243u'#13);
    end;

    Tip: On the cable side of things it can be tricky with pinouts depending whether the equipment you are working with is set up as DTE or DCE. If you are having no joy try switching the TX and RX wires at one end.
     
    Phil.H, Oct 31, 2005
    #6
  7. jamesng

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    I think what he is trying to do is use the PAC instead of a PCI and actually read into the port.

    I'm no PAC expert but I thought it wouldn't emulate a PCI.

    Thats not to say you couldn't come up with your own protocol and still do what is needed.

    Ah, with the new improves super dooper search functionality I was able to find what I was looking for.

    This is your problem;

    http://www.cbusforums.com/forums/showthread.php?t=1475&highlight=pac+pci
     
    Last edited by a moderator: Oct 31, 2005
    rhamer, Oct 31, 2005
    #7
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.