VISA READ STRING and GRAPH

I have some basic questions:
1. I have Serial communication from PXI to device. When I read the string of 26characters, continously, on Hypertermianl. It is fast enough. But when I read in the VI program, simple VISA read.
The reading is very slow. The VISA read one character at a time and take time to make a string of 26characters. Visa read is very slow, Why?
The baud rate is 1152K and rate is 32 updates per second, which is super fast in hyperterminal but very slow in Labview VI.
2. Second I  need the extract the some data from my string at different positions on a string of 26 characters. I already made the subVI for reading it but since the VISA read is slow to read it gives wrong values from the string.
So I thought I can make an array and ask the subvi to read the the second (i.e n-1 value) 26 characters which are ready rather than first one which is being formed. But there is no arrays for string.How can I do that? also my concern is if I read n-1 value, it is not real time value.
:8 -0582                                n value Visa read slowly
:000000 -0076U 0008 -0582   n-1 value
:000000 -0074U 0008 -0582  n-2 value
:000000 -0075U 0008 -0582  n-3 value
3. I will extract the 74, 76, 77 etc say the value as AA. I want to plot the graph of value AA versus Seconds? How can generate Seconds on my X-axis?
Attachments:
TSS1-porem-final4.vi ‏16 KB

Thank you for suggestion!
Now I am receiving data continuosly.
1. As mentioned previously, I wish to plot the heave value on real time basis, I saw the shipping example, modified my VI.
The plot is not correct, as the heave value increases and decreases linearly but there is strange graph.
2. Also I have one more question, actually if I want to find out the heave value, device once moved up 10cm and brought back to 0 level again. Its not instant as the design of the device says it takes 2 secs to get back to the zero state again. The heave is read from 10, 9, 8,7 6, 5, etc. It takes 10 steps to come back to normal value, zero value.
I just need to plot the 0 and 10cm or may be  next might be -5cm, I need to capture the final data. How can i do that?
Attachments:
TSS1-porem-final4-1.vi ‏16 KB
MRU-TEST3-1.vi ‏20 KB

