Serial port writing return different in MAX and Labview

Dear all,
I have a very strange problem here. I had a device connected to the serial port, which can be started by sending "start\n".
Firstly, I used the IO in MAX to send "start\n", like the first figure, and the device operated correctly.
Then, I initialized the device, and used the program in the second figure, to write the same "start\n", but this time the device operated wrong.
I think the serial port setting are the same, and the device is not failed (after the second step, I repeated using MAX and still it's OK).
Could anyone to check what's wrong here?
Many thanks!

In your LabVIEW code, how do you know that it did not work?
Did you receive and error on the error indicator?  You don't have any VISA Read going on, so you aren't trying to read the response.

Similar Messages

  • Different results from MAX and Labview

    Hi all,
    We did an impact testing a couple of days ago, and I got very big acceleration (the peak is about 300g, which is much larger than the estimated value).
    And then I tried a small imact test in the lab using a steel plate which is less than 1 lb to impact a steel ruler, I still got big peak number (more than 200g, which is impossible). And then I tried the small impact test again by using MAX, the peak number is about 12g, and the curve seems like pretty reasonable. I was wondering why I got different results by using MAX and Labview?
    Also, sometimes when I connect the SCXI-1001 to the computer, it says the USB is malfuntion and cannot be recgonized by the computer, and turns out the driver file does not exists. But most of the time, it works very well and the driver file does exists. Why this happened?
    Thanks.
    Yuan

    jyuan wrote:  but I want to clike one "run button" and get data from strain gage, LVDT, accelerometer at the same time and our tesing duration is just about a few seconds. And also I didn't find a place where I can record the data in MAX
    You can do that.  A task can only have the same types of inputs, meaning Analog Input, Analog Output, Digital Input, Digital Output, etc.  Different sensors are just read with Analog Inputs.  So they all can be in the same task.  In MAX, just set up a task a configure each channel as it should be.  Then use that single task in your LabVIEW code.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • 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

  • MAX and VISA displays extra COM port

    From the Windows 2000 -> Control Panel -> System, it displayed that there are the following ports:
    COM1 - Serial port
    LPT1 - Parallel port
    COM2 - USB-to-serial port
    However, when checked with MAX & VISA, it displays an extra port:
    ASRL1:INSTR (COM1)
    ASRL2:INSTR (COM2)
    ASRL3:INSTR (COM3)
    ASRL10:INSTR (LPT1)
    I don't know where does the COM3 comes from, or how to eliminate it. I have tried to take out the reference to COM3 on the visaconf.ini , but it reappears.
    At the same time, I am having Labview crashes problem (access violation) after I communicate with the instrument connected via COM2 (Labview.exe crashes on a 2nd run of the same script, which needs restarting of computer before it will work again, for one r
    un and crash again on the 2nd run). Does this problem has anything to do with the appearance of COM3?
    Please help!
    Thanks
    Vanessa

    Vanessa:
    I believe COM3 is still in your registry under HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. It is possible that it existed at one time previously and the system never deleted it (although this seems odd to me). You should be able to run regedit, find this key, and delete the COM3 string item in the right hand view.
    Even though viFindRsrc is returning COM3, I do not believe that viOpen will succeed - it should return an error for that port since you say it does not really exist. In fact, MAX should show some kind of exclamation point or X through the icon. Does it do this?
    Regardless of the MAX behavior, this should not affect your LabVIEW program in any way. I have no idea what is causing your crash but it is probably not related to this phanto
    m COM3. If you think the crash is in VISA, I suggest you use NI Spy and enable Log to File with Fail Safe Logging selected. Then after the crash you can load the .spy file and see if any VISA call did not return.
    Dan Mondrik
    Senior Software Engineer, NI-VISA
    National Instruments

  • Best way to acquire data from both serial port and D/A board in real time?

    In my experiment, I have 2 kinds of data: analog and digital. Now, I have to write a programme to acquire both data not only in real time but also in sychronicity. My colleague tried to write a program for this purpose. However, the digital part was failed. For example, the data length found from "data buffer" is correct in the first 10 seconds; however, the format became wrong later.
    Is it one program involved two different data acquisition methods? 

    Hi,
    You need to figure out when the serial port sample occured by some technique and then obtain the equivalent sample from the aquisition board, probably from a circular buffer. If you know the sample rate (pretty implicit really) you can 'cherry pick' the appropriate measurement from the buffer to be synchronus with the serial port measurement.

  • Unable to connect to SRW224P via web base and serial port on the front until reboot switch

    Just installed new SRW224P switch 4 days ago and we lose connectivy to the SRW224P manage switch. Try to Web in to device and also direct serial port unable to get connected, reboot and it works for a little bit but then we loose connectivity again. Also the computers connected to the switch loose their IP address and sometimes unable to get a DHCP address assigned back from are server.
    Any suggestions?
    (Edited for guideline compliance.Thanks!)Message Edited by JOHNDOE_06 on 05-14-2007 09:20 AM

    I ended up doing a replacement with linksys, the new one has been in place for 2 weeks and it seems to be running ok.

  • How to retrieve data from the serial port and decode it each 2 bytes is a long variable and 1 frame is about 6 bytes

    I send the frame by a microcontroller ( 8bits) the fram contains 6 bytes, 2bytes conform a long variable, I want to decode the frame and make operations with these long variables and then plot them

    Hey jpvans,
    I would first suggest using NI-VISA to talk to the serial port. Then, you can use the LabVIEW Type Cast or the Flatten to String and UnFlatten From String VIs to convert the data.
    You can setup the read so that it reads just two characters at a time to form an individual long or you can set the read up to read it all and then use the string functions like String Subset to cut the information into chunks.
    I hope this helps out.
    JoshuaP

  • Is it possible to choose the serial port if only the run time engine is installed

    I have an application, which communicates over the serial port. When I use the full version of Labview I can change the serial port without any problem from Com1 to Com2 (similar to the example “Hardeware input output -> serial -> Labview serial vi"). When I build an application and try to run this program on a computer where only the run time engine 6.1 is installed, it is not possible to choose the serial port. Since there is no “Measurement and Automation Explorer” available on the run time engine and no directory C:\VXIpnp is created, when the run time engine is installed, I do not see a way, how I can satisfy the computer with the information it needs for configuring
    the different ports. Any suggestions?

    Hi Daniel,
    Before LV6.1 there was LV5.1 In LV5.1 the way to Spedify a resource was to use a string control with correct VIsa Resource Class identifier. For eg. "GPIB0::11" or "ASRL1::INSTR". With Introduction of VISA Resource Name Control and linking with MAX, These names are Available from Pull Down List and Can be Aliased, meaning ASRL1 which is Serial Port 1 can be called COM1 and so on. However the old method still works with all 6.1 Controls. Only thing is you have to make sure you Dont Conflict the Class Names ie Use "GPIB::.." instead of "ASRL..." when addressing Serial Port VI's.
    To solve your Problem I would Build a Menu ring with COM1 to COM4 in the Pull Down List.
    Next, If I use the Traditonal Serial Port VI wich accepts the Integer as Seria
    l Port #. I just Wire the Menu Ring to this VI.(Remember COM1 is 0, COM2 is 1 for this VI)
    If I use VISA Config Serial Post. I build an Array Constant with Corresponding VISA Class Names So in our case a String Array Constant of 4 elements "ASRL1::INST" to "ASRL4::INST". I Use Index Array Function With the Index Wired to my Menu Ring. The Array Input Terminal Wired to the Array Constant. The Output of this Array will be correct Visa Class Name Based on slection of my Menu Ring. I can Wire this as Input to my VISA Config Serial Port Vi.
    I have attached a Small VI to Illustrate this.
    Drawback: You must Predefine what Ports you will Want to Use. Basically you define all the cases.
    I hope this Answers your Q!
    Good Luck
    Mache
    Good Luck!
    Mache
    Attachments:
    Serial_Port_Select.vi ‏36 KB

  • How can i browse FP 2000 via serial port same use Ethernet port(RJ 45)?

    I am a new user for  labview.I develope my program with FP 2000 but I have some problem
      1 How can i browse FP 2000 via serial port same use Ethernet port(RJ 45)? if it can Tell me please.
      2 If  I use GSM/GPRS modem via FP 2000 rs 232 port (I under stand how to send AT command) and leave it stand alone
         Can I dial modem and browse file in FP 2000 same as use Ethernetport?
    Someone please help me.Thank you very much.

    Hi!
        First, I can say that your project involves many things, I cannot describe all features in the forum, and I'm not used with GPRS modems (my modems are base band serial modems...).
        Anyway, I would say that in your project you should proceed like this:
          1) Configure your FP 2000 module via MAX and ethernet connection;
          2) Download an embedded application to your module (build in LabView Real-Time)
          3) In your application, you should build a kind of serial port manager, and by the means of serial port you send/receive commands from PC.
        The commands from PC can include "Tell me the about the FP 2000 file system ", or "switch on line X", or anything you need.
       I think it would be difficult to use Internet exp, because you use IE with TCP/IP, and TCP/IP is over ethernet.
       I know that for Windows you can find some wrappers that make you "see" the serial port as an ethernet, but these wrapper do not exist under filed Point, and you shoul build one yourself!!!(and that's not easy).
        For example, to browse your files, you should build a VI that searches through your file system, and reports, via serial, the files present in a directory (it's an example....).
        About communication between GPRS modems and FP2000, I know nothing.  I suppose that these modems accept serial inputs, so you'll have to configure your serial port on FP 2000 with the correct baud rate, parity, and so on..... and you send your data to the modem.  The modem will transfer data in its way, no matter on how it does.
        To send data to your modem you shoud take a look to some Serial communication examples.  What I suggest you, first, is to connect the serial port of FP2000 to a PC, and test communication between PC and FP2000, without modems. Just direct cable connection!  If you're able to do this, insertion of modems is the next step, and should be quite easy.  If you're not able to make the PC receive strings of data from FP2000, over  RS232, adding modems is a further complication, and you won't come out of this mess!
       So, what I say, is just build, for now, a simple embedded application for FP2000, that, using RS232, sends data to a PC (you should see data sent with use of Hyper terminal).
        To build this application, use Instrument I/O --> VISA commands (VISA open, VISA write, and Property node should be enough, for now).
       Please, let me know if this helps......
        Have a nice (programming) day!
    graziano

  • Plot more than one analog value to a waveform chart by reading from Serial Port

    I have 4 LDRs and I want to plot their values to a waveform chart by reading them from the serial port. I have looked around and found an example of a VI plotting one value to a waveform chart (attached below) but I am unsure about how to expand this for 4 different waveforms, mostly because I don't particularly understand the way is being read currently. If someone could either point me in the way of a relevant example or explain/show me a solution, or explain howthe current VI I have works, that would be greatly appreciated.
    Attachments:
    LDRread.vi ‏20 KB

    Since I assume each LDR (whatever that is) has its own serial connection, you will need to read from 4 different serial ports.  From there, just form an array of all the data and write to the chart.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • T23- A real challenge- Serial Port

    Hi,  I have a interesting problem with a T23 running Windows 2000 Professional.  The Bios is updated to the latest version.  I am running a Gas Chromatograph using software called Peak Simple Controlling an SRI GC through the serial port.  All assignments are correct and I have verified data is being sent and received through the serial port via a utility.  Here is the problem:  it works great while running on the battery but communication when I plug it in.  While plugged in, the T23 and GC simply will not get along.  When I unplug and run on battery, it connects in seconds.  I have tried a different T23, changed the power supply and battery and still get the same problem.  I tried changing the IRQ and even the Com assignment.  Same problem.  I really like these old ThinkPads and want to continue using them.  Please help if you can...I have a Dell sitting on my desk and don't want to give up just yet.  Thanks!!!!
    Solved!
    Go to Solution.

    My initial thought is that you're dealing with some sort of ground loop problem.  You can try the following things to see if they help:
    - assuming that you are using a 2-prong AC adapter, reverse the AC plug
    - if that doesn't help, try using a 3-prong (i.e., grounded) AC adapter
    - if you're plugging the T23 into the same AC circuit as the GC, try an outlet on a different circuit OR if you're already on a different circuit, try using the same one as the GC
    - if you have a copy of PC Doctor for DOS for the T2x series and can construct a serial loopback plug, then you can see if that diagnostic shows any problems
    You may also want to see if there's any voltage potential between the chassis of the GC and the laptop's ground.  Put an AC voltage meter between the two.  Ground on the laptop can be any of the screw terminals of the serial or parallel ports.
    Ray Kawakami
    X22;X24;X31;X41;X41T;X60;X60s;X61s;X300;X301;Z60m;Z61t;Z61p;560Z;600E;600X;T21;T22;T23;T41;R50;A21p;A22p;A31 and A31p
    Not a Lenovo employee; just a volunteer helping out here
    All personal links to PC-Doctor software removed 8/2012 by mfg request

  • Two module I/O servers. one serial port

    is this possible? it's logical that you'd wan't to put multiple device on one serial network, in order to not have add extra ports to you controlller. I can't seem to find the answer. I ould think that the API handles sharing of the port behind the scenes, but who knows. Can I save myself some work and use the I/O server, or am I going to have to do this the old-fashioned way and use the modbus library?
    Solved!
    Go to Solution.

    As long as you are using a 485 port you should be able to communicate with multiple devices using Modbus over Serial.  It does look a bit strange because you need to have a different I/O server for each slave device but you can set them to all use the same serial port.
    Matt J
    Professional Googler and Kudo Addict
    National Instruments

  • How to detect if my external device is connected to the Serial port

    Hi,
    If I remove the cable from the serial port in my pc or either remove the serial cable from my external device, then when I send a request to open the serial port from my program, it basically does nothing, it just sits there.
    I want to be able to show some sort of message or any other way of indicating to the user that they should check the cable.
    below is the bit of code to open and set serial port params:
         public void openPort() {
              // Initialise the drivers
              System.setSecurityManager(null);
              String driverName = "com.sun.comm.Win32Driver";
              try {
                   CommDriver commdriver = (CommDriver) Class.forName(driverName)
                             .newInstance();
                   commdriver.initialize();
              } catch (Exception e2) {
                   e2.printStackTrace();
              // port will be set in Store Operations.
              String wantedPortName = Configuration
                        .getParameter(ConfigSetting.EFT_COM_PORT);
              //System.out.println("wantedPortname : " + wantedPortName);
              Enumeration portIdentifiers = CommPortIdentifier.getPortIdentifiers();
              CommPortIdentifier portId = null; // will be set if port found
              while (portIdentifiers.hasMoreElements()) {
                   System.out.println("counter");
                   CommPortIdentifier pid = (CommPortIdentifier) portIdentifiers
                             .nextElement();
                   System.out.println(pid.getName());
                   if (pid.getPortType() == CommPortIdentifier.PORT_SERIAL
                             && pid.getName().equals(wantedPortName)) {
                        portId = pid;
                        System.out.println("found a macth");
                        break;
              } // end of while
              if (portId == null) {
                   System.err.println("Could not find serial port " + wantedPortName);
                   //System.exit(1);
              try {
                   port = (SerialPort) portId.open("EFTDriver", // Name of the
                                                                               // application
                                                                               // asking for the
                                                                               // port
                             10000 // Wait max. 10 sec. to acquire port
              } catch (PortInUseException e) {
                   e.printStackTrace();
                   System.err.println("Port already in use: " + e);
                   //System.exit(1);
              // Now we are granted exclusive access to the particular serial
              // port. We can configure it and obtain input and output streams.
              try {
                        port.setSerialPortParams(9600, SerialPort.DATABITS_8,
                             SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
              } catch (UnsupportedCommOperationException usc) {
                   System.err.println("Unsupported operation" + usc);
              }Please advise what method can I use for this purpose.
    Thanks
    Abhi

    You mean it hangs in the open() method despite the timeout?

  • Write string to serial port ?

    Hello! Thanks all, who help me build up this attached VI !!!
    Small problem.
    In a few words: I received date from serial port, my VI work with it, and I want pass string “sting I need write to port” to serial port. (see attached VI).
    Data all time read from port and write to port.
    I know, how work serial VISA, but I don’t know, how connect wire.
    And second question: how insert subVI in VI from .llb?
    Thanks!
    Mikhail.
    Attachments:
    string_to_serial_port.vi ‏170 KB

    Hi  Dai!
    Thanks for answer.
    I did as you said, but something  I did wrong.
    Please, look at my VI. What is wrong?
    Mikhail.
    Attachments:
    string_to_serial_port.vi ‏171 KB

  • "how to read serial port using labview 6.0"

    sir i am doing a project and is in a need to extract data from serial port. can anyone help me

    This link, and the links from it, are a great place to start:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/8DECBF3E0B714BF3862568F9006E7851?opendocument
    2006 Ultimate LabVIEW G-eek.

Maybe you are looking for