How to read a seriell port with VISA correctly?

Hello
I have the following system: A Nanovoltmeter from Agilent, modell 34420A, LabVIEW 7.1 and XP as operative system on the computer. The voltmeter reads 1024 readings and store them in the internal memory. By using a command I can collect the readings via the GPIB or seriell port. I use the seriell port. Therefore I use the VISA routines in LabVIEW. I configure the seriell port, read the number of bytes at the port and finally read the data from the voltmeter. Everything works, except that I found out it doesn't collect all the readings. I tried using Waits between sending the command and reading the data. It doesn't help much. I tried then the VISA session in the NI-Measurement & Automation program. I couldn't collect all the data by just one Read command. I had to use at least two or three Read commands to collect all the data. I wonder, if I use the routine to get the number of bytes at the seriell port of the instrument shouldn't I get the whole number of readings stored in the instrument? I tried using a high fixed number, reading more data than available. I got more data but still not all 1024 readings.
Normally I use GPIB communication but I start wondering if there might be a similar problem.
Regards

Hi Maddin,
You can place your read vi into a while loop that monitors (after a brief delay) if there is still data in the serial buffer. The loop would be wired to the vi which checks for serial data. Unfortunately, I do not have LV installed on this machine, so I cannot tell you the names of the vi's to use. But I'm sure you get the picture.
- JLV-