Similar Messages

  • Difference between VISA READ buffer and string

    Hello I am just starting to use the VISA read and write function in labVIEW
    anybody knows what are the differene between VISA Read buffer and string? and comparison of VISA Write buffer and string
    thanks 
    Solved!
    Go to Solution.

    Hi Ein,
    "read buffer" is the label of the string given by VISARead, "write buffer" is the label of the string expected by VISAWrite!
    So there is no difference...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • VISA Read Timeout and VISA Write not working

    I'm writing a program that sets a triangle wave pattern voltage (using Triangle Wave VI) to a DC power source (GWInstek PST-3202) through a RS-232 connection.  I know my instrument parameters are set up correctly because I've been able to control this power source using a different VI with the same parameters.  I also know I am connected to the power source because I can talk to it using MAX.  I have a string indicator before my VISA Write statement that shows me the command being sent to VISA Write.  It shows the correct syntax for setting a voltage on this instrument.  However, when I run the VI, the voltage is not changed on my instrument, even though the correct command is sent to the instrument.  After the VISA Write operation I have inserted a VISA Read function in order to read the newly set voltage from both a numeric and a waveform indicator.  Using the Error Out cluster I am able to see that there is a timeout error from VISA Read.  I thought perhaps I needed to clear or flush the buffer after each Read statement, but that didn't work either.  I'm stumped as to why VISA Write isn't writing to the device.  I have included my VI below, as well as the initialization subVI for the power supply.  
    Attachments:
    Triangle Volt Mod.vi ‏27 KB
    GW Instek initialization.vi ‏18 KB

    Yep, you need to append the End of Line character to the end of your command.  And for your read to work properly, you need to request the data.  That requires a querry command to be sent.  Look closely at the differences in command and communication structures between your working VI and your mod.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Reading strings and integers from a text file

    I want to read the contents of a text file and print them to screen, but am having problems reading integers. The file contains employee's personal info and basically looks like this:
    Warren Laing
    32 //age, data type is int
    M //gender, data type is String
    Sharon Smith
    44
    F
    Here's what I've done so far. The method should continue reading the file until there's no lines left. When I call it from main, I get a numberFormatException error. I'm not sure why because the data types of the set and get methods are correct, the right packages have been imported, and I'm sure I've used Integer.parseInt() correctly (if not, pls let me know). Can anyone suggest why I'm getting errors, or where my code is going wrong?
    many thanks
    Chris
    public void readFile() throws IOException{
    BufferedReader read = new BufferedReader(new FileReader("personal.txt"));
    int age = 0;
    String input = "";
    input = read.readLine();
    while (input != null){
    setName(input);
    age = Integer.parseInt(input);
    setAge(age);
    input = read.readLine();
    setGender(input);
    System.out.println("Name: " + getName() + " Age: " + getAge() + " Gender: " + getGender());
    read.close();

    To answer your question - I'm teaching myself java and I haven't covered enumeration classes yet.
    With the setGender("Q") scenario, the data in the text file has already been validated by other methods before being written to the file. Anyway I worked out my problems were caused by "input = read.readLine()" being in the wrong places. The code below works fine though I've left out the set and get methods for the time being.
    Chris
    public static void readFile()throws IOException{
    String name = "";
    String gender = "";
    int age = 0;
    BufferedReader read = new BufferedReader(new FileReader("myfile.txt"));
    String input = read.readLine();
    while(input != null){
    name = input;
    input = read.readLine();
    gender = input;
    input = read.readLine();
    age = Integer.parseInt(input);
    input = read.readLine();
    System.out.println("Name: " + name + " Gender: " + gender + " Age: " + age);
    read.close();

  • How to read a C structure with string and int with a java server using sock

    I ve made a C agent returning some information and I want to get them with my java server. I ve settled communication with connected socket but I m only able to read strings.
    I want to know how can I read strings and int with the same stream because they are sent at the same time:
    C pgm sent structure :
    char* chaine1;
    char* chaine2;
    int nb1;
    int nb2;
    I want to read this with my java stream I know readline methode to get the first two string but after two readline how should I do to get the two int values ?
    Any idea would be a good help...
    thanks.
    Nicolas (France)

    Does the server sent the ints in little endian or big endian format?
    The class java.io.DataInputStream (with the method readInt()) can be used to read ints as binary from the stream - see if you can use it.

  • Visa read object difference parity setting for PC and TPC2012 device

    Hello,
     we found some difference between application running in PC and runing in TPC2012 device.
    We tested modbus communication via RS485 (9600b/s, 8bits, parity even) between PLC(master) and TPC2012 (slave). We used Visa read object and set parity to Even via property node. From the PLC we sent request to device and in our application we only read the data from PLC and displayed it (8bytes) on sreen.
    If we tested the application on PC everything worked fine. But if we compiled application and ran it in TPC2012 device  the data was different (for example if I sent request from PLC to slave 05 03 00 01 00 01 crc crc on the TCP I saw 00 03 00 01 00 01 crc crc. The  crc on TPC wasn't equal to crc on PLC.
    We found that problem was in VISA read setiing for read data in TPC device. If we set parity to SPACE (instead of EVEN)  then we read data correctly.
    Modbus - Parity set for VISA read object:
    Master PLC (even) - PC (even) -> visa read - data are equal
    Master PLC (even) - TPC (even) -> visa read - data aren't equal
    Master PLC (even) - TPC (space)-> visa read - data are equal 
    PC: Win XP SP2, LabView 8.5 with LabView TP module 8.5.
    TPC2012: WinCE 5.0, NI visa 4.2, NI TPC Service 1.0.
    Best regards,
    Pavel Rucka.

    I just found out that the VI for the currentmeasurement with the keithley 6517a has the same error but still works fine. Now I also tried to adjust the serial data bit and parity settings via the VISA configure serial port function but still no improvements.

  • Xbee data extracting and graphing

    Hi,
    I have been trying for a few days to get this to work with no results. I have searched through google and some of the forums for help with nothing that really helped.
    I am using two xbee devices to transfer data to labview to graph.Eventually I would like to use the ADC on the Xbee to take an analog signal and convert it to a digital signal for labview to read and so I can do my analysis on it. I started with getting a basic Visa program to work and send number from my arduino uno over and over again and placing those values into an array This works great with no problems. The problem comes when I try and send a signal through the Xbee. 
    I tried to send an analog signal out to the adc and I was getting some values in labview in Hex but I was unsure what they really meant. My second attemp was just to try and create a pulse wave using my arduino and send that to labview and have labview try and graph the incoming signal. This however did not work and I am not getting any data. I connected both Xbees up on a bread board without labview to see if I can get the a signal out of the recieving xbee and it worked. So the problem should not be with my xbee's but with my code. 
    The code is where I am not sure about. I was able to find examples of how to use the visa and was given a basic example of it. I have then tried to manipulate the program to see if ti would work for me. I am trying to take the signal from the VISA Read funciton and convert it to a 1d array to display on a graph. I have also tried to seperate the dat into an array char by char from the string. However, none of this worked. I am getting a zero value out for my graph and no values into my array. I am also getting no value into my READ String area. 
    The values I have sometimes gotten look like:
    00\00\00\00\00\94\00\00\ and so on with different value. Some time the byte read is very large up to 475 when I am placing the pulse wave in or so and sometimes smaller at 19 when I tried to connect the ADC.
    I have attached some of my VI's to see if anyone can come up with a better way or point me in a better direction.
    The png is a pic of the results I got from the pulse input. So it looks like I am not getting any data at all. 
    Thanks for the help
    Juan
    Attachments:
    Basic VISA_Test_1.vi ‏26 KB
    Result_OfpulseWave.png ‏129 KB

    Hello jrod03,
    I would suggest using the NI LabVIEW Interface for Arduino Toolkit found here (http://sine.ni.com/nips/cds/view/p/lang/en/nid/209​835) and posting your Arduino related questions in our LabVIEW Interface for Arduino community (https://decibel.ni.com/content/groups/labview-inte​rface-for-arduino).
    This document will also probably be helpful to you (http://digital.ni.com/public.nsf/allkb/8C077471896​06D148625789C005C2DD6).
    Jonathan L.
    Applications Engineer
    National Instruments

  • How to use multiple visa read in one program

    hi
    i am working at Hameg HM8143 power supply i want to measure voltage and current simultaneiously and use the measured values for further calculations. for this i used two visa read blocks.
    >>>>>>the measured values are shown in the same visa read string however i want it to be shown sepetately,
    >>>>>>One of the VISA read block gives error. so i want to know how to use VISA read to get current and voltage simultaneously in seperate strings
    >>>>>>than how to convert strings to numbers  for using them for my calcultions.
    i am attaching screen shot as well
    Attachments:
    screenshot.JPG ‏164 KB

    you can not use a single serial to send 2 commands simultaniously?
    There is a single serial line so one command has to be before another.  This doesnt mena that you can not read from 2 seperate threads but will have to ensure that there is a locking mechanism to make sure that your queries are atomic.  In labview encapsulating all communications can be done with an action engine which will allow for concurrent execution with automatic blocking of your resource (serial device).
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • VISA Read function Read buffer problem in serial communication

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

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

  • Visa Read Overrun Problem

    Dear all,
    I am using VISA Read Function to read data coming from my Hardware.
    The data is coming really fast. The H/W is sending 1600 bytes after every 10ms.
    I am using Event Structure(timeout event) to check whether 1600 bytes are at port or not. Timeout is set to 1ms. i even tried with 0ms.
    Baud Rate = 3000000.
    but the program is giving Buffer Overrun problem when i am trying to read data using VISA Read.
    I have set the buffer size to 64000 but with no success. The problem still seems to persist.
    i have played around with Receive buffer of COM Port in device manager. i tried all the values from 64 to 1600, again with no success.
    every time i run the program i get an error stating,"A character was not read from the H/W before the next char arrived" at VISA Read Function.
    and i am not doing anyother processing other than Reading data from the Port in the timeout event. 
    What could be the problem?
     Thanks,
    Ritesh 

    Ritesh,
    The over-run is still caused by the driver of the hardware.  What you are observing is that the driver is able to keep up with bursts of data coming into the port.  So for the first few thousand bytes coming in, there is no error.  However, after a while, the driver falls behind and cannot keep up (hence the over-run error).
    How does FTDI recommend that you use their ports in LV?  VISA may interact with the driver in a different way or set properties to different values.  All of this can have an impact on how the driver performs.  Also, this DLL that they provided may not return overrun errors the same way that VISA does.  The malformed string may just be missing data that was missed because of an over-run error.
    You have not mentioned anything about the types of flow control that are available to you.  The only real way to prevent over-run errors in data intensive communication is to have ways to hold-off the data (flow control).  Since the data will be interrupted for a fraction of a second, the driver will have a chance to get the data out of the hardware in time.  Communication will automatically resume once the data is read out of the hardware.
    Thanks,
    Steven T.

  • VISA Read over USB Problem: After a while the xBFFF0015 Timeout Error occurred

    Hi,
    I have trouble using labview with my non-NI USB device:
    The device is an analog input DAQ board. I was able to setup communication with the board using a VISA driver specifically created for this board and direct FW calls using the product's firmware specification provided by the manufacturer.
    This method has been working pretty good so far, but when I try to get large amount of data (64k samples @100ksps), the VISA Read returns the 'VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.' error.
    Please see the attached screenshot of the block diagram for details.
    First, an 'analog input scan start' command is sent to the DAQ device, and then the vi tries to read all collected data from the device, once the right amount of data retrieved, or no more data is available the data collecting process (the while loop) ends and an 'analog input scan stop' command is sent to the DAQ device.
    The data collection starts with no problem, but after a while, in loop# 400, the VISA Read hangs and then returns the error mentioned above.
    I tried to increase the time out value, but it didn't help, the error occurred after the same number of loops, the VISA Read got hosed and the error occurred after the longer timeout expired.
    I also tried to add some delays in the loop, but it didn't help either.
    I am not sure what do I miss here and I would highly appreciate if anyone could give me some guidance how to solve this issue.
    Thanks,
    John
    Attachments:
    usb-read.png ‏18 KB

    I just wanted to specify that this is not an NI board avoiding to make people think this is a hardware issue. And I think that the rest of the code is irrelevant in this case.
    I believe that I don't use the VISA functions correctly. I assumed that someone who used these functions before would be able to point out the obvious steps missing in the data collecting process using the VISA functions.

  • Problem with reading String from Xlsx file.

    Hi! I am trying to read string and numerical data from an xlsx file and trying to display its contents in a word file. I tried converting it to a .lvm file too. On using the "Read From Spreadsheet" tool, I get random characters as output. On using " Read From Measurement File" tool, I am getting an error saying "Error 100 occurred at Read From Measurement File->Untitled 1". What do I do? At the end I need to display the output, row by row, in a Microsoft Word file. I am so lost. Please Help.
    Solved!
    Go to Solution.

    bsvare wrote:
    labview currently does not read directly from an xlsx file. If you convert the xlsx to an xls file first, then you can use the read from spreadsheet tool to load the data from the file.
    Hey, I tried doing that. It still just gave the values 0.00 in all the cells of the indicator array. Plus my file has string in it also. The data type in the spreadsheet was "general". Here in the tool, it is "Double". I changed the tool data type to string and spreadsheet to text but I only got gibbrish for my efforts.
    Thanks anyway!

  • GPIB reads/writes compared with VISA reads/writes

    Hello all,
    Being slightly new to LV (3 months of casual use, and 1 month of really getting to know it)...
    I was just wonder what the difference between VISA reads/writes and GPIB reads/writes.
    Actually this is my main question: Is the GPIB Write "data" parameter and the VISA Write "write buffer" parameter the exact same thing?
    Would I write the exact same command with either parameter and get essentially the same effect (if all parameters are correct?).
    I have a list of GPIB commands that I want to use to write drivers for  a PSA, and I really want to use VISA, and not have to change my paradigm of thinking.
    I would hope they are quite similar.  In fact, my research is telling me that GPIB is almost like a subset of VISA?
    Thanks for your help.

    The data you write with the GPIB functions is identical to the data you write with VISA. There are some things that are a bit easier to use the traditional GPIB calls but for 99+% of the time, VISA will do the trick. VISA was originally conceived as a common api for GPIB and VXI instruments. The first VXI instruments were basically the same GPIB instruments without a power supply and the user interface (buttons, screen, etc.) but they required different drivers. VISA permitted a single driver to be used for both types of instruments. Now, VISA has expanded to include serial, Ethernet, USB, and PXI and not having to change your "paradigm of thinking" is one of the big reasons that VISA is so widely used.

  • How do I avoid Error 85 in Scan From String scanning VISA read buffer?

    I have encountered an Error 85 with my Scan From String VI. I have a timed
    loop to read data from a device (flowmeter) using a serial port. This device takes
    periodic measurements and sends the reading which contains a numerical value to the serial port COM1. It cannot be read continuously, and the period
    between measurements may vary, so I decided a timed loop would be better than a while loop.
    The VI begins with VISA Configure Serial Port and then
    goes to a VISA Write which sends the message to the device to begin
    taking measurements. After this, the device usually says "TAKE FLOWMETER READINGS" to the terminal, thereafter only sending numbers. Then begins my timed loop containing VISA Read. I
    am taking the read buffer two places.
    First, I am taking it to an Array to Spreadsheet String with the
    Format String %.3f, as was in the Write to Text File example. Then I am
    using Concatenate Strings with this string and also a string containing
    the System Time. This string goes to Write to Text File, which I have
    configured using Open/Create/Replace File outside of the loop.
    Second, I am taking the read buffer to a waveform chart. I thought
    it would be a good idea to use Scan From String to convert the string
    into a DBL which I am then sending to the waveform
    chart.
    I am not sure if the initial "TAKE READINGS" message is giving me an error. I was able to get one reading saved to my text file from the device.
    Also the format string for my Scan From String is %.3f
    I am getting the Error 85 at the Scan From String only sometimes.
    When this happens, there is no data being written to the text file. But
    other times, I get data and it writes to the text file just fine (but
    rounds to nearest whole number).
    Any help would be greatly appreciated! This serial port device has been giving me a lot of trouble.

    Is this what you mean? Did I wire the shift registers correctly?
    I didn't know if you meant to Concatenate before Scan From String or Concantenate before or after VISA Read?
    Message Edited by YeungJohn on 11-20-2008 03:48 PM
    Message Edited by YeungJohn on 11-20-2008 03:49 PM
    Attachments:
    SerialShiftVI.JPG ‏87 KB

  • VISA Read Losing Characters off the end of the output string

    Hi,
    So I am writing a VI to take an output string of data from an ardunio Uno and parsing it. I am using the Read Visa vi to grab the string from output of the device. In the end I will be connecting a device that actually gives value in this type of string  format : (#80212164,2289,2292,2296,2300,2328,2289,2297,2290,2300,2308,2292,2295,2298,2289,22,24,0*).
    So after a large number of loops, the program starts to drop the last few characters of the string that it outputs. So the string output from Visa Read will read something like (#80212164,2289,2292,2296,2300,2328,2289,2297,2290,2300,2308,2292,2295,2298,2289,22,24,). The only way to fix this problem after it has occured is to completely close labview (all the way). Once I open it again and start running the program, all is fine in the world.
    Anyone ever have this issue? I have been trying to debug this in different ways and the only weird symptom that I have other than the Visa Read function losing a few characters of the string is the fact that looking at the Bytes at Port after I Visa Read, is that it starts showing five bytes instead of zero. 
    attached is my most recent attempt at solving this issue. 
    Note:  The Ardunio outputs a string of this format every 2 seconds with the values being incrimental over a specified range.(#80212164,2289,2292,2296,2300,2328,2289,2297,2290,2300,2308,2292,2295,2298,2289,22,24,0*) 
    Solved!
    Go to Solution.
    Attachments:
    Ardunio(StringOutput).vi ‏36 KB

    So i did a long data collect and It looks like ever 43minutes and 24 seconds the system goes from cutting off the last 5 characters to not cutting off the last 4 characters.
    As I cant see how Labview would be causing that, I am going to try and dig into the Ardunio and solve that issue... hopefully when thats done I can simplfy my code like you guys pointed out.
    Thanks!
    Attachments:
    overnight_11_18.csv ‏3001 KB
    Overnight.png ‏146 KB

Maybe you are looking for

  • How do I change my default search engine in the URL bar back to Google after my ISP replaced my default search engine with their own?

    Before I changed internet service providers, I could type my search queries into the url bar and receive search results from Google. After I switched ISPs, my queries typed into the url bar are put into my new ISP's horrible search engine. How do I c

  • Axis SOAP Adapter - Setting MIME headers for attachements (Handlers?)

    Hello, I need to know if/how it is possible to set the individual MIME headers of the parts making up a multipart/related SOAP message using only standard Axis Handlers e.g. "com.sap.aii.axis.xi.XI30DynamicConfigurationHandler" (as described in the A

  • Item Level permission issue

    Hi, I have created a custom list for which I have added some users with contribute permissions(The users are not given access at site level). Each user creates  only a single item about himself. He should be restricted from accessing other list items

  • Oracle Text index

    Hi, I created an oracle text index on 10G database on a fairly large table (59 Mil recs) but when i go to Analyze it, i get the ora-29864 error message 'analyzing domain indexes marked LOADING/FAILED not supported'. The status of the index is valid.

  • Database export problem

    Hello DB2 guru's, we are performing a AIX 4.3 DB2 V7 database extract using R3LOAD. (DBEXPORT.R3S) The database size is 350GB. (with a table of 50GB, and 8x 20GB) The challange is that we only have 3 days to perform the export. This is already the 3t