How to connect to CNI to issue commands?

Discussion in 'General Discussion' started by zigenz, Jun 5, 2012.

  1. zigenz

    zigenz

    Joined:
    Jun 5, 2012
    Messages:
    14
    Likes Received:
    1
    Location:
    Perth, WA
    Hi all,

    I know this is an uber-n00b question, but for the life of me I cannot find any documentations that describes how to connect to the CNI (5500CN) to send/issue commands.


    As I am targetting an embedded standalone application my preference is to avoid having to use C-Gate as this stage.

    Thanks in advance!

    Cheers,
    Z
     
    zigenz, Jun 5, 2012
    #1
  2. zigenz

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,392
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    Make a TCP connection to it.

    Normally this is on port 10001, but in some cases the CNI might have been changed to 14000 or 14001.

    You can use the C-Bus IP Setup Utility to discover CNI's, change IP addresses, and set the port.

    Once connected you can issue the same commands that the C-Bus PCI uses, and these are document in the Serial Interface Users Guide which you can download from the CIS web site.

    If you make a wrapper around it to encapsulate the socket I/O (which is not difficult but left as an exercise for the reader) the you can use the FREE C-Bus Module (download from SourceForge) and get a higher-level view of the bus interface - much things will be made easier if you go this way.

    If you DO NOT use the C-Bus Module, then read the ENTIRE Serial Interface Users Guide AT LEAST 3 TIMES BEFORE YOU WRITE ANY CODE. The answers to pretty much every question you have are in there, but we have seen over the years that most people get bored, read only 1/2 of it, leap it, do stuff, screw it up, and then ask questions. Do yourself a favour and read the document. 3 times. Then make notes. Then write code. Please.
     
    ashleigh, Jun 6, 2012
    #2
  3. zigenz

    zigenz

    Joined:
    Jun 5, 2012
    Messages:
    14
    Likes Received:
    1
    Location:
    Perth, WA
    Thanks Ashleigh.

    I tried connecting over 10 times on port 10001 yesterday but it kept booting me straight out! Maybe C-Gate was connected or something - I checked the running services and didn't see anything, but who knows. Anyway - I've got it now - thanks!

    I've just quickly downloaded and compiled the CBM source and it def looks like the easier way to go - Visual C++ project needed a bit of tweaking to compile and link but I now have a DLL ready to go! Is there any quick-start guide and/or API doco for the CBM?

    Cheers,
    z
     
    zigenz, Jun 6, 2012
    #3
  4. zigenz

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Darren, Jun 7, 2012
    #4
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.