Results 1 to 8 of 8
  1. #1
    john wooo is offline Member
    Join Date
    Feb 2009
    Posts
    1
    Rep Power
    0

    Default simulator program with RS232

    Hi,

    I am quite new to Java. I would like create a simulation program that send out a string eg "How are you today". This simulator will only be connected via RS232 with a specific com port (eg. com 1).

    At the end I would connect to the simulation program via Hyper Terminal and type in "Hi". The simulation program should reply with "How are you today".

    I have no idea where I should start. Any idea?

    thanks

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    The only way I know of is to look for a Java RS232 support package. I believe they use C code to actually work with the com ports. The only ones I've seen are commercial...

  3. #3
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    There is an open source java 'comm' package out there. I've never used it, so I have no idea how good it is. However, I've written JNI code before to handle communication with device drivers in unix, and it isn't hard (it's nonportable of course, but not hard). You could do the same. Obviously, if all you want to do is write "hi", you might as well skip java and write your app in c/c++. But if the plan is to integrate it into a java app, then JNI is a good way to go.

  4. #4
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    There is an open source java 'comm' package out there.
    You have all the cool stuff. Do you have a link?
    I've written JNI code before to handle communication with device drivers in unix, and it isn't hard
    Do you also jump over tall building just for exercise? ;-)

  5. #5
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    You can get the comm package directly from Sun.

    Java Communications API

    ...in regards to tall buildings, I might jump out of one someday, but probably never over one.

  6. #6
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    I remember that now. Problem is, it's only for Solaris/Linux. I believe the OP is working in a Windows environment...

  7. #7
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    ...well, I suppose it's really obvious I've never used it now.

  8. #8
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    Not really. I only know because I googled it once before, got all excited, and then read the fine print...

Similar Threads

  1. rs232 serial port on xp
    By simo_mon in forum New To Java
    Replies: 0
    Last Post: 12-04-2008, 11:25 AM
  2. Executing a program within a program
    By gibsonrocker800 in forum New To Java
    Replies: 5
    Last Post: 05-12-2008, 08:24 AM
  3. Replies: 0
    Last Post: 04-04-2008, 02:40 PM
  4. Traffic simulator
    By dirtycash in forum New To Java
    Replies: 1
    Last Post: 03-12-2008, 03:59 AM
  5. Replies: 0
    Last Post: 10-04-2007, 09:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •