Non standard baud rates serial support?

1. I have a microcontroller board sedind data tp FT232R(usb uart IC) which then forms a COM port on PC to commnicate with labview serial visa.
2. I am able to communicate with standard baud rates with any problem like 9600 or 38400 bps.
3. I want to know can I can communicate wit non-standard baud rates like 500Kbps with labview also???

Dennis_Knutson wrote:
Where did I say that the VISA baud rate is an enum?
My Bad - I wasn't paying attention!  No wonder I seldom attempt to correct you!
So lets talk about serial baud rates.  LabVIEW does not have anything to do with it other than implement calls to the VISA API- VISA not LabVIEW handles serial communications.
VISA does not limit serial baud rate to anything other than "a positive non zero integer "(Actually a 0 baud rate just garuntees a timeout error and is silly, negative baud rates are sillier still- think about it for a moment)
Most hardware today detects the clock rate of the incomming TX and adapts baud properly.
Some legacy devices exist that were designed prior to the advent of clock recovery.  These are mostly obsolete and should be considered for replacement.
Some modern hardware that could support clock recovery has firmware developed without support for the feature either for "optimization" (it may be run from an underpowered CPU) or because the developer has been copy-pasting that same #include for decades.  Those firmware engineers are also mostly obsolete and IMHO should be considered for replacement.
All that being said 500K baud is not inconcievable- but, you better watch out for noise in your cabling and inside the hardware too! including the COM port of the PC!
Jeff

