Writing bytes out of Serial Port

I'm trying to write an array of numeric (U8) bytes out of the serial
port. The serial routines though only support strings. Labview has a
routine which converts U8 into strings but only upto x7F (which is the
limit of ASCII) and not to xFF.
Anybody have a workaround to this ?
Thanks.

I just tried the "byte array to string" function (under "conversion"
subpalette under "string" subpalette) and did not see this limitation.
You can put an array of U8 on the front panel, change the format to
display Hex, and type any hex code 0 to FF, and send this thru "byte array
to string" and then through "string to byte arry" to get the original
array back. Create an indicator for viewing the intermediate string and
pop up on the string indicator to change it to hex display. You will see
all the "characters" being translated faithfully.
- Vinny Recca
Ashish Khanna wrote:
> I'm trying to write an array of numeric (U8) bytes out of the serial
> port. The serial routines though only support strings. Labview has a
> routine which converts U8 into strings but
only upto x7F (which is the
> limit of ASCII) and not to xFF.
>
> Anybody have a workaround to this ?
> Thanks.

Similar Messages

  • How can I use LabVIEW to send the equivalent of a CTRL D (in VT 100 format) out the serial port of my computer?

    I am trying to write a vi that interfaces with a piece of OEM equipment that is set up to talk with a VT 100 terminal. I can't seem to locate the ASCII equivalent string (if there is such a thing) of a CTRL D. Is there a vi that emulates VT 100 commands?

    If I recall, CTRL-D is EOF on most ASCII tables.
    You'd probably have to use an escape sequence
    or if you can use an unsigned 8-bit that might be
    easier.
    In article <[email protected]>, TLS
    wrote:
    > How can I use LabVIEW to send the equivalent of a CTRL D (in VT 100
    > format) out the serial port of my computer?
    >
    > I am trying to write a vi that interfaces with a piece of OEM
    > equipment that is set up to talk with a VT 100 terminal. I can't seem
    > to locate the ASCII equivalent string (if there is such a thing) of a
    > CTRL D. Is there a vi that emulates VT 100 commands?

  • Get bytes available at serial port

    I'm using the CNiVisaSession wrapper class for serial communication. Is there a way to get the number of bytes available at the serial port using this class like there is with the ActiveX object CWSerial.GetBytesAtPort() method?
    Thanks,
    Lyle

    Yea, you just call GetAttribute on the object with an attribute of VisaSerialBytesAvailable, its a uInt32.
    Best Regards,
    Chris Matthews
    National Instruments

  • Writing/re​ading from serial port

    I need to write/read data from an instrument trough the serial port, the communication with the RS 232 cable works properly with hyperterminal, but failed with all the vi I tried for serial communication.I'm currently using RS 232 RT with write to file vi, I've checked the initialization is the same, if I write 1500(a space)NS, I then read 150 S S undefined, it looks like if some character are not read or there is a trouble to understand the code for the space. I've tried 4500(double space)NS(space) and it works but understand 450 NS, but to obtain 1450 NS I wrote 14500(double space)NS(space) and the trick didn't work. I don't get where the misunderstanding comes from ???
    Thanks
    Sand

    I'm using a vi named "RS 232 RT with write to file" downloaded from your website. This vi uses the serial port write.vi and a carriage return is added at the end of the command. the instrument's syntax is a number follow by a space and NS, NS indicates the unit of the number.
    Attachments:
    RS232_RT_with_write__to_file.vi ‏256 KB

  • Problem writing to serial port

    Hi All,
    I am very new to LabVIEW (just a couple of months). I need to communicate with a serial port of an Advanced Energy RF generator (Ovation) serial port (AE Bus)
    The manual talks about little endian conversion, CSR and checksum that I just can't make it work. does anybody know how to write and read to this serial port?
    I have used the write and read to serial port from examples with no luck and no response from the generator. I have attached the generator's manual here, the serial commands section starts at page 65 (4-25)
    Has anybody written a program to talk to Ovation RF generator? can anybody help me out and get me started? I am stuck!!!. ... appreciate your help. thanks.
    ~Johnny
    ~ Johnny
    Attachments:
    Ovation - AE RF generator.pdf ‏1444 KB

    Thanks... so I started with the basic serial write and read, enetered hex text strings into the serial write, including the checksum and what I read back is not always correct because for example I need to calculate the XOR in the program and not just eneter it as a hex value. I should also put the write and read into a loop because I will be writing and reading to serial port 2 dozen times.
    I am working with two devices, one is the generator, the other is a controller board that has a very similar serial bus structure as the generator's AE serial bus. the controller board has stepper motor drivers that move two variable capacitors. for the generator, I need to turn the power on and off and set to different power levels. for the control/stepper motor driver board: I need to read the values from a text file(attached). the text file has 3 table, table1, column1 is the number of steps that the stepper motor will move and column2 is the nominal capacitor values for C1. same thing table2; values are number of steps versus nominal cap values for C2. I need to creat a matrix such that to move the C1 to steps listed in the table, and for every step increment in C1, I need to move the C2 motor to 20 different position (listed in the table3 that has the desired percent value of total capacitance ) position and make a measurement of the impedance of the capacitors with agilant E5061 network analyzer and write the data back into the same text file at the end where it says "IMPEDANCE_REAL     in Ohm    one line per C1 position"  and into a excel sheet too while taking a measurement... and do the same thing all over again for C2 versus C1. I think  I need to use the producer consumer design pattern eventually when I get the details worked out first.
    any suggestion? .... much thanks.
    ~ Johnny
    ~ Johnny
    Attachments:
    Basic Serial Write and Read1.vi ‏24 KB
    cap-table.txt ‏7 KB

  • 0 bytes at serial port after Visa Write

    Hi,
    I'm having problems communicating with a Pollux box controlling a stepper motor (both from Micos). The Pollux box has an RS232/485 connection to the computer. 
    I have tried adaptations of LV's Basic Serial Read and Write example. Even for the basic example there has never been any bytes at the serial port after the write.
    I have attached some sample code for LV 10.0.1(64bit) and the OS is Windows Server Enterprise 2008.
    The Visa drivers have just been installed.
    After some research I have added a 'Set I/O buffer size' as advised by http://digital.ni.com/public.nsf/allkb/60DDFED7EFEFE7188625705700750821?OpenDocument
    The time-out is set to 10s, I have a wait of 1s before read and 0.5s between each write (the characters are written individually incase that was the problem).
    The write command getaxisno_ should reply with the default axis no which is 1. However, there is never any reply.
    The termination character for Venus2 is a space for transmitting commands and ASCII CR LF at the end of received data.
    I'm not sure what else could be wrong. According to MAX the device is working properly. Although, when I try to open a Visa test panel in MAX the program crashes. I'm not sure if this is a related problem.
    I'd be really grateful for any advice, have been trying to fix this for a few days now.
    Thanks in advance!
    Ciara
    Attachments:
    Getaxisno test.vi ‏18 KB

    Thanks, I'll search those now.
    When I click the test panel button, the Max window disappears and the program is closed. Next time I open it an Unexpected Error box opens with a message saying there was an unexpected error and I should search Info Code MAXKnownException.
    'The exception occurred in the NIMax process in the function (Unknown).'
    I have searched this and the info advised me to send a report with log files etc to NI which I have done. Just waiting on the reply.
    I copied the Visa resource name from MAX and the termination character is the same as what a previous owner of the equipment used in Visual Basic. 

  • How to display raw, not ascii, bytes from serial port?

    Hello, I have an instrument that outputs raw data, not ascii, bytes to a serial port.  How do you display raw data, not ascii, bytes from a serial port?  Since raw data bytes are not displayable, there is got to be something in labview to interpret/display the received bytes the way it is as data in HEX or Binary.  The STRING-TO-HEX and STRING-TO-BINARY functions are not applicable in this case because the bytes were not string type in the first place.  For example, if the receive byte is 0x4D, I need to display 4D in HEX or 77 in Decimal and not the ascii character "M" corresponding to 0x4D ascii code.  I am using a VISA-RD function currently to receive the data from a COM port.  VISA-RD outputs string type.  Thank for any feedback or suggestion in advance.

    BC@Baxter wrote:
    ...The STRING-TO-HEX and STRING-TO-BINARY functions are not applicable in this case because the bytes were not string type in the first place...
    Of course they are string type, just not formatted in a human readable form. So, YES, these functions are not appropriate.
    BC@Baxter wrote:
    For example, if the receive byte is 0x4D, I need to display 4D in HEX or 77 in Decimal and not the ascii character "M" corresponding to 0x4D ascii code. 
    Dennis is right, but there is no "decimal" display for strings, so the second requirement needs a tiny little bit more code.
    If you have a single byte string, you can typecast it into a U8 number and set the display format as decimal, hex, octal, or binary as desired. In decimal, it would display the number 77. Since it is now a numeric, you can even do math with it.
    In general, the string has multiple bytes, and you would typecast it into an array of U8 numbers (Since this is an often used function, there is also a "string to byte array" which does the same thing).
    Typecasting is the secret. You can e.g. easily typecast 2 bytes into a U16, 4 bytes into a I32, 8 bytes into a DBL,  etc. For more detailed requirements, there is also the "unflatten from string". Check the online help for details. Good luck!
    LabVIEW Champion . Do more with less code and in less time .

  • How to transfer file from PC to PC via serial port using labview

    I need to transfer files(.txt, .doc, .xls) from PC to PC via serial port using LabVIEW. Is it possible to transfer files, if so how to transfer?
    Solved!
    Go to Solution.

    Yes, it is possible to transfer files with the serial port using LabVIEW.  Files are just collections of bytes and the serial port is pretty good at shipping bytes from one PC to another.  You need to connect the serial ports together with a null modem cable.
    First, take a look at the example for serial communication.   In LabVIEW, go to the Help menu and select "Find Examples...".  From there you can search for "serial" or navigate to Hardware Input and Output >> Serial.  Select the "Basic Serial Write and Read.vi".  Experiment with that example to gain confidence on the serial communication methods.
    Next, it's time to learn about how to read and write files.  For that, the examples could be somewhat confusing since they all deal with files that are presumed to have data of a specific type in them.  I would recommend just getting familiar with the functions on the File I/O palette.  Specifically, get to know the following functions.
    Open/Create/Replace File - On your destination side, you'll need to create the copy of the file that you are trying to transfer
    Close File - When you are finished reading from or writing to a file, you should close it.  It cleans up the memory being used and finalizes any write operations that are still floating in the write buffer.
    Read From Binary File - The best way to read from a file when you do not really care what type of file it is.  In your case, you just want to get those bytes read and sent out so they can be written down at the destination.
    Write to Binary File - At the destination side, this is what will store those bytes to the file you created with number 1.
    Get File Size (under the Advanced File Functions sub-palette) - You need to know how big the file is so you know when you are finished.
    OK, so once you are able to create files, write bytes to them, and read bytes from existing files you can move on to transferring.
    The basic method I would suggest is to have the user specify a source file on the source PC and a destination folder on the destination PC.  Then, find out the size of the source file using number 5.  Divide that size number by the number of bytes you feel like transferring at once.  The serial buffers are usually around 32k (if I remember correctly) so do not exceed that.  Now begin sending data by reading some number of bytes and wiring that string output to the VISA Write function.  On the destination side, you'll want to be monitoring the serial port for bytes and reading them when they arrive.  Wire that string to the Write to Binary File function to add them to your destination file.
    That is the basic outline of how to do it.  You have to be careful not to overload the write and read buffers on the serial ports.  Initially you can use delays on the sending side to make sure the reading side has enough time to digest.  To get things moving faster, you can bring in some flow control.
    If all that sounds a bit intimidating, there are Alliance Member companies out there (such as PrimeTest Automation) who can write such code for you and even provide a turnkey solution for you.
    Happy wiring,
    Dan Press
    Certified LabVIEW Architect
    PrimeTest Automation

  • Problem while reading data from Serial Port

    Hi All,
    I am facing some problem while reading data from Serial Port.
    As per the requirement I am writing the data on Serial Port and waiting for response of that data.
    Notification for data availabilty is checked with method public void serialEvent(SerialPortEvent event) of javax.comm.SerialPortEventListener.
    When we are writing data on the port one thread i.e. "main" thread is generated and when data availability event occures another thread "Win32SerialPort Notification thread" is generated. This creates problem for me as we can't control thread processing.
    So can anybody pls explain me how to overcome this problem?
    Regards,
    Neha

    My Problem is:-
    I am simoultaneouly wrting data on port & reading data from port.
    First I write data on port using outputStream.write() method. Now when target side sends me response back for the request on serial port DATA_AVAILABLE of SerialPortEventListner event occured,we are reading data from serial port.Now till the time we didn't get the response from target next command can't be written on the serial port. When we are writing data on port main thread is executed.Now my problem starts when DATA_AVAILABLE event occured.At this point another thread is created.Due to this my program writes data of next command without reading response of previous command.To solve this prob. I have used wait() & notify() methods as follows.But again due to this my pc hangs after execution of 2 commands. (PC hang in while loop in a code provided below.)
    From SOPs I could figure it out that after 2 commands we are not able to write data on serial port so DATA_AVAILABLE event doesn't occure n pro. goes in wait state.
    Can anybody help me to solve this issue.
    Neha.
    Code:
    public void serialEvent(SerialPortEvent event)
              switch (event.getEventType())
                   case SerialPortEvent.BI:
                   case SerialPortEvent.OE:
                   case SerialPortEvent.FE:
                   case SerialPortEvent.PE:
                   case SerialPortEvent.CD:
                   case SerialPortEvent.CTS:
                   case SerialPortEvent.DSR:
                   case SerialPortEvent.RI:
                   case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
                                 break;
                   case SerialPortEvent.DATA_AVAILABLE:
                        try
                             dataThread = Thread.currentThread();
                             dataThread.setPriority(10);
                             dataAvailable = true;
                                                                                    byte[] tempArray=new byte[availableBytes];
                                        inputStream.read(tempArray);
                                                                       catch (IOException io)
                             SOP(io, "Error in serialEvent callback call for event DATA_AVAILABLE");
    public void  writetoPort(byte[] data) throws IOException
                             outputStream.write(data);
                              while(finalTimeOut >= actualTime)
                            if( ! dataAvailable)
                                    actualTime = System.currentTimeMillis();
                           else
              synchronized (mainThread)
                   mainThread = Thread.currentThread();
                   mainThread.wait();
    public  void sendDatatoUser(byte[] b) throws Exception, HWCCSystemFailure
              obj.returnData(b);
              synchronized(mainThread)
                   mainThread.notify();
                                                           

  • How do I process serial port strings as bits

    In response to my commands, my instrument is sending bytes to my serial
    port. In one instance, 2 bytes are received. I want to treat these 2 bytes
    as a group of 16 bits.
    The VISA and Compatibility Serial functions return these bytes from the
    serial port to Labview clearly labelled a "string".
    Everything I can find in the way of Labview functions and .vis don't want to
    do bit twiddling, bit swapping, and bit dropping, with "string" data.
    I thought "hex string to number" could be used here, but I can't find a way.
    The 2 Bytes in question can be represented as hex, but the data are not the
    ASCII codes for the hex representation of a binary number, they are the
    binary number. This "hex string to number" seems to want ASCII c
    odes.
    You can feed a hex number typed into a "control" box wired into "hex string
    to number" and you get a meaningful number. You can feed the 2 bytes from
    the serial port into an "indicator" set to read in hex and you get a hex
    number that is a correct representation. But that is Labview handing them
    around to itself. I need to get my "hands" on them.
    I can't feed those same bytes that show up as a correct hex representation
    in an indicator into the "hex string to number" or anything else, so far,
    and get a number that is useful for further processing.
    I thought "variant to data", but I can't find enough reference material to
    understand how to use it. A boolean array seems like a bit of a weird
    approach, so I thought I'd ask before I looked into that.
    I'm used to dealing directly with binary numbers on the processor stack, I
    call them whatever I want, and turn them into anything I feel like.
    I'm sure I'm staring the solution in the face, but I can't find any way to
    persuade
    Labview to treat this "string" data as 16 bits.
    I've got the 16 bits, which is better than not having them, but I don't have
    much hair left.

    duh, well I finally discovered the "Unflatten from String" function. A guy
    just feeds in the bytes he's collected from his serial port that Labview
    thinks are a "string", and out come lovely little unsigned 16 bit numbers,
    or whatever other type of number he wants to turn the bytes into. And there
    are great little bit twiddlers available after that, like "swap bytes", and
    you can mask out bits with the logic operators, why this is fun. There's
    nothing like being a moron...... fly me to the moon...................
    "David Lewis" wrote in message
    news:[email protected]..
    > The two bytes would come from a serial port read.vi in Labview, classed as
    a
    > string. For instance, D3 and 02. The output wou
    ld swap the two bytes,
    i.e.
    > to 02 and D3, consider the two swapped bytes as 16 bits, drop the six most
    > significant bits, and output the ten bits that are left as an integer
    > classed by Labview as some kind of number, not a string.
    >
    > Your example StringToBits_Converter.vi I found on the ni.com site
    > unfortunately gives an error message and refuses to open on my system
    saying
    > it comes from a newer version of Labview 6 than I am running. Mine says
    > 6.0.1b3. Thank you very much anyway.
    >
    > "FightOnSCTrojan" wrote in message
    > news:[email protected]..
    > > In another words, you want to create a VI in which the input is 2
    > > strings (i.e. AB) and the output is the converted array bits (e.g.
    > > 1010101010101010)?
    >
    >

  • Java ME 8 Permission check failed when opening a serial port

    I have a larger Jave ME8.1 application that was going well until I tried to add one last piece, reading and writing data from a serial port. This was left to last because it is trivial, at least in most programming languages. The is IDE NetBeans 8.0.2 running on a Windows 7 PC. The platform is a Raspberry Pi B or B+ (I have tried both) with the most current Raspbian (12/24/2014 I believe). To simplify the process I created a new app with just the open and close code and this generates the same error I am experiencing in the larger application. The program is as follows:
    package javamecomapp;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.microedition.io.CommConnection;
    import javax.microedition.io.Connector;
    import javax.microedition.midlet.MIDlet;
    * @author ****
    public class JavaMEcomApp extends MIDlet {
        static int BAUD_RATE = 38400;
        static String SERIAL_DEVICE = "ttyAMA0";
        static CommConnection commConnection = null;
        static OutputStream os = null;
        static InputStream is = null;
        static String connectorString;
        private int rtnValue = -1;
        @Override
        public void startApp() {
            java.lang.System.out.println("Opening comm port.");
            try {
                rtnValue = JavaMEcomApp.openComm();
            } catch (IOException ex) {
                Logger.getLogger(JavaMEcomApp.class.getName()).log(Level.SEVERE, null, ex);
        @Override
        public void destroyApp(boolean unconditional) {
            java.lang.System.out.println("Closing comm port.");
            try {
                rtnValue = JavaMEcomApp.closeComm();
            } catch (IOException ex) {
                Logger.getLogger(JavaMEcomApp.class.getName()).log(Level.SEVERE, null, ex);
            private static int openComm()throws IOException {
                java.lang.System.out.println("Opening comm port.");
                connectorString = "comm:" + SERIAL_DEVICE + ";baudrate=" + BAUD_RATE;
                commConnection = (CommConnection)Connector.open(connectorString);
                is  = commConnection.openInputStream();
                os = commConnection.openOutputStream();
            return 0;
        private static int closeComm()throws IOException {
            java.lang.System.out.println("Closing comm port.");
                is.close();
                os.close();
                commConnection.close();
            return 0;
    If I comment out the JavaMEcomApp.openComm and closeComm lines it runs fine. When they are included, the following error is dumped to the Raspberry Pi terminal:
    Opening comm port.
    Opening comm port.
    [CRITICAL] [SECURITY] iso=2:Permission check failed: javax.microedition.io.CommProtocolPermission "comm:ttyAMA0;baudrate=38400" ""
    TRACE: <at java.security.AccessControlException: >, startApp threw an Exception
    java.security.AccessControlException:
    - com/oracle/meep/security/AccessControllerInternal.checkPermission(), bci=118
    - java/security/AccessController.checkPermission(), bci=1
    - com/sun/midp/io/j2me/comm/Protocol.checkForPermission(), bci=16
    - com/sun/midp/io/j2me/comm/Protocol.openPrim(), bci=31
    - javax/microedition/io/Connector.open(), bci=77
    - javax/microedition/io/Connector.open(), bci=6
    - javax/microedition/io/Connector.open(), bci=3
    - javamecomapp/JavaMEcomApp.openComm(), bci=46
    - javamecomapp/JavaMEcomApp.startApp(), bci=9
    - javax/microedition/midlet/MIDletTunnelImpl.callStartApp(), bci=1
    - com/sun/midp/midlet/MIDletPeer.startApp(), bci=5
    - com/sun/midp/midlet/MIDletStateHandler.startSuite(), bci=246
    - com/sun/midp/main/AbstractMIDletSuiteLoader.startSuite(), bci=38
    - com/sun/midp/main/CldcMIDletSuiteLoader.startSuite(), bci=5
    - com/sun/midp/main/AbstractMIDletSuiteLoader.runMIDletSuite(), bci=130
    - com/sun/midp/main/AppIsolateMIDletSuiteLoader.main(), bci=26
    java.security.AccessControlException:
    - com/oracle/meep/security/AccessControllerInternal.checkPermission(), bci=118
    - java/security/AccessController.checkPermission(), bci=1
    - com/sun/midp/io/j2me/comm/Protocol.checkForPermission(), bci=16
    - com/sun/midp/io/j2me/comm/Protocol.openPrim(), bci=31
    - javax/microedition/io/Connector.open(), bci=77
    - javax/microedition/io/Connector.open(), bci=6
    - javax/microedition/io/Connector.open(), bci=3
    - javamecomapp/JavaMEcomApp.openComm(), bci=46
    - javamecomapp/JavaMEcomApp.startApp(), bci=9
    - javax/microedition/midlet/MIDletTunnelImpl.callStartApp(), bci=1
    - com/sun/midp/midlet/MIDletPeer.startApp(), bci=5
    - com/sun/midp/midlet/MIDletStateHandler.startSuite(), bci=246
    - com/sun/midp/main/AbstractMIDletSuiteLoader.startSuite(), bci=38
    - com/sun/midp/main/CldcMIDletSuiteLoader.startSuite(), bci=5
    - com/sun/midp/main/AbstractMIDletSuiteLoader.runMIDletSuite(), bci=130
    - com/sun/midp/main/AppIsolateMIDletSuiteLoader.main(), bci=26
    Closing comm port.
    Closing comm port.
    TRACE: <at java.lang.NullPointerException>, destroyApp threw an Exception
    java.lang.NullPointerException
    - javamecomapp/JavaMEcomApp.closeComm(), bci=11
    - javamecomapp/JavaMEcomApp.destroyApp(), bci=9
    - javax/microedition/midlet/MIDletTunnelImpl.callDestroyApp(), bci=2
    - com/sun/midp/midlet/MIDletPeer.destroyApp(), bci=6
    - com/sun/midp/midlet/MIDletStateHandler.startSuite(), bci=376
    - com/sun/midp/main/AbstractMIDletSuiteLoader.startSuite(), bci=38
    - com/sun/midp/main/CldcMIDletSuiteLoader.startSuite(), bci=5
    - com/sun/midp/main/AbstractMIDletSuiteLoader.runMIDletSuite(), bci=130
    - com/sun/midp/main/AppIsolateMIDletSuiteLoader.main(), bci=26
    java.lang.NullPointerException
    - javamecomapp/JavaMEcomApp.closeComm(), bci=11
    - javamecomapp/JavaMEcomApp.destroyApp(), bci=9
    - javax/microedition/midlet/MIDletTunnelImpl.callDestroyApp(), bci=2
    - com/sun/midp/midlet/MIDletPeer.destroyApp(), bci=6
    - com/sun/midp/midlet/MIDletStateHandler.startSuite(), bci=376
    - com/sun/midp/main/AbstractMIDletSuiteLoader.startSuite(), bci=38
    - com/sun/midp/main/CldcMIDletSuiteLoader.startSuite(), bci=5
    - com/sun/midp/main/AbstractMIDletSuiteLoader.runMIDletSuite(), bci=130
    com/sun/midp/main/AppIsolateMIDletSuiteLoader.main(), bci=26
    I have tried this with three different serial ports, /dev/ttyAMA0 (yes I did disable the OS from using it), an arduino board /dev/ttyACM0, and a USB to RS485 adaptor /dev/ttyUSB0. All of these ports could be connected and use normally with both a C program and terminal program in the Pi. The API Permissions were set in the project properties / Application Descriptor / API Permissions to jdk.dio.DeviceMgmtPermission "/dev/ttyAMA0". This of course was changed as I tested different devices.
    I found a reference suggesting adding the line "authentication.provider = com.oracle.meep.security.NullAuthenticationProvider" to the end of the jwc_properties.ini file. This had no effect. I found references that during development in eclipse and NetBeans, the app is already elevated to the top level so this should not be an issue until deployment. This does not appear to be the case.
    I am out of time and need a solution quickly. Any suggestions are welcome.

    Terrence,
       Thank you for responding and confirming the issues I'm having with static addressing.  As far as the example above, I do have the standard LEDs working correctly, however, the example I'm referring to above is from the JavaME samples using the GPIO Port for the LEDS, according to the Device I/O Preconfigured List you referenced:
    GPIO Ports
    The following GPIO ports are preconfigured.
    Devicel ID
    Device Name
    Mapped
    Configuration
    8
    LEDS
    PTB22
    PTE26
    PTB21
    direction = 1 (Output only)
    initValue = 0
    GPIOPins:
    controllerNumber = 1
    pinNumber = 22
    mode = 4 (Push-pull mode)
    controllerNumber = 4
    pinNumber = 26
    mode = 4 (Push-pull mode)
    controllerNumber = 1
    pinNumber = 21
    mode = 4 (Push-pull mode)
    So is the assumption that using GPIOPort for accessing the GPIO port for Device ID 8 as listed in the Device I/O Preconfigured list not supported?

  • Sending Hex text files to the Serial Port

    Hi,
    Does anyone know or have any experience in how to open a Hex file, read
    the data and send it down the serial port.
    Regards,
    Martin.

    Martin Stanley wrote:
    >
    > Hi,
    > Does anyone know or have any experience in how to open a Hex file, read
    > the data and send it down the serial port.
    >
    > Regards,
    > Martin.
    Martin,
    I have a vi that reads a hex file then sends the data out the serial port.
    It waits for each byte to be echoed back before sending the next one.
    As each hex number is read, it's converted to a decimal number. The number
    is used as a decimal ascii code, the ascii character is then sent to the
    serial port.
    I'm not sure if this is the most efficient way to do it, but it works.
    Walter

  • Any way to communicate with Serial PORT using JavaScript

    is there any way to communicate with Serial PORT using JavaScript ??
    Dont tell me to do it in java because I need to this on client side not on server side.
    such as when client pressed the button, a javascript function will be called and in that function I need to communicate with the serial port of that client... That action will not go to server side.

    Is there any way to send a string of bytes to the serial port from the client side ?
    Just a button on the web page that sends out stuff to the comport.
    I was hoping to do this using java script also ..

  • Reading form serial port problem

    I'm using javax.comm for communicating with a microcontroller (the uc just sends data ->"data from uc"). Here is what is read from the serial port. Where is the problem?
    the code:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.comm.*;
    public class ss extends Frame implements WindowListener,ActionListener,KeyListener {
         TextField text = new TextField(20);
         Button inainte;
         Button inapoi;
         Button stanga;
         Button dreapta;
         Button stop;
    SerialPort serialPort1, serialPort2;
    test2 df=new test2();
         Label msg_stop=new Label("am un obiect in fata! ");
         TextArea displayArea;
         Panel panel;
         Panel displayPanel;
         Integer i;
         /*     public static void main(String[] args)
              test df=new test();
              //     df.dumpFrame();
                   df.sendCommand("a");
              System.out.println("serial port successfully opened!");
         CommPortIdentifier portId1;
         CommPortIdentifier portId2;
         class test2 extends Thread
              serialComm mySerial;
              char var_ser,a;
              public String misc;
              test2()
                        try {
                             portId1 = CommPortIdentifier.getPortIdentifier("COM1");
                             portId2 = CommPortIdentifier.getPortIdentifier("COM2");
                             // cs a=new cs();
                   catch
                        (Exception e) {
                        // TimeStamp = new java.util.Date().toString();
                        // System.out.println(TimeStamp + ": COM1 " + portId1);
                        // System.out.println(TimeStamp + ": COM2 " + portId2);
                        // System.out.println(TimeStamp + ": msg1 - " + e);}
                        try{             
         // serialPort1 = (SerialPort) portId1.open("ss", 2000);
              catch
         (Exception e2){};
                   mySerial=new serialComm("1");
              // serialPort1=(SerialPort)mySerial;
         public void run()
              while(true) {
                   // var_ser=mySerial.readByte();           
                   // mySerial.writeStr("!andi");
                   //try{
                   //     sleep(200);
                   // }catch(InterruptedException e){};
                   a=mySerial.readByte();
    System.out.println(a);
              //     if(var_ser=='r') {
              //          System.out.println("dsadsa");
              //     mySerial.writeStr(misc);     
              //     misc="id";
              //     if(var_ser=='o'&& misc=="sp"){
              //     misc="id";
              //     msg_stop.setVisible(true);
              // System.out.println("Sunt in task1 "+misc+" "+var_ser+" end ");
              try{
                   sleep(200);
              }catch(InterruptedException e){};
         Flushes all data out of the serial file buffer
         int pixels[];
         public void dumpFrame()
              char a,c,k,r;
              int data=1, pix;
              int row,col=0;
              int count=0;
         //     pixels=new int[900];
         //     MemoryImageSource source;
         //     Image image;
         //          source = new MemoryImageSource(30,30,pixels,0,30);
         //          source.setAnimated(true);
         //          image=createImage(source);
              //     source.newPixels(0,0,30,30);
         //     mySerial.writeStr("DF\r");
              while(col==0){
              data=mySerial.readNonBlock();
              System.out.println(data);
              if(data==1) // New frame
                   System.out.println("este 1 ! !");
              else
         if(data==2) // New col
              System.out.println("este 2 ! !");
              System.out.println("count este : "+count);
              count=0;
         else
              count++;
              /* else{
                   if (data==0) {
                        'System.out.println("count este"+count);
              // if(!sendCommand("DF\r")) return 0;
              /* sendCommand("L1 1");
                   //data=mySerial.readNonBlock();
              while(data!=0)
                   sendCommand("L1 1");
                   if(data==1) // New frame
                        col=0;
                        row=0;
                   else if(data==2) // New col
                        col+=2;
                        row=0;
                   else if(data==3) // End frame
                        row=0;
                        col=0;
                   //     return 0;
                   else
                   {  // A pixel!
                        int red,green,blue,green2;
                        red=data;
                        green=mySerial.readByte();
                        blue=mySerial.readByte();
                        green2=green;
                        pix=0;
                        pix+=blue;
                        pix+=green<<8;
                        pix+=red<<16;
                        Color pixColor= new Color(pix);
                        pix=0;
                        pix+=blue;
                        pix+=green2<<8;
                        pix+=red<<16;     
                        Color pixColor2= new Color(pix);
              //     data=mySerial.readNonBlock();
              public void sendCommand(String command)
              char a,c,k,r;
              a=0;
         //     mySerial.writeStr("DF\r");
              //mySerial.writeStr("1");
              while(true){
                   try
              a=mySerial.readByte();
         //     if (a=='r') {
              //mySerial.writeStr("!and");
         //     'a=0;
              //     System.out.println(trimit !!!");
                   //     mySerial.writeStr(command);
    //     a=mySerial.readByte();
              //     c=mySerial.readByte();
         //          k=mySerial.readByte();
         //     r=mySerial.readByte();
              //     if(a=='A' && c=='C' && k=='K' && r=='\r' )
                        //return true;
              //     else
                   //     return false;
              }catch(Exception e) {System.out.println(e);}
              //return false;
              System.out.println(a);
         private int numClicks = 0;
    public void keyTyped(KeyEvent e) {
         int keyCode = e.getKeyCode();
         System.out.println("Buton Apasat !"+keyCode);
    /** Handle the key pressed event from the text field. */
    public void keyPressed(KeyEvent e) {
         int keyCode = e.getKeyCode();
         System.out.println("Buton Apasat !"+keyCode);
         switch(keyCode){
         case 38: df.misc="fa";
    /** Handle the key released event from the text field. */
    public void keyReleased(KeyEvent e) {
    public ss(String title) {
              super(title);
    //      df.dumpFrame();
    //     df.sendCommand("a");     
              //df.start();
    //          df.misc="id";
         //     test2 df=new test2();
              //     df.dumpFrame();
         //     df.sendCommand("a");
              Panel panel = new Panel();
         Panel displayPanel = new Panel();
              addWindowListener(this);
         //     displayPanel
              displayPanel.add(panel);
         //     text.addKeyListener(this);
              inainte = new Button("Inainte");
              inapoi = new Button("Inapoi");
              stanga = new Button("Stanga");
              dreapta = new Button("Dreapta");
              stop = new Button("Stop");
              panel.setLayout(new BorderLayout());
         msg_stop.setBackground(Color.red);
         msg_stop.setFont( new Font ( "Dialog", 30, Font.ROMAN_BASELINE ));
              msg_stop.setVisible(false);
         displayArea = new TextArea(5, 20);
              //panel.add(displayArea);
         panel.setLayout(new BorderLayout());
              panel.add(inainte,BorderLayout.NORTH);
              panel.add(inapoi,BorderLayout.SOUTH);
              panel.add(stanga,BorderLayout.WEST);
              panel.add(dreapta,BorderLayout.EAST);
              panel.add(stop);
              //panel.add(msg_stop,BorderLayout.EAST);
              //panel.add(text);
              this.add("Center",displayPanel);
              inainte.addActionListener(this);
              inapoi.addActionListener(this);
              stanga.addActionListener(this);
              dreapta.addActionListener(this);
              stop.addActionListener(this);
              this.setVisible(true);     
              inainte.addKeyListener(this);
              inapoi.addKeyListener(this);
              stanga.addKeyListener(this);
              dreapta.addKeyListener(this);
              stop.addKeyListener(this);
         //     addKeyListener(this);
         //     displayArea.addKeyListener(this);
         public static void main(String[] args) {
              ss myWindow = new ss("Boe Bot " +
                        "Control");
              //myWindow.setSize(300,300);
              myWindow.setLocation(400, 200);
              myWindow.setSize(200,300);
              myWindow.setVisible(true);
         public void actionPerformed(ActionEvent e) {
              String command=e.getActionCommand();
         if(command.equals("Inainte")){
              System.out.println("Inaite !!! ");     
              df.misc="fa";}
         if(command.equals("Inapoi")){
              System.out.println("Inapoi !!! ");     
              df.misc="sp";}
         if(command.equals("Stanga")){
              System.out.println("Inapoi !!! ");     
              df.misc="st";}
         if(command.equals("Dreapta")){
              System.out.println("Dreapta !!! ");     
              df.misc="dr";}
         if(command.equals("Stop")){
              System.out.println("Stop !!! ");     
              df.misc="id";}
         //     numClicks++;
         //     text.setText("Button Clicked " + numClicks + " times");
         public void windowClosing(WindowEvent e) {
              dispose();
              System.exit(0);
         public void windowOpened(WindowEvent e) {}
         public void windowActivated(WindowEvent e) {}
         public void windowIconified(WindowEvent e) {}
         public void windowDeiconified(WindowEvent e) {}
         public void windowDeactivated(WindowEvent e) {}
         public void windowClosed(WindowEvent e) {}
    thanks,
    andi

    from the screenshot it looks like there is 2 bytes of "noise" after every 8 bytes?
    print the char array next to the String. are the 2 bytes of noise the same every time?

  • I've got no response from serial port

    Hi,i found sample source code from this forum to make communication to modem. I tried that code to make communication to cellular phone which is connected to serial port by data cable. There is no response at all from the phone. I'm confused, what's wrong with the code? But if i use hyper terminal on windows 2000 to send AT commands,the phone gives responds. FYI,i use Siemens C35i cellular phone. Is there someone who can tell me what's wrong with the code ?
    Thank's very much
    Here is the code :
    import java.io.*;
    import java.util.*;
    import javax.comm.*;
    public class Coba11 implements SerialPortEventListener {
    static CommPortIdentifier portId;
    Enumeration portList;
    DataInputStream inputStream;
    DataOutputStream outputStream;
    SerialPort serialPort;
    public static void main(String[] args) {
    boolean portFound = false;
    String defaultPort = "COM1";
    Coba11 cb = new Coba11();
    cb.portList = CommPortIdentifier.getPortIdentifiers();
    while (cb.portList.hasMoreElements()) {
    System.out.println("Masuk ke dalam while");
    cb.portId = (CommPortIdentifier) cb.portList.nextElement();
    if (cb.portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
    if (cb.portId.getName().equals("COM1")) {
    System.out.println("Found port: "+defaultPort);
    portFound = true;
    try {
    cb.serialPort = (SerialPort) cb.portId.open("SimpleReadApp", 2000);
    } catch (PortInUseException e) {}
    //get inputstream and outputstream from the port
    try {
    cb.inputStream = new DataInputStream(cb.serialPort.getInputStream());
    cb.outputStream = new DataOutputStream(cb.serialPort.getOutputStream());
    } catch (IOException e) {}
    try {
    cb.serialPort.addEventListener(cb);
    } catch (TooManyListenersException e) {}
    cb.serialPort.notifyOnCTS(true);
    cb.serialPort.notifyOnDSR(true);
    cb.serialPort.notifyOnRingIndicator(true);
    cb.serialPort.notifyOnCarrierDetect(true);
    cb.serialPort.notifyOnOverrunError(true);
    cb.serialPort.notifyOnParityError(true);
    cb.serialPort.notifyOnFramingError(true);
    cb.serialPort.notifyOnBreakInterrupt(true);
    cb.serialPort.notifyOnDataAvailable(true);
    try {
    cb.serialPort.setSerialPortParams(19200, SerialPort.DATABITS_7,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
    } catch (UnsupportedCommOperationException e) {}
    //send commands to the cellular phone
    String atCommand = "ATD08128533615";
    try {
    cb.outputStream.write(atCommand.getBytes());
    atCommand = "AT";
    Thread.sleep(1000);
    cb.outputStream.write(atCommand.getBytes());
    }      catch (IOException e) {}
         catch (InterruptedException e) {}
    try {
    Thread.sleep(40000);
    atCommand = "AT";
    cb.outputStream.write(atCommand.getBytes());
    Thread.sleep(500);
    }      catch (InterruptedException e) {}
         catch (IOException e) {}
    try {
         cb.inputStream.close();
         cb.outputStream.close();
    } catch (IOException e) {}
    cb.serialPort.close();
    System.out.println("Serial Port is closed");
    if (!portFound) {
    System.out.println("port " + defaultPort + " not found.");
    public void serialEvent(SerialPortEvent event) {
    switch (event.getEventType()) {
    case SerialPortEvent.DATA_AVAILABLE:
    byte[] readBuffer = new byte[20];
    try {
    int numBytes = inputStream.read(readBuffer);
    String string = new String(readBuffer);
    System.out.print(string);
    } catch (IOException e) {}
    break;

    the very first command you have to send to the modem is AT
    wait 2 seconds then start sendind other commands

Maybe you are looking for

  • ColorProfile error ColorySync After installing Photoshop

    Dear Readers and Happy Photoshop Users, I would like to Inform you, when you are working on a Mac, and you use the ColorySync Utility, you might have already saw an issue on the following profiles, when trying to Verify these Colorprofiles:      - An

  • How to create .sda file for tables directly created in SQL ,not Dictionary

    Hi friends, According to my project requirements, I need to create tables in a different schema than the default location provided. hence I have created my tables using the SQL client rather than creating the Dictionary project and then deploying. Bu

  • Excel Add-in Dbl Click issue

    I have a fresh install of windows & office. I installed 9.3.0 client. I restarted the computer and did the following 1. Opened Excel and connect to the server. 2. Did Retieve 3. Double click on any member BANG!! Closes the whole excel

  • My phone won't turn on for me to update it.... HELP!

    I can't turn on my phone to update it. What do I need to do??

  • Table Import Configuration behaviour

    Hi All,      I am using multiple .hdbti  and .csv files from different delivery units to load data to a single table. After first activation the required data is inserted in to the table from the .CSV files. But during subsequent update of data value