Serial communication in j2me

hi,
is serial communication via an rs232 port is possible in j2me to be used in micro devices?
thanx

Check the search engine top right
http://forum.java.sun.com/thread.jsp?forum=31&thread=50052

Similar Messages

  • Some question on serial communication using J2ME

    I want my Palm communicate with the other devices throught its serial port and have the following codes.
    But it does not work. It always returns "No this connection" (ConnectionNotFoundException e).
    Could anyone please give me some suggestions on how to correct it ?
    I am sure that the baudrate is correct and there is no parity bit.
    Thank you very much
    if (c == connectCommand){
    try{
    String URI = "comm:0;baudrate=9600;bitsperchar=8";
    InputConnection inputCon = (InputConnection) Connector.open(URI);
    InputStream is = inputCon.openInputStream();
    t.setString("Success");
    catch(IllegalArgumentException e)
    t.setString("Argument not correct");
    catch (ConnectionNotFoundException e)
    t.setString("No this connection");
    catch(IOException e)
    t.setString("Can't not make this connection");
    }

    Hi, futurefield
    What should I do with the port name I got ?
    open the port with the name that I used to transmit data ?
    use Connector.open(portname) instead of Connector.open(URI) ?
    Would you please give me more hints ?
    Thank you

  • How to send data using serial Communication

    I want to make serial communication using RXTXcomm.jar file.I was written the code.From this I got the list of serial ports avilable on pc but then after when I was tring to send command to machine which is attached to port it didn't gave any reply.
    Tell me that how to send command to port?

    This is how I do it:// open port, get ownership
    SerialPort serialPort= (SerialPort)portId.open(APPLICATIONNAME, timeout);
    // no framing and no threshold
    serialPort.disableReceiveFraming();
    serialPort.disableReceiveThreshold();
    // communication speed, parity, stopbits and databits
    serialPort.setSerialPortParams(BAUDRATE, SerialPort.DATABITS_8,
         SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
    // no handshaking or other flow control
    serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
    // timer on any read of the serial port
    serialPort.enableReceiveTimeout(TIMEOUT);
    // open streams for reading and writing
    InputStream is= serialPort.getInputStream();
    OutputStream os= serialPort.getOutputStream();... then you use the 'os' stream for writing and the 'is' stream for reading.
    kind regards,
    Jos

  • How do i open a new window? serial communication problem

    I am trying to make a serial communication interface, with changeable settings,
    but i wanted it to be that the settings to be openend in a new window, how am i able to do that.
    I tried to make a separate subvi, but unable to do that, here is my explanation in images and the vi files.
    -Just a student-
    Attachments:
    LVTerm.vi ‏50 KB

    Hello Nandha,
    SubVI's can be created by selecting the part that you want in the subVI and than select "create subVI" from the "Edit" menu.
    Or cut the selected part and open a new VI and paste in the code. Then you have to connect all the controls and indicators to your connector pane. To do this right click the icon in the upper right corner and "Show connector". Select a pattern that has enough connectors, my personal favorite is the 4x4x4. Select the wire tool and select a connector and then the control or indicator you want to connect. Try to keep controls to the left and indicator to the right.
    Now you have to figure out when you want to show the settings window. Is it necessary that the communication goes on during manipulation of the settings?
    Kind regards,
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • Changing the name of serial communication example in lab windows. Urgent help required

    I am using the example of getting data from rs 232 in lab windows. I want to use this in my final year project that's why I want to change its name that appears as  "serial communication example" how can I change its name and how can I make its exe file that will run on any system even without lab windows.
    How can I modify this example to save the data. I am very new to lab windows, I was using hyper terminal previously.

    I am not informed about the file format that hyperterminal uses.  However, CVI allows wiring to files.  To get a list of functions that deal with file handling, press <Ctrl-Shift-p> to get the "Find Function Panel" dialog.  Type in "file" and press the "Find" button.  This will open a list of funtions that contain "file" in their name.

  • Problem download: Java serial communication

    Hi,
    I need to work with Java serial communication api for Windows.
    As mentioned on SUN site, downloaded the following:
    1) comm2.0.3.zip, &
    2) rxtx-2.0-7pre1-i386-pc-mingw32.zip
    Extracting, unable to see win32com.dll & javax.comm.properties
    Can you help me?
    Thanks,
    Priya

    Hi priya
    There is problem in your downloaded s/w
    Download commAPI once again then try
    Read the readme file and follow the instruction

  • VISA Read function Read buffer problem in serial communication

    Hi,  I use VISA write and read function in serial communication app, the device continuously sends 0x00 if it is not receive a request from Labview program running on PC.
    And the request sent by labview is programmable. I met a weird problem, each time the request changes, the VISA read buffer output port still shows the last request firstly, from second time, shows the right request.
    It works like: Req code: ... 50, 51,51,51,50....;  VISA Read buffer: ...50, 50, 51, 51, 51, 51, 50....
    Please refer to the program.
    Attachments:
    readOne_test.vi ‏21 KB

    How are you running this?  You don't have a while loop around it.  Is it part of a larger VI?  Please don't tell me you are using the run continuously button.
    You don't have any wait statement between you VISA Write and your bytes at port.  So it is very likely the receive buffer is still empty since you didn't give your VI time to wait for the device to turn around and give a reply.  If you read 0 bytes, your VISA read string will be empty.  How does your decoder subVI (which you didn't include) handle an empty string?

  • To read 512 bytes using serial communication

    I want to read 512 bytes of data using rs 232 with the timeout of 30ms. I am using "Serial read with timeout -Palm.vi". Is there a limitation of the number of bytes I can specify to this VI?
    Thanks!!
    Attachments:
    Serial_Read_with_Timeout--Palm.vi ‏63 KB

    Hi software enigineer,
    It is not possible to transfer 512 bytes per 30 ms here. To do this would require a baud rate of 136533 (512*8/.03) and the maximum possible baud rate is 115000. The recommend baud rate for a serial transfer is 9600, which would mean transferring at most 36 bytes if the timeout is kept at 30ms. Moreover, there is usually some overhead involved in serial communication, and I would recommend sending a little less than the maximum 36 bytes every time too.
    On another note, I noticed that in your block diagram, you are using the Bytes at Serial Port vi. Definitely use the output of this vi to determine how many bytes to read at a time and read the bytes as they become available in the serial buffer rather than reading in a large buffer
    all at once. Continuously read and append the output until there are no more bytes to be read or until the termination character is read. This will avoid any lost data transmission due to overflow.
    Good luck with your program!
    Kileen Cheng
    Applications Engineer
    National Instruments

  • User-specified DAQ interruptions, instrument control through serial communication

    I'm working on an instrument control program, and I've run into a structural problem that I cannot figure out.
    The instrument in question is effectively a thermostat.
    The program has two functions:
    1.)  Background sampling to record temperature in a log over time.
    2.)  Adjust temperature according to user input
    The issue is that the instrument uses EIA-232 serial communication to talk to the PC.
    This prohibits simultaneous execution.  Attempting to send a command while the program is taking a sample will result in serial blockage errors.
    So the program must interrupt background sampling until the specified command has been completed.
    I can't figure out how to do this.
    My best idea was to create a manual pause control.  If the user wants to adjust the temperature, he hits a switch to pause the sampling, sends the appropriate command, then hits the switch again to reinitiate sampling.  This method will suffice, but is not ideal.
    Beyond that, I really have no idea how to prevent the two functions from running into each other.
    Help structuring this program would be greatly appreciated,
    Thank you

    Look into Semaphores (icons with traffic light glyphs)
    Set up a Semaphore resource to the COM port that is wired to two parallel structures.
    One structure would do the background polling, the other would handle setting changes.
    Prior to background poll, lock the resource, then unlock it after the poll. Likewise for the setting change command.
    When a resource is locked, the other process cannot access it until it is unlocked. Be sure to dispose of the Semaphore when ending the program.
    -AK2DM
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    Attachments:
    SempahoreExample.jpg ‏256 KB

  • How to make Serial Communication in windows

    Hello, I want to do serial communication using windows platform.Sun provides javax.comm package for solaris & unix but there is no any provision for windows platform.Can I use it in Windows Platform.?

    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=698876

  • Serial communication to read single character

    Hi! List,
    I want to read single character using serial communication(see the attached VI).
    The initialization of the serial port is taken care.
    TIA
    Attachments:
    Serial_comm[2_read_single_character].vi ‏42 KB

    I'm not sure I can understand you. If you want to read just one single character why can't you do so by just passing 1 to the Serial Read function as the number of bytes to read?
    The diagram of above VI doesn't make to much sense to me I have to admit.
    Rolf K
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Serial communication error

    hello,
    when i try to run my application(serial communication simple data transfer using loop back), labview evaluaton 8.6 showing the erron as attached.I dont understand what went wrong, it was working fine earlier.
    Thanks,
    hari
    Solved!
    Go to Solution.
    Attachments:
    laberror.JPG ‏85 KB

    Is that mean permission from NI? it was working fine, once i terminated the labview application abruptly when not responding since then i have this problem.
    hari

  • Serial communication from simulink to labview

    hello everybody,
    i have problems with establishing serial communication from simulink(where the data is generated) to labview (version 2010).
    i tried everything but it won t work.can you please help me on this one pleaaase.
    thanks ^^
    Attachments:
    projet labview.vi ‏15 KB

    thanks so far for your replies,
    to clarify any confusion this is my system in simulink.
    the data are decimal values
    thanks again, hope i ll receive a reply from you guys soon cause i really need to progress in my project
    Attachments:
    xxx.PNG ‏20 KB
    yy.PNG ‏35 KB

  • Serial Communication In JAVA

    Hi.
    I just wanted to know if serial communication is possible using java. If yes, which are the classes used.
    Thank you.

    I have found javax.comm for Linux and Solaris but not for Windows can any body help me about it .
    How can I comunicate using rs232 two computers using Java in Windows.
    Tkns
    I

  • Problems with Serial Communication using Labview 6 and Solaris 8

    I am working on a Driver for a Temperature Controller. But I am stuck at the very basics. I am using Labview 6 and the platform is Solaris 8 on a SUN Ultra 60 Workstation. I can not get the Serial communication to work. When I am running raw (uncompiled) code it works (I can read from and write to ttya and ttyb) but once compiled I get error code 37 (device not found). I have tried the following steps to fix this with no luck.
    1) I made sure that the "serpdrv" file is in the same folder with the executable. I also make sure the serpdrv file is added as a support file when building the app.
    2) I changed from using traditional serial VI's to labview 6's new visa functions. With these "new" VI's when
    I try to initiliaze the visa device and wire a control to the "visa reference" input only 1 serial port shows up (ASRL2, missing ASRL1). I am not sure if this is part of same problem or whole new issue.
    3) I reinstalled both visa and labview 6.0.2 update hoping this would help with no luck
    4) I placed the following entry into the ".labviewrc" file
    labview.serialdevices: "/dev/ttya:/dev/ttyb"
    If anybody has had the same problem I would love to hear about it and if you have any solutions
    Jamie Shea

    Hi Jamie,
    1. Do you have NI-VISA driver installed on the machine on which you are running this executable?? If you are trying to run the executable on the same machine on which the development program has ran fine, then you can ignore this point.
    2. If you have done all the changes that are suggested by other discussions related to this topic, then try changing the Port input to Visa Serial Configure.Vi from a control to a constant and try it. In some case, I have seen this to do the trick. I think this point should solve your problem. If it does do tell me. :-))

Maybe you are looking for