Similar Messages

  • Need std and non-std baud rates on PXI-8420 (16 channel RS232)

    I found a similar request on the knowledge base, and the resolution was possibly NI would make a card on a case-by-case basis.
    I need the forementioned PXI card to support std and non-std baud rates (i.e. not a simple xtal change, and the software sets up for 57.6 Kbaud, and it is really 62.5 Kbaud) that is easily configured in LabVIEW/VISA.
    The rates I need are as follows:
    All std rates (i.e. 1200,2400,4800,9600,...)
    10.4K (possible with std ports, but unsure about NI hardware and VISA).
    62.5K
    Thanks.
    62.5K

    The golden rule in serial (UART) communication, is that if two communicating partners are within +-2% of each other, they'll happily communicate error-free. Since you often only know one side of the equation, the window narrows to +-1%.
    Next, take a look at how baud rates are calculated. On most NI-Serial hardware, there is a 7.3728 MHz oscillator that is divided by 16 (to create the what I'll call the 'base' frequency), and then divided again by a divisor latch. A divisor latch value of 1 yields 460800, 2 = 230400, 3 = 153600, etc. This is where the 'standard' baud rates come from.
    However, on some OS's, we divide the clock source again by 4 before it hits the divisor latch. This means 1 = 115200, 2 = 57600, etc. While this does creat
    e a set of 'standard' baud rates, it also limits the number of possible baud rates. This is something that will be fixed in the future.
    Now hopefully the following table will make sense. In systems that have a base of 460800, we support baud rates that are within +-1% of the following (baudrates marked with * are supported in 115200 base systems):
    110-9216*, 9404, 9600*, 9804, 10017, 10240, 10472*, 10716, 10971, 11239, 11520*, 11815, 12126, 12454, 12800*, 13165, 13552, 13963, 14400*, 14864, 15360, 15889, 16457*, 17066, 17723, 18432, 19200*, 20034, 20945, 21942, 23040*, 24252, 25600, 27105, 28800*, 30720, 32914, 35446, 38400*, 41890, 46080, 51200, 57600*, 65828, 76800, 92160, 115200*, 153600, 230400, 460800.
    10.4k is supported in both systems at the baud rate 10472.
    If you're running at 62.5k when set to 57.6k, then you're likely using a 8 Mhz Oscillator. In this case, you have a base of 500000, and with a divisor latch value of 48 you'll be running at 10416. This cor
    responds to a 'normal' baud rate setting of 9600. So if you set your modified card to 9600, you should get 10.416k.

  • Slow Baud Rate serial port (VISA)

    The last version of LabVIEW, 7.1, has the serial functions incorporated on VISA Resources, and it doesn´t possible to work with baud rate lower than 110 bps. I have a big stuff of applications that works with 5 bps. It´s a serial protocol that send a byte, e.g AA (hex) via serial line, with 5 bps, and after the rate is increased.
    I tried to use dll (CIN Function) but I think is impossible, cause the resource declared at the c code, so Im thiking to use a dedicated COM Dll, and use Call library Function)
    I´d like to know if somebody has a tip or similar problem.
    Thanks in advance
    Fabrizio
    Test Engineer

    Matthias Müller writes:
    > Hello,
    > I'm using LabView to controll a spektrometer through the serial port. I
    > use VISA for the communication with the device. Unfortunately, the
    > device is always in 9600baud mode after power on. So I have to change
    > the baud-rate each time by a command i send to the device. So I open a
    > VISA session in 9600 mode and communicate with the divice to set it to
    > 57600baud. After that, i have to reset my local serial port to the same
    > baud-rate. I do this with an property-node, where i change 'Serial Baud
    > Rate'.
    > Unfortunately, after I did this, the vi's that want to communicate after
    > the reset of the baud-rate stop with an error:
    > -1073807298
    > VI_ERROR_IO
    > Could not perform read/write operation
    because of I/O error.
    >
    > (I try to write to the serial port after change of the baud-rate)
    >
    > I would be very glad, if someone could give me an advice, why it doesn't
    > work, or how to make it work.
    > Thank you a lot.
    > Matthias
    Matthias,
    my first approach would be to close the first VISA session after the
    property node. Data dependency is achieved by the error cluster feed
    into a new session with the new properties.
    IMHO you've discovered another bug in serial VISA.
    HTH,
    Johannes Nieß
    P.S:What brand/modell of spectrometer are you programming for?

  • Non standard baudrate

    Dear All,
    I want to access the device with non standard baudrate. Everytime I set the baudrate, serial port always return a default baudrate which is 9600.
    (Always failed)
    Is there anybody knows how to set a non standard baudrate in Java?
    Currently I'm using Linux as a platform.
    Regards

    Those standard baud rates don't just exist for the fun of it. Devices,
    especially simple devices, use a clock crystal to derive their baud rates.
    Even 'baud rate friendly clock crystals' exist for this very purpose.
    If you have to deal with a device that uses a non-standard baud rate,
    return it to the shop, complain and demand a 100% refund.
    kind regards,
    Jos

  • RS232 baud rate

    Hello,
    I am using the javax.com package in order to manage serial port. My application is well running when I use standard baud rate (9600, 19200...).
    I have a problem because I need to transfer data with a non standard baud rate (in this case the value by default is 9600).
    Is there a mean to program a non standard baud rate?
    Thank you

    Baud rate is a mess, it goes back to the OS. Most provide a set of constants such as
    B0
    B50
    B75
    B110
    B134
    B150
    B200
    B300
    B600
    B1200
    B1800
    B2400
    B4800
    B9600
    B19200
    B38400
    B57600
    B115200
    B230400
    which define the standard baud rates. There are sometimes ways around these, often you can just use the next higher than your hardware needs. See "man termios" to see what's behind javax.comm.

  • Non standard baudrate setting

    Dear All,
    I'm new in java programming and using Linux as my platform. Currently I want to connect some device with a non standard baudrate. Then something happens, everytime I set the baudrate in the code when I run it, the baudrate always changing into default baudrate (9600). Is there any other way to use non standard baudrate in Java?
    Regards

    Those standard baud rates don't just exist for the fun of it. Devices,
    especially simple devices, use a clock crystal to derive their baud rates.
    Even 'baud rate friendly clock crystals' exist for this very purpose.
    If you have to deal with a device that uses a non-standard baud rate,
    return it to the shop, complain and demand a 100% refund.
    kind regards,
    Jos

  • How exact does the baud-rate must be configured?

    Hallo!
    I have troubles to configure the baud-rate of the CAN-module of the TMS320LF2406 DSP.
    I can programm 122500 baud or 127500 baud, but not 125000. What is the tolerance for the baud-rate of the ni-can PCMCIA board?
    When I select 125kBaud for ni-can I get an error: stuff or form failure when receiving.
    Golubkov Andrej

    If you have to run it at 122500 or 127500 baud, you can manually type in the baud rate. I currently have my card running at 800000 baud which is not a standard baud rate, so perhaps the 122500 or 127500 baud rate will work. attached is the code i used to set the baud rate. (altered for 122500 baud rate)
    AttrIdList(0) = NC_ATTR_BAUD_RATE
    AttrValueList(0) = 122500
    AttrIdList(1) = NC_ATTR_START_ON_OPEN ' CAN Network Interface Object starts automatically
    AttrValueList(1) = NC_TRUE
    AttrIdList(2) = NC_ATTR_READ_Q_LEN
    AttrValueList(2) = 0
    AttrIdList(3) = NC_ATTR_WRITE_Q_LEN
    AttrValueList(3) = 0
    AttrIdList(4) = NC_ATTR_CAN_COMP_STD ' CAN arbitration ID for the standard frame comparator.
    AttrValueList(4) =
    NC_CAN_ARBID_NONE
    AttrIdList(5) = NC_ATTR_CAN_MASK_STD
    AttrValueList(5) = NC_CAN_MASK_STD_DONTCARE
    AttrIdList(6) = NC_ATTR_CAN_COMP_XTD
    AttrValueList(6) = NC_CAN_ARBID_NONE
    AttrIdList(7) = NC_ATTR_CAN_MASK_XTD
    AttrValueList(7) = NC_CAN_MASK_XTD_DONTCARE
    Status = ncConfig("CAN0", 8, AttrIdList(0), AttrValueList(0))
    txtStatus = CheckStat(Status, ("ncConfig " & checkCAN)) ' check for errors
    If (txtStatus <> "") Then GoTo error:
    Hopefully this works for you.
    Marty

  • Does labview 5.0 support serial communication at a baud rate of 115200?

    When I try to initialise my serial port at 115200 baud rate I get error 32, device paramter error. I'm running labview 5.0. Can anyone help me with this?

    I use Serial Port Init.vi to set the baud rate to 115200 with no problem in LabView 5.0 under Windows 95.
    I get error 38 when I try a non-supported baud rate.
    Do you get the error when you run Serial Port Init.vi directly or just when you call it from your VI? On the diagram where you call Serial Port Init.vi, try placing a probe on the wire going to the baud rate input of Serial Port Init to see what value it's trying to set. You will have a problem going to 115200 if the control on your VI is represented as I16 or U8 or if the data range max doesn't go to 115200.

  • What is the NI/Labview Limit on Baud Rate for a serial connection? Is 9600 the limit?

    Hello all,
    Is 9600 the max baud rate for LV? I'm currently using a LV RS232 cable in a loopback configuration to test...using 9600..and it works fine.
    What I wil be hooking eventually, they said they'd want to run it at 62,500 due to the crystal on the hardware this will be eventually hooking too.
    I just tried adjusting my baud rate on my loopback set up to 62,500....to see what would happen, and it error'd out.
    I'm hoping this can run faster than 9600...and when searching through the forum posts here...I seem to see things saying that it can......
    Any suggestions or links to info on this?
    Thanks in advance,
    cayenne

    It may be possible to do custom baud rates with standard hardware if you have the right hardware.
    I'm doing some cRIO/EtherCAT programming for an NI-9870 RS-232 module and got to wondering about some configurable properties called "Baud Rate Divider" and "Baude Rate Scaler" and found the following information on this page:  http://zone.ni.com/reference/en-XX/help/370984T-01/lvaddon11/crio-9870/
    Property
    Description
    Baud Rate (write only)
    Sets the target baud rate for the port. If you set the baud rate, the appropriate Baud Rate Prescaler and Baud Rate Divider are set automatically, and are calculated according to this formula:
    BaudRate = 3.6864 Mbps / (Prescaler * Divider)
    Note  The maximum Baud Rate for the NI 9870 is 921.6 Kbps.
    Baud Rate Divider (read/write)
    Specifies the divider for the baud rate as defined by the baud rate equation above. This property is useful for setting a custom baud rate programmatically. Use the C Series Module Propertiesdialog box as a calculator to find the appropriate divider for the desired custom baud rate. This value is an unsigned 16-bit value within the range 4–65535.
    Note  Any values outside of the valid range will be coerced into the range.
    Baud Rate Prescaler (read/write)
    Specifies the prescaler for the baud rate as defined by the baud rate equation above. This property is useful for setting a custom baud rate programmatically. Use the C Series Module Properties dialog box as a calculator to find the appropriate prescaler for the desired custom baud rate. This value is defined as a type def, either 1 or 4. A value of 4 is normally used only for very low baud rates.
    I'm fairly certain that the NI-9870 will work in other non-cRIO backplanes (like the USB-based NI cDAQ-9174) but whether or not it will support these same options in an alternate backplane is unknown to me. If you are interested, contact your NI technical sales person and ask them to get you an answer.

  • CRIO-9014 serial baud rate

    Hello,
    I have a cRIO-9014 system and am trying to communicate with a device through the built in serial port. The device I am using requires a different baud rate than the default 9600 I find in settings under MAX. Is there a way anyone knows of to change the cRIO serial port's baud rate (under MAX the settings are grayed out).
    Thanks,
    Dan

    I was looking for this information, but my cRIO-9014 seem to be perfectly happy with opening and using a baud rate of 230400, out it errors out if I try any of the (standard) settings over that.. (This contradicts the answer given above that cRIO9014 maxes out at 115200 baud.)
    Is this dependent on the hardware revision of the cRIO-9014?  My R&D unit is a newer 9014 but I'm developing a module that would be doing file transfers over the RS232 for some 9014's that are a few years old and I'm curious if we can expect the 230400 rate to work on those like it does on my R&D 9014?
    I did not see any mention of supported baud rates in the 9014 OPERATING INSTRUCTIONS AND SPECIFICATIONS from 2013 and I'm curious if there is another public document that contains such information?
    --And since I already did a thread-resurrection, does anyone know if there is an NI or 3rd party USB to serial (RS485 ideally) dongle that can be accessed via NI VISA on a cRIO-9014??
    QFang
    CLD LabVIEW 7.1 to 2013

  • Termios.h and 921600 baud rate support

    Hi,
    I've been porting my application from Linux to Mac OS X when I got stuck with serial port support, the lack of 921600 baud rate in particular. There are no definitions of speeds higher than 230400 in the termios.h file. Defining it manually using the constants from Linux doesn't help either.. as it's simply not implemented. Is there any way I can get this?
    Thanks in advance,
    Piotr

    Starting with Tiger, the IOSSIOSPEED ioctl can be used to set arbitrary baud rates other than those specified by POSIX. The driver for the underlying serial hardware ultimately determines which baud rates can be used. This ioctl sets both the input and output speed. The speed will not be reflected in the termios structure.
    <pre>
    speed_t speed = 14400; // Set 14400 baud
    if ( ioctl( fileDescriptor, IOSSIOSPEED, &speed ) == -1 )
    printf( "Error %d calling ioctl( ..., IOSSIOSPEED, ... )\n", errno );
    </pre>

  • Help with custom page size support for non standard paper

    Firstly, we appreciate any support you may be able to provide, we have already thrown considerable effort at this and it has been very time consuming and frustrating.
    To support a number of business functions need to print to (non standard) continuous and mulitpart paper on a dot matrix printer. The (test) Mac is a 10.4.11 G4 laptop, the printer is an Oki Microline 520 (9 pin 80 column, IBM Proprinter, Microline or Epson FX personalities with a parallel interface) which has been networked via a HP JetDirext Ex Plus print server. That part appears to be operating correctly.
    We have tried a number of drivers / printer personalities with varying levels of success:
    ESP / EPSON 9-Pin Series CUPS v1.1 / Epson FX personality
    ESP / OKIDATA 9-Pin Series CUPS v1.1 / Oki Microline personality
    Ghostscript / epsonc / Epson Dot Matrix Foomatic PPD / Epson FX personality
    Ghostscript / ibmpro / IBM ProPrinterII Foomatic PPD / IBM Proprinter personality
    Ghostscript / okiibm / Oki Microline IBM compatible 9 pin Foomatic PPD / IBM Proprinter personality
    There were no appropriate drivers in Gutenprint (5.2.3 version) The most successful is the okiibm / Oki Microline IBM compatible 9 pin settings, it can print A4 and honors the Printer Features Resolution settings in the print dialogue.
    Q1: Should we see anything in the Printer Info / Installable Option, it is always blank ?
    The issue is custom page sizes, we can manage / add Custom Pages Sizes via the Page Setup / Paper Size interface and they draw on the screen OK but they do not work at the printer (various issue at the printer such error messages, junk printing and wrong orientation):
    Q2: Are we heading in the right direction or is there a better way to handle this ?
    Q3: Would 10.5 solve all our problems, are the print drivers any better ?
    Q4: Is this the correct way to specify custom page sizes, is this all we need to do ?
    Q5: Is so how do we get the driver to respect the size, do we need another filter or something ?
    Q6: Is it possible to add (by hand) custom page sizes to the ESP drivers or Foomatic PPD files so they they appear as a "standard" offering in the Page Setup / Paper Size interface ?
    Sorry for the long / complicated post and thanks in advance for any advice / assistance.

    Matt Broughton wrote:
    Testing on 10.5.7, Tried both Oki 9-Pin Series 1.3 / Microline personality (no joy) and Epson 9-Pin Series 1.3 (this is a much better driver than 1.1) / Epson FX personality but not much joy with custom page sizes,
    The Oki 9-pin Series 1.3 and the Epson 9-Pin Series 1.3 should produce the same results. The only difference in the PPDs is the printer model name.
    After some testing, I find that the output is not the same despite the two PPDs being virtually identical. I did spot in the CUPS source code for the rastertoepson filter that there is some model name matching for Epson printers. Thus I can see where the output using the Oki 9-pin PPD could be different than when using the Epson 9-pin PPD.
    but again once I imbedded the page size into the ppd some (but frustrating) luck. I can get it to respect the paper orientation and it prints well but I could not get the form length to work properly. At best over a print run of 7 labels it would creep up the label by about 0.1 inches / 2 mm.
    Just for the fun of it, I made some additions to the Epson 9-pin 1.3 PPD. All I can say is that I could print a job to file. I have no way to know what it would look like on paper.
    I did find that using a custom paper size did add some unwanted margins to the output bounding box. Putting the custom page size into the PPD seemed to get around that issue.
    I added the following lines to the Epson 9-pin PPD 1.3--
    <pre style="overflow: auto;font-size:small; font-family: Monaco, 'Courier New', Courier, monospace; color: #222; background: #ddd; padding: .3em .8em .3em .8em; font-size: 9px;">*PageSize Label1/Label1: "<</PageSize[288 107.8]/ImagingBBox null>>setpagedevice"
    *PageRegion Label1/Label1: "<<PageSize[288 107.8]/ImagingBBox null>>setpagedevice"
    *ImageableArea Label1/Label1: "0 0 288.00 107.80"
    *PaperDimension Label1/Label1: "288.00 107.80"</pre>
    This adds a paper size with the 4 inch (288pt) width and 1.5 inch (107.8pt) height. That represents the 1.4 inch label and the 0.1 inch gap between labels. I set 0pt margins except for the bottom where is set the 0.1 inch (7pt) gap as the bottom margin.
    The full diff in context is--
    <pre style="overflow: auto;font-size:small; font-family: Monaco, 'Courier New', Courier, monospace; color: #222; background: #ddd; padding: .3em .8em .3em .8em; font-size: 9px;">loki:~ matt$ diff -u /usr/share/cups/model/epson9.ppd ~/Desktop/epson9.ppd
    --- /usr/share/cups/model/epson9.ppd 2009-02-20 20:16:53.000000000 -0600
    +++ /Users/matt/Desktop/epson9.ppd 2009-06-06 20:37:06.000000000 -0500
    @@ -42,6 +42,7 @@
    *PageSize Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice"
    *PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
    *PageSize FanFoldUS/US Fanfold: "<</PageSize[1071 792]/ImagingBBox null>>setpagedevice"
    +*PageSize Label1/Label1: "<</PageSize[288 107.8]/ImagingBBox null>>setpagedevice"
    *CloseUI: *PageSize
    *OpenUI *PageRegion/Media Size: PickOne
    *OrderDependency: 10 AnySetup *PageRegion
    @@ -50,17 +51,20 @@
    *PageRegion Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice"
    *PageRegion A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
    *PageRegion FanFoldUS/US Fanfold: "<</PageSize[1071 792]/ImagingBBox null>>setpagedevice"
    +*PageRegion Label1/Label1: "<<PageSize[288 107.8]/ImagingBBox null>>setpagedevice"
    *CloseUI: *PageRegion
    *DefaultImageableArea: Letter
    *ImageableArea Letter/US Letter: "18.00 18.00 594.00 774.00"
    *ImageableArea Legal/US Legal: "18.00 18.00 594.00 990.00"
    *ImageableArea A4/A4: "18.00 18.00 577.00 824.00"
    *ImageableArea FanFoldUS/US Fanfold: "18.00 18.00 1053.00 774.00"
    +*ImageableArea Label1/Label1: "0 0 288.00 107.80"
    *DefaultPaperDimension: Letter
    *PaperDimension Letter/US Letter: "612.00 792.00"
    *PaperDimension Legal/US Legal: "612.00 1008.00"
    *PaperDimension A4/A4: "595.00 842.00"
    *PaperDimension FanFoldUS/US Fanfold: "1071.00 792.00"
    +*PaperDimension Label1/Label1: "288.00 107.80"
    *MaxMediaWidth: "1080.00"
    *MaxMediaHeight: "86400.00"
    *HWMargins: 18.00 18.00 18.00 18.00</pre>
    I don't know if that will help you or not. Let us know what sort of progress you make.
    Matt

  • Non-standard interfaces must be server-side before de-serializing?

    Classes which implement non-standard interfaces are a problem for de-serialization? In the below code SomeInterface is the problem. If the "SomeInterface.class" is not server-side when the de-serialization starts then the de-serialization can't happen? Please look at this test code:
    client
    public class Main {
      public static void main(String[] args) {
        try {
          Socket sok = new Socket("192.168.2.2", 1638);
          MyOOS moos = new MyOOS(sok.getOutputStream());
          moos.writeObject(new ClassA(222));
          try { Thread.sleep(3000); } catch(InterruptedException e) { }
          sok.close();
        } catch(Exception e) { e.printStackTrace() ; }
      private static byte[] getClassImage() throws Exception {
        InputStream in = new FileInputStream(new File("/dev/ClassA.class"));
        List<Byte> objClassImage = new ArrayList<Byte>();
        int b = in.read();
        while(b != -1) {
          objClassImage.add(Byte.valueOf((byte) b));
          b = in.read();
        byte[] classImage = new byte[objClassImage.size()];
        for(int i = 0; i < classImage.length; i++) {
          classImage[i] = ((Byte) objClassImage.get(i)).byteValue();
        in.close();
        return classImage;
            static class MyOOS extends ObjectOutputStream {
              MyOOS() throws Exception { super(); }
              MyOOS(OutputStream out) throws Exception { super(out); }
              protected void annotateClass(Class<?> cl) throws IOException {
                try {
                  byte[] classImage = getClassImage();
                  writeInt(classImage.length);
                  write(classImage);
                } catch(Exception e) { e.printStackTrace(); }
    // public class ClassA implements Serializable, SomeInterface  {  // <-- bad
    public class ClassA implements Serializable  { // <-- good
      int id;
      ClassA(int i) { id = i; }
      public void foo() {
        System.out.println("ClassA::foo--> id = " + id);
    public Interface SomeInterface { public void foo(); }
    server
    public class Hello {
      static MyClassLoader myLoader = new MyClassLoader();
      public static void main(String[] args) { new Hello().run(); }
      void run() {
        try {
          ServerSocket servSok = new ServerSocket(1638);
          Socket sok = servSok.accept();
          MyOIS mois = new MyOIS(sok.getInputStream());
          Object obj = (Object) mois.readObject();
          Method m = obj.getClass().getMethod("foo", null);
          m.invoke(obj, null);
        } catch (Exception e) { e.printStackTrace(); }
          static class MyClassLoader extends ClassLoader {
            byte[] classImage;
            // is this a normal way to program Java? Because I am unsure about how to handle the byte[] in
            // resolveClass(), I am jamming them in here. Would a good programmer do stuff like this?
            public Class<?> loadClass(String name, byte[] classImage) throws Exception {
              this.classImage = classImage;
              return loadClass(name);
            protected Class<?> findClass(String name) throws ClassNotFoundException {
              return defineClass(name, classImage, 0, classImage.length);
          static class MyOIS extends ObjectInputStream {
            private MyClassLoader myLoader = new MyClassLoader();
            MyOIS() throws IOException { super(); }
            MyOIS(InputStream in) throws IOException { super(in); }
            protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
              try {
                int classImageSize = readInt();
                byte[] classImage = new byte[classImageSize];
                read(classImage);
                return myLoader.loadClass(desc.getName(), classImage);
              } catch (Exception e) { e.printStackTrace(); }
              return null;
    }If a serialized object implements an interface that is not already on the de-serializing jvm end, then serialization is not possible? Am I suppose to put the SomeInterface object on the server (somehow) before de-serializing an object that actually implements SomeInterface .
    I have heard of object graphs. So, would not the implemented interfaces be part of an object's object graph? Thanks.

    ejp wrote:
    I have no idea what any of that means, if anything, but RMI comes with a dynamic codebase facility if that's what you're looking for.I successfully moved an object with a non-standard pure abstract class to a remote jvm:
    client
    public class Main {
      public static void main(String[] args) {
        try {
          Socket sok = new Socket("192.168.2.2", 1638);
          MyOOS moos = new MyOOS(sok.getOutputStream());
          DataOutputStream dos = new DataOutputStream(sok.getOutputStream());
          byte[] classImage = getClassImage("/dev/PureAbstractClass.class");
          dos.writeInt(classImage.length);
          dos.write(classImage, 0, classImage.length);
          moos.writeObject(new ClassA(5));
          try { Thread.sleep(3000); } catch(InterruptedException e) { }
          sok.close();
        } catch(Exception e) { e.printStackTrace() ; }
      private static byte[] getClassImage(String path) throws Exception {
        InputStream in = new FileInputStream(new File(path));
        List<Byte> objClassImage = new ArrayList<Byte>();
        int b = in.read();
        while(b != -1) {
          objClassImage.add(Byte.valueOf((byte) b));
          b = in.read();
        byte[] classImage = new byte[objClassImage.size()];
        for(int i = 0; i < classImage.length; i++) {
          classImage[i] = ((Byte) objClassImage.get(i)).byteValue();
        in.close();
        return classImage;
            static class MyOOS extends ObjectOutputStream {
              MyOOS() throws Exception { super(); }
              MyOOS(OutputStream out) throws Exception { super(out); }
              protected void annotateClass(Class<?> cl) throws IOException {
                try {
                  byte[] classImage = getClassImage("/dev/ClassA.class");
                  writeInt(classImage.length);
                  write(classImage);
                } catch(Exception e) { e.printStackTrace(); }
    public abstract class PureAbstractClass {
      public abstract void foo();
      public abstract void bar();
    public class ClassA extends PureAbstractClass implements Serializable {
      int id;
      ClassA(int i) { id = i; }
      public void foo() { System.out.println("PureAbstractClass::ClassA::foo id = " + id); }
      public void bar() { System.out.println("PureAbstractClass::ClassA::bar id = " + id); }
    server
    public class Hello {
      static MyClassLoader myLoader = new MyClassLoader();
      public static void main(String[] args) { new Hello().run(); }
      void run() {
        try {
          ServerSocket servSok = new ServerSocket(1638);
          Socket sok = servSok.accept();
          MyOIS mois = new MyOIS(sok.getInputStream());
          DataInputStream dis = new DataInputStream(sok.getInputStream());
          int classImageSize = dis.readInt();
          byte[] classImage = new byte[classImageSize];
          dis.read(classImage, 0, classImageSize);
          myLoader.myDefineClass("PureAbstractClass", classImage, 0, classImage.length);
          Object obj = (Object) mois.readObject();
          Method m = obj.getClass().getMethod("bar", null);
          m.invoke(obj, null);
        } catch (Exception e) { e.printStackTrace(); }
            static class MyClassLoader extends ClassLoader {
              byte[] classImage;
              public Class<?> loadClass(String name, byte[] classImage) throws Exception {
                this.classImage = classImage;
                return loadClass(name);
              protected Class<?> findClass(String name) throws ClassNotFoundException {
                return defineClass(name, classImage, 0, classImage.length);
              public Class<?> myDefineClass(String name, byte[] classImage, int x, int y) {
                return defineClass(name, classImage, x, y);
            static class MyOIS extends ObjectInputStream {
              MyOIS() throws IOException { super(); }
              MyOIS(InputStream in) throws IOException { super(in); }
              protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
                try {
                  int classImageSize = readInt();
                  byte[] classImage = new byte[classImageSize];
                  read(classImage);
                  return myLoader.loadClass(desc.getName(), classImage);
                } catch (Exception e) { e.printStackTrace(); }
                return null;
    }I hope this relates to understanding RMI. Moving objects that extend non-standard classes and implementing non-standard interfaces is not easy. Or, maybe there is an easier way. Anyway, thanks ejp. Yesterday I was extremely confused. Now, I am just a little confused but think I have basic understanding. I feel big progress was made.

  • Serial baud rate vs. high speed CAN

    The bottleneck in my current app is the serial writes at 115200, to a custom device.  The program dramatically improves in speed as the baud rate is increases.  If i remove the serial write and read, the program loop time improves from 100 to 2000htz 
    The device also has a CAN interface.  Im debating trying to use the NI CAN interaface card to see if there are improvments in speed but want to get an opinoin first since this will require considerable reprogramming.  The can card appears to be just two serial ports but yet, accoring to specs, appears faster.
    http://zone.ni.com/devzone/cda/tut/p/id/2732
    Its difficult to try to compare serial and can speeds. CAN is up to 1mbits a sec while 115200 is measuring baud.  After considerable reserach to compare the two, i still am having difficulty. Im not sure these comparisions are even valid as Im more instrested in in sending one charcter and then recieving it rather than contual streaming of data whch is what these rates measure.

      This is a custom servotube powered by an amplifier.  The servo has a renishaw encoder for 1um resolution. The application requires reading the position of the renishaw encoder every iteration.  This positional information is then logged into the data.  The position is independent of the feedback loop but it is important for the research. The feedback loop itself is determined by a strain gauge and 9237 module which compute loading forces of the servotube, and this is converted to analog output value via pid and then sent via an ni analog output module to the differential input on the amplifier.  The differential inputs on the amplifier will create a current (I) for the servotube value based on the voltage it receives.
     The bottleneck only has to do with the serial port.  Reading the serial port can be accomplished with the serial or can interface.  Using the serial port, the commands to get the position and then read receive it back, can occur at a rate of around 350 iterations a second at the highest baud, 115200. This 350 iterations is if there is nothing else in the loop other than visa read and write of the serial port with no delays. Its the best case scenario and when the additional code is in place, we are getting more like 100 iterations a second. 
    So the baud rate speed dosent seem to apply?  It is really a delay in the send and receive each time the communication is initiated?  That is why the can interface might be better?    Programming the NI can card seems a little tricky and i want to be sure it will offer improvement before jumping into this task. 
    Maybe there is a chip or something NI has to read the position of the reinshaw on the available NI AD cards we have on the system.?  It would then reduce the bottneck?
    Message Edited by Biosolutions on 10-15-2009 07:47 AM

  • What is the minimum baud rate that PXI 8461 CAN support

    what is the minimum baud rate that pxi 8461 CAN support

    Hi,
    The PXI-8461 is the high speed CAN. The minimum baud rate is 5kBits/s. Refer to the following Knowledge base article:
    CAN Physical Layer Standards: High-Speed vs. Low-Speed/Fault-Tolerant CAN
    Hope this helps.
    DiegoF.
    National Instruments.

Maybe you are looking for

  • My old tool bar is not compatible with Firefox 4 Beta. How do I get rid of 4 Beta and go back to my old Firefox browser?

    One of my social networks, MyYearbook.com , has it's own tool bar, which I use extensively. But, for some reason, it is not compatible with the new Firefox 4 beta, and will not load. How do I uninstall 4 beta and go back to my older version of Firefo

  • Urgent: Error-Record 39,779, segment 0001 is not in the cross-record table

    Hi Gurus, This is an urgent production issue: I got the following error- I am updating data records from a DSO to Infocube in delta mode, 1.Record 39,779, segment 0001 is not in the cross-record table 2.Error in substep: End Routine I dont know probl

  • Error when query is run

    Hi Gurus, When the query is run, it takes forever and hten come with this messages: 1) An Exception with the type CX_SY_SHARED_MEMORY occured, but was neither handled locally nor declared in RAISING 2) No space left in memory Note: This was running O

  • Account Receivable

    We are finding it difficult to map the following scenario in FI (Accounts Receivable) module  in standard SAP :   1.  While doing progress billing to our customer we have to adjust 10 % of each bill value against advance (down payment) received from

  • Exit required to "drop" two segments from an IDOC

    hi, how can we dropped some of the segments in we02 according to my condition.can somebody tell me how to find out the program means where we can see the idoc data is populating in segments.in we02 i am finding 6 segments with E1EDP10.i want to drop