Similar Messages

  • How to read 2 analog inputs with VISA

    Hello everyone! I want to read two analog inputs using VISA serial communication from the arduino.  I'm currently able to read one of the input but how do I read two analog inputs on labview?

    Hi lamela,
    again I have to ask: HOW does the string look like? Is it so hard to provide an exact example of your received string???
    I think the string is showing one value from the two inputs
    Are you sure or are you guessing? How can we tell what you might "think" when you aren't able to provide examples?
    You wrote you send values from the Arduino using the command "println(value1, value2)", but now you "think" you only receive ""value1" in LabVIEW?
    Get your data communications clear! (And learn to provide meaningful examples!)
    Edit after your edit:
    my code to serial print two inputs: Serial.println(Voltage, Current);
    Even if I print separately: Serial.println(Voltage);
                                                 Serial.println(Current);
    The first command is completely different then the second part! In the first you should receive two values in one line, in the 2nd one you receive one value per line: You need to adapt your string parsing to these strings!
    Again: send both values in one line. Use the LF as termchar. Separate the values by some separator char like comma. Check the received string for validity. Use some error checking in your VI.

  • How to read an internal table with more than  one (2 or 3) key field(s).

    how to read an internal table with more than  one (2 or 3) key field(s). in ecc 6.0 version

    hi ,
    check this..
    report.
    tables: marc,mard.
    data: begin of itab occurs 0,
          matnr like marc-matnr,
          werks like marc-werks,
          pstat like marc-pstat,
          end of itab.
    data: begin of itab1 occurs 0,
          matnr like mard-matnr,
          werks like mard-werks,
          lgort like mard-lgort,
          end of itab1.
    parameters:p_matnr like marc-matnr.
    select matnr
           werks
           pstat
           from marc
           into table itab
           where matnr = p_matnr.
    sort itab by matnr werks.
    select matnr
           werks
           lgort
           from mard
           into table itab1
           for all entries in itab
           where matnr = itab-matnr
           and werks = itab-werks.
    sort itab1 by matnr werks.
    loop at itab.
    read table itab1 with key matnr = itab-matnr
                              werks = itab-werks.
    endloop.
    regards,
    venkat.

  • How to read the 'Input help with fixed values' of domain .

    How to read the 'Input help with fixed values' of domain .
    The domain has a Value range i want to read those values .
    Are these values stored in any table ?
    Plz help me i need it ver badly...
    Thanks in Advance...

    Hi Chandra Shekhar,
    To read the 'Input help with fixed values' of domain , you can use the function module : HR_P_GET_FIXED_VALUE_TEXT.
    iIf you enter the domain name, you will find the fixed values entered in the domain.
    These values are stored in a table DD07L(DD zero 7 L). Here the values are stored based on domain name.
    See if it works for you.
    Award points if its helpful.
    Regards,
    Bhanu

  • How to read three parameters for exemple temperatur​e,current and voltage from the same port with visa read and separate them in a table

    Hi i want to read parameters with visa read, from three sensors related to  pic16f877a, using  module xbee ..but i want to make every one from those parameters (temperature, voltage and current) in a table ..it's the first time i use Labview so i don't know if ther is a solution for my problem so if any one have any idea please help me. thnx in advance. 

    [email protected] wrote:
    Hi i want to read parameters with visa read, from three sensors related to  pic16f877a, using  module xbee ..but i want to make every one from those parameters (temperature, voltage and current) in a table ..it's the first time i use Labview so i don't know if ther is a solution for my problem so if any one have any idea please help me. thnx in advance. 
    The short answer is: "Yes, of course."  But you are going to have to do the legwork and learn LabVIEW basics before we can offer meaningful help.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • How to read multiple arguments separated with space in one line

    How to modify the
    public static void main (String[] args){
    }so that it can read multiple arguments separated with space in a single line?
    e.g.
    java myprogram username password host
    java myprogram2 ipaddress port
    Thx.

    public static void main (String[] args){
      int index = 0;
      for(String arg : args) {
        System.out.println("args["+(index++)+" = "+arg);
    }

  • 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.

  • Sysgen : How to read the input port data type, width and rate dynamically in a masked subsystem ?

    Hello everybody,
         I am designing a general purpose block in system generator. I pass the user parameters to the block through masking it. Some user parameters can change the block configuration. The input port data type, width and rate can also affect the block configuration.
         The problem is that these values (input port data type, width and rate) are subject to change. So I should read them dynamically, then change the block configuration through programming the "Initialization Commands" field. But unfortunately there is no straight way to read the input port information.
         There are some methods in for example the "Black Box". these are:
    input_width = this_block.port('din').width;
    input_rate = this_block.port('din').rate;
    But these methods are not applicable to a masked subsystem.
    I have tried other ways also. You can find them below. None of them worked.
    Does anybody know how can I solve this problem?
    Other ways I tried:
    1)
    design_name([],[],[],'compile')                                       
    q=get_param(gcb,'PortHandles');
    get_param(q.Inport,'CompiledPortDataType')
    get_param(q.Inport,'CompiledPortWidth')
    get_param(q.Inport,'CompiledPortDimensions')
    design_name([],[],[],'term')
    2)
    ssGetInputPortDataType
    3)
    ts = Simulink.Block.getSampleTimes([gcb '/Input'])
     

    Today we rely on Simulink to perform parameterization of your designs in two ways:
    Parameterizable Subsystems and Blocks : Parameters themselves can be MATLAB expressions that need to be evaluated for which we need the MATLAB interpreter
    The very useful Rate and Type propagation or Simulink compilation that allows us to specify types & rates in one location that gets systematically propagated to all.
    To truly make the HDL Netlist that is generated from SysGen parameterizable, we would have to implement some of this capability in the HDL netlist itself by:
    Using Generics(VHDL) or Parameters(Verilog) - We would have to capture the bit width(type) propagation through levels of hierarchies and finally parameterize the IP itself based on this value
    Since IP itself does not have this capability through generics, we would have to package a separate tcl script that updates the IP parameterization appropriately in response to top level parameters(or GUI parameters)
    Interpreting MATLAB expressions and translating them into VHDL/Verilog expressions (alternatively tcl expressions of IP). In simulink, mask parameters can be passed from one level to the next. Also parameterization of a block can be composed of Matlab expressions using variables from ancestor masks & the MATLAB interpreter – so we will need to somehow capture that as well.
     

  • How To read an XML file with JDom

    I have read through some tutorials after installing JDom on how to read an existing XML file and I was confused by all of them. I simply want to open an XML file and read one of the node's content. Such as <username>john doe</username> this way I can compare values with what the user has entered as their username. I am not sure were to start and I was hoping someone could help me out.
    I know that this seems like an insecure way to store login information but after I master opening and writing XML files with JDom I am going to use AES to encrypt the XML files.

    Here is a test program for JDom and XPath use considering your XML file is named "test.xml" :import org.jdom.input.*;
    import org.jdom.xpath.*;
    public class JDomXPath {
    public static void main(String[] args) {
      SAXBuilder saxBuilder = new SAXBuilder("org.apache.xerces.parsers.SAXParser");
      try {
       org.jdom.Document jdomDocument = saxBuilder.build("test.xml");
       org.jdom.Element usernameNode = (org.jdom.Element)XPath.selectSingleNode(jdomDocument, "//username");
       System.out.print(usernameNode.getText());
      } catch (Exception e) {
       e.printStackTrace();
    }(tested with Eclipse)

  • How to read a xml file with StringReader class

    Hi,
    I need to read a XML document with StringReade class. My aplication receives an absolute path but this doesn't work:
    StringReader oStringReader =
    new StringReader(c:\java\libros.xml);
    However it works with:
    StringReader oStringReader =
    new StringReader("<?xml version="1.0" e......");
    ie, with the whole document as a String, but I need to do it as the frist way.
    Thanks

    Hi,
    I need to read a XML document with StringReade class.
    My aplication receives an absolute path but this
    doesn't work:
    StringReader oStringReader =
    new StringReader(c:\java\libros.xml);
    However it works with:
    StringReader oStringReader =
    new StringReader("<?xml version="1.0" e......");
    ie, with the whole document as a String, but I need
    to do it as the frist way.
    Thankstake a look at this link:
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/2a_echo.html

  • Problems reading the serial port with labview 5.1.

    I open the example serial.vi , I select write to serial port, run the programm, I don`t have any problem. But when I select read serial port, I get the error code 16392and hex code error x4008. I need to know what can I do? Thanks a lot

    Any time you get an error in LV you can right click on the error cluster indicator and do a "Explain Error".
    If you do this for the error code you reported, the explanation says that it was a framing error.
    In serial communications, a framing error indicates that the hardware was not able to detect a start bit, data then the stop bits that comprise a frame.
    This prompts me to suggest that you check you port setting on the serial port. You want to make sure you are setting the port for the correct;
    Number of start/stop bits,
    Baud rate
    data bits
    parity (just for good measure)
    and hardware handshaking.
    I hope this helps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to read bytes at port in TCP/IP communication

    Hiii
    I am having 1 doubt in visa we knows bytes at port by using the property node...
    but for TCP/IP how should i get  bytes at port .... i want to read how many bytes are available in that port.....
    can any 1 suggest answer...... 

    Would you please explain why you need this?
    I always use TCP Read instead of VISA Read for TCP/IP communications. If you send a package, you can first send the length of the package and then the package itself. If you read you read first 2 or 4 bytes, where the length of following package is, and than the whole package.
    It works fine.
    LabVIEW Portal

  • How to read data from ABAP with filter?

    I know the famous pass which uses RFC_READ_TABLE to get a whole table into IdM. How can I only read a part of it, e.g. The currently locked users from table USR02 having UFLAG NE 0?

    Let's have a look to ABAP (with basis release 702):
    The function RFC_READ_TABLE offers filters using the input table OPTIONS. OPTIONS is a simple text table with line length 72 which directly is copied into the WHERE clause of the SELECT.
    The result is restricted to tables having maximum record length of 512 characters. However, using the input table FIELDS you could list the FIELDNAMES which should be read from the database. This way it would be possible to read larger tables - if you only choose fields which sum up to maximum 5121 characters.
    Coding example in ABAP:
    data: ls_OPTIONS type          RFC_DB_OPT,
           lt_OPTIONS type table of RFC_DB_OPT,
           ls_FIELDS  type          RFC_DB_FLD,
           lt_FIELDS  type table of RFC_DB_FLD,
           ls_DATA    type          TAB512,
           lt_DATA    type table of TAB512.
    ls_FIELDS-FIELDNAME = 'BNAME'.
    append ls_FIELDS to lt_FIELDS.
    ls_FIELDS-FIELDNAME = 'UFLAG'.
    append ls_FIELDS to lt_FIELDS.
    ls_FIELDS-FIELDNAME = 'BCODE'.
    append ls_FIELDS to lt_FIELDS.
    ls_OPTIONS-TEXT = `BNAME LIKE 'J%'`.
    ls_OPTIONS-TEXT = `AND`.
    ls_OPTIONS-TEXT = `UFLAG NE 0`.
    append ls_OPTIONS to lt_OPTIONS.
    CALL FUNCTION 'RFC_READ_TABLE'
       DESTINATION 'NONE'
       EXPORTING
         QUERY_TABLE                = 'USR02'
    *   DELIMITER                  = ' '
    *   NO_DATA                    = ' '
    *   ROWSKIPS                   = 0
    *   ROWCOUNT                   = 0
       TABLES
         OPTIONS                    = lt_OPTIONS
         FIELDS                     = lt_FIELDS
         DATA                       = lt_DATA
       EXCEPTIONS
         TABLE_NOT_AVAILABLE        = 1
         TABLE_WITHOUT_DATA         = 2
         OPTION_NOT_VALID           = 3
         FIELD_NOT_VALID            = 4
         NOT_AUTHORIZED             = 5
         DATA_BUFFER_EXCEEDED       = 6
         system_failure             = 8 "MESSAGE l_message
         communication_failure      = 9 "MESSAGE l_message
         OTHERS                     = 7
    IF SY-SUBRC <> 0.
    * Implement suitable error handling here
    ENDIF.
    write: / 'RFC_READ_TABLE', 30 'SY-SUBRC =', sy-subrc.
    loop at lt_DATA into ls_DATA.
       write: / ls_DATA.
    endloop.
    How can we create a FromSAP pass in IdM which uses function RFC_READ_TABLE with OPTIONS and FIELDS?
    Let's have a look to alternatives:
    Function RFC_GET_TABLE_ENTRIES has the same limitation of maximum record length of 512 but does not offer data or field selections. -> Not useful for IdM
    Function GET_TABLEBLOCK_RFC is not remote enables but a local starter in ABAP for function GET_TABLEBLOCK_COMPRESSED_RFC, however, this one retrieves compressed results. -> Not useful for IdM 
    Function TABLE_ENTRIES_GET_VIA_RFC has a maximum line length of 2014 and offers data selection using input table SEL_TAB (no field selection). Limitation: This function can only process table which have character-like fields only, i.e. table USR02 is out of scope. (Function RFC_READ_TABLE does not have this limitation.)
    Coding example in ABAP:
    data: ls_SEL_TAB  type          BDSEL_STAT,
           lt_SEL_TAB  type table of BDSEL_STAT,
           ls_NAMETAB  type          BDI_MFGRP,
           lt_NAMETAB  type table of BDI_MFGRP,
           ls_TABENTRY type          BDI_ENTRY,
           lt_TABENTRY type table of BDI_ENTRY.
    ls_SEL_TAB-ZEILE = `BNAME like 'B%'`.
    append ls_SEL_TAB to lt_SEL_TAB.
    CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
       DESTINATION 'NONE'
       EXPORTING
    *   LANGU                     = SY-LANGU
    *   ONLY                      = ' '
         TABNAME                   = 'UST04'
    * IMPORTING
    *   RC                        =
       TABLES
         SEL_TAB                   = lt_SEL_TAB
         NAMETAB                   = lt_NAMETAB
         TABENTRY                  = lt_TABENTRY
       EXCEPTIONS
         INTERNAL_ERROR            = 1
         TABLE_HAS_NO_FIELDS       = 2
         TABLE_NOT_ACTIV           = 3
         NOT_AUTHORIZED            = 4
         system_failure            = 8 "MESSAGE l_message
         communication_failure     = 9 "MESSAGE l_message
         OTHERS                    = 5
    IF SY-SUBRC <> 0.
    * Implement suitable error handling here
    ENDIF.
    write: / 'TABLE_ENTRIES_GET_VIA_RFC', 30 'SY-SUBRC =', sy-subrc.
    loop at lt_TABENTRY into ls_TABENTRY.
       write: / ls_TABENTRY.
    endloop.
    Despite the limitation, how can we create a FromSAP pass in IdM which uses function TABLE_ENTRIES_GET_VIA_RFC?
    Kind regards
    Frank

  • How to control a parallel port with labview

    Hi. I'm trying to control a dc motor with a parallel port using labview. the program has to be able to vary the out put voltage of the computer (0 - 5V) through the parallel port into a circuit which will step up the voltage for the motor. Any help would be greatly appreicated. garreth

    Do you want to output and varying signal from the parallel port pins? If so you can't do it, the port pins are digital and can only be high or low, not inbetween. You can control the individual lines high or low using the In/Out Port vis in Advanced>>Port I/O. For more help on doing this search the message archives (I know I've answered a few) and NI's site, there is some good info on it out there. Try some of these for starters:
    http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/0989d3d9dafae64e8625680400679736?OpenDocument
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/f4146c66990c46388625695f00726581?OpenDocument
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/f3c4ee6ee2c23ef386
    25646b007882c8?OpenDocument
    http://www.advmeas.com/goodies/parallelport.html
    I hope this helps get you started
    Brian

  • How can I open the ports with the Airport Extreme?

    I have an Airport Extreme Base Station connected to a cable modem and I want to open the ports for the two Playstation 3's I connected to the Airport Extreme via Cat 6 ethernet cable. The first Playstation 3 will be used to play Call of Duty Modern Warfare 2 and the other Playstation 3 will be used to watch streaming movie from Netflix. Does anyone know if this can be done?

    It is documented on Page 54 of Apple's "Designing
    AirPort Networks Using AirPort Utility Mac OS X v10.5 + Windows" (direct PDF download link).
    The public port and private port would be set the same value.

Maybe you are looking for

  • HT1689 Can I transfer credit from one account to another?

    I have some money or credit in my account and I would like to transfer it to another account. Is this possible?

  • [Solved] Pacman.log no longer logging maybe systemd

    Hi, I upgraded a couple of days ago on the 11th to systemd system, I am using 86_64 awesome DE, I ran Syu yesterday and this morning I found mplayer was acting poorly so I went to check pacman.log to see what was updated. Pacman.log hadn't logged sin

  • My hp mini 110-3700 laptop say battery not present

    My hp mini 110-3700 laptop say battery not present, but i can see the battery s/n under the system info

  • For Update Query from ORACLE Forms

    Hi We are using Oracle Forms 10g running with 10g database 10.2.0.1.0. We happend to see a query which is getting generated in AWR report like Select rowid, all_columns from TableName for Update of C1 Nowait. But no such query is really written in fo

  • Tethering issue lightroom 4.4 and Nikon D800

    I'm having trouble tethering my Nikon D800 to Lightroom 4.4. Attempts at tethering mostly produce "No Camera Detected" after File > Tethered Capture in Lightroom. There have been some occasions however when the camera was detected and tethering funct