Dynamic c lan to rs232 conversion

Discussion in 'Programmer's Corner' started by natann999, Apr 5, 2013.

  1. natann999

    Thread Starter New Member

    Dec 11, 2012
    I need A program in dynamic c to program a rabbit to receive a byte by lan (tcp/ip) and send the same byte by rs232 threw the rabbits port.
    It should do it in both ways lan to rs232 and rs232 to lan.
    Please help me i need this program very much and i know nothing about dynamic c
    Thank you very much
  2. Papabravo


    Feb 24, 2006
    I did not realize that rabbits now have evolved to the point that they have bio-electronic interfaces. That's gotta be some cool stuff!!
  3. Brownout

    Well-Known Member

    Jan 10, 2012
    I don't think you're gonna get much help here. Better to use a Rabbit or Dynamic C forum.
  4. panic mode

    Senior Member

    Oct 10, 2011
    There are code samples for both TCP/IP and RS232, play with them and combine them. The fastest way is to just add RS232 to TCP/IP project.

    // specify few common baud rates (serial port using 8-N-1) //
    const long BAUDRATE[] = { 4800, 9600, 19200, 38400, 57600 };

    // make sure to check documentation for any signal
    // that need to be turned on to enable the RS232 port,
    // in case or RCM3700, PE5 must be set low
    // set low to enable rs232 device /
    BitWrPortI(PEDR, &PEDRShadow, 0, 5);

    // choose port, usually port C and D are easily accessible
    // port open functions are serCopen, serDopen for example
    // open serial port 'D' with selected baud rate
    natann999 likes this.
  5. natann999

    Thread Starter New Member

    Dec 11, 2012
    i did what you offered and it worked so thanks but there still is a little problem
    the rabbit sends the data only once after i open the socket do i need to flush a buffer or something?
    i hope you can help and thanks anyway
  6. panic mode

    Senior Member

    Oct 10, 2011
    you should get event when you receive something via ethernet. when that happens, send the data through RS232