Help with RS232 to custom application

Discussion in 'General Discussion' started by Alistair, Feb 1, 2006.

  1. Alistair

    Alistair

    Joined:
    Jan 25, 2006
    Messages:
    16
    Likes Received:
    0
    Location:
    Darwen UK
    Hi I am very new to this, on the course week after next.


    I was looking for a way to graphically display states and control all loads from a central location as a precursor to creating a wizard type application that will allow a PC to act as a PAC replacement so end users can try out complex logical arrangements of loads when the building is still on the drawing board.
    This is the stage at which I will be involved in projects.

    The system will need to function as a c-Bus simulator with a point and click GUI representing the building (probably written in PHP.

    I looked at the options c-gate and the module but as I want to work in VB6 and later VB.net or C# the support is limited and I couldn?t get the module to work in VB6 (but that is probably because my API declarations were wrong rather than anything else.

    As I am so new I don?t expect I would be accepted on the partner program so I did a little sniffing on the com port and now have an app (64K compiled VB6) which will commands sent to groups from anything and can feed them back to simulate that action again or be edited to do other stuff.

    My problem is correctly utilising the rs232 protocol, checksums and the like, and specifically finding out how to initialise the PCI.

    everything works fine wit toolkit and c-gate shut down but only after the network has been scanned at least once after a power down prior to a scan I can send but don?t see any data coming back (nothing when a group is acted on.

    some strings I am using :-

    Group1 off \053800.0101 (no checksum! but it works)
    Group 1 to percentage \053800.0201AAC1 (% not mapped yet)
    Group1 on \053800.7901
    Group 1-4 off \053800.0101.0102.0103.0104
    Group 1-4 on \053800.7901.7902.7903.7904

    I am probably in territory I shouldn?t be here but I just love to play and am intent on building my interface just for the wow factor, I also want to be able to generate RS323 and IR to control LexCom AV and third party equipment.

    All comments will be appreciated and if anyone wants my code to date just let me know, I have atached a screenshot.
     

    Attached Files:

    Alistair, Feb 1, 2006
    #1
  2. Alistair

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,391
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    Your options:

    1. You can download the public release protocol, and this will tell you a lot of what you want to do.

    2. Full information is available under the Enabled program for commercial organisations who want to develop product.

    3. Use C-Gate.

    There are MANY subtleties that you won't ever work out using a serial port sniffer - I strongly recommend you give up on that path right now. CIS have been asked in the past to support other peoples products made by such reverse engineering, and (to put it mildly) we WILL NOT DO SO!!!

    CIS reserve the right to change parts of the underlying protocol at any time without notice. When it happens the enabled parteners will be made aware (and 99.99% of the time changes are backward compatible).

    The software from CIS will always work with any protocol updates that are made.

    In your case, I'd very strongly suggest you use C-Gate. Do some searching on this forum - there is somebody else who has just recently done a VB binding to C-Gate using sockets.

    If you do this, you will get full multi-network access and every thing will "just work".

    If you try and reverse engineer things, you will be bound to screw something up sooner or later (thats the nature of reverse engineering), and you will spend a VERY long time trying to figure out all the wierd and wonderful things that are going on. C-Gate does everything for you, and its free.
     
    ashleigh, Feb 1, 2006
    #2
  3. Alistair

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    The C-Bus Open Protocol is available from the C-Bus Enabled web site http://www.cbus-enabled.com/cbus-open-b-light.htm

    As Ashleigh has said, there is really no point in trying to work it out yourself. It is much easier to just read the open protocol document.
     
    Darren, Feb 1, 2006
    #3
  4. Alistair

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    Your a brave man Alistar, I would have thought Clipsal would have been briefing the lawyers after your admission :D

    Anyway, as pointed out earlier, if you really want to do it your self, use the C-Gate method (VB6, VB.Net, C# all no problem), but if you really want a user interface to die for, check out www.charmedquark.com

    Here is some examples of some quite old work (it's even better now)
    http://charmedquark.com/phpBB2/viewtopic.php?t=6142&highlight=showing
     
    rhamer, Feb 1, 2006
    #4
  5. Alistair

    Alistair

    Joined:
    Jan 25, 2006
    Messages:
    16
    Likes Received:
    0
    Location:
    Darwen UK
    Thanks Folks ?

    No need for lawyers though, I am looking to enhance not confront and to be honest I know reverse engineering is a generally fruitless exercise beyond proof of concept.

    I am well aware that I will never sniff out the detail and do not want to proceed any further with this approach, This only represents a days work to date and was really an exercise in familiarisation.I was a little frustrated with the process of finding info and will ultimately want to use TCP/IP as a coms protocol anyway. I will check out the links you offered and see what?s out there, internet searches did not show up much.

    No offence meant but I don expect the course to provide any additional insight in this direction, why would it.

    So far as the partner program is concerned I expect to be able to submit a reasonable request for membership in the near future but I thought I had better do the standard training course first :p

    Is there a reason that Clipsal do not have a simulation engine ? and why does the PAC have such a limited reprogramming life (100 ish I believe)

    Looking forward to further replies and discussions, just because I am sad like that, and would like to think It wont be long before I will be able to help out other members, strictly within accepted bounds once I know what they are.

    Keep pushing the envelope folks, its what life is for ! :D
     
    Alistair, Feb 1, 2006
    #5
  6. Alistair

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,391
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    You can simulate all your logic in PICED.

    If you plug a PCI into the PC serial port, the PC will happily talk to cbus and run the logic code. Then you can load it into a PAC later.

    Check out "simulation mode" in PICED.

    The PAC allows >1000 reprogramming cycles. The limit is due to the type of flash memory used in the device.

    You don't need to remind us that most *modern* flash memory is good for 100K to 10 million erase-write cycles. :confused:
     
    ashleigh, Feb 1, 2006
    #6
  7. Alistair

    Alistair

    Joined:
    Jan 25, 2006
    Messages:
    16
    Likes Received:
    0
    Location:
    Darwen UK
    Ok I won't then :)

    I lookerd at PICED and I like it, a nice balence of Tec and wizzerd programming but it would leave most customers and more importantly architects cold in my opinion.

    What I want to do is get something that is both functional and visual whilst not having to be connected to physical devices to run, obviuously if this 'thing' could subsiquently transfer its logic to the relivent devices when they are instaled all the better.

    It would have to be accurate supported and carry an update path to be of any real prctical use though, big project I gues but being a picture rather than an essay probably also worth the effort.

    you know 'A picture is wortrh 1000 words .....'
     
    Alistair, Feb 1, 2006
    #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.