VISA and Scan string for tokens

Hi there,
I am currently developing a piece of software which needs to take in data from an Arduino board via the serial port and parse the input accordingly.
I have the 2 pieces of code working perfectly well separately, but I can not seem to figure out why they are not functioning properly together.
Just now, the input is being retrieved fine and passed into the Scan string for tokens method, but it is not being split on the tokens, it is just outputting the string as a whole.
The input is in the form of 1:0 2:0 3:1 etc. so I am trying to split it on any spaces found.  If I attach a string to the Scan strings for tokens it works fine, just not when I am attaching the data from the serial port to it.
Any help would be appreciated.
Attachments:
input manipulation.vi ‏16 KB

Hi,
In the output which you are getting from the serial port, is there space between 1:0 and 2:0 and 3:1? If there is no space between them, then it wont be able to scan for tokens and will output the whole string. I don't have the hardware here and so don't know what exactly is the output which you are receiving. Try to see in the read buffer indicator whether the tokens are seperated by a space or not.
I have attached your vi after adding a small part in it. If the problem is with the spacing then this will work fine for 1:0 2:0 3:1.
Regards,
Nitzz
(Give kudos to good Answers , Mark it as a Solution if your problem is Solved) 
Attachments:
input manipulation.vi ‏18 KB

Similar Messages

  • Is Scan String for Tokens documented correctly?

    I attempted to parse the following string using " as the only delimiter (no operators):
    this "is a test" for "you and me"
    The first call produced: "this " w/o the quotes.
    I expected "is a test" w/o the quotes.
    The documentation says the function will return tokens "surrounded by" delimiters. If this is not a bug, I think the documentation should be improved.
    W. Brown

    Thank you for commenting on the Scan String for Tokens documentation. We will look into this issue and try to make the documentation more clear about how this function works.
    We're constantly striving to improve the documentation, so any specific suggestions you have are welcome. In the future, please send any comments on National Instruments documentation to [email protected] so we can address your concerns in a timely matter.
    Kelly Holmes
    LabVIEW Documentation Team
    Kelly H
    LabVIEW Documentation
    National Instruments

  • Scan string for tokens

    Can anyone help me out on how to detect a new line using the scan string for tokens function? I am using the "\n" delimiter but it is not working
     

    Syntyche wrote:
    I opened a text file and display it on string indicator. The following is an example of my text file
    START
    SETMASS 5
    WAIT 5s
    SETVELOCITY 10
    WAIT 3s
    END
    So what I want to do is to obtain the string line by line.
    I am thinking I can use scan string for tokens with delimeter \n.
    So if i put this in while loop, in the first iteration, I would want the ouput to be START
    Second iteration: SETMASS 5
    Third iteration WAIT 5s. and etc....
    In C programming i believe this can be done by using strtok. So i want to have a similar function.
    See James' post above, which is what I was hinting at when I said it could be less complicated.  And that's why I asked WHAT you were trying to do, instead of HOW.  In this latest post, you show WHAT you wanted to do, and doing that in the first place would have made the thread a lot shorter. 

  • "Scan String For Tokens" weird behaviour

    I am trying to carry out the simple task of getting a string with
    comma delimiters and produce a string_array with the values in between
    the commas; this would simplify calling the different parts of the
    string.
    Example:
    INPUT: this,is,an,example
    OUTPUT: this|is|an|example (this would be an array of strings)
    Using a while loop with the two VI "Scan String For Tokens" and
    "Insert to array" should be enough to carry this task. I started
    using a FOR loop as the number of tokens I´ll be using is fixed.
    However I wanted to make the subVI more general by allowing any
    #tokens in the input string and using the token index with a WHILE
    loop to do this. The "token index" output from the "Scan String For
    Tokens" is said to be use
    d in a while loop to process the whole
    string.
    However,I´m getting -1 as an output even if I´ve got more tokens left
    and the while loop therefore exits.
    What am I doing wrong?
    Should I use -2 as the comparison to decide whether I´m at hte end or
    not of the string?
    Cheers and TIA

    Check the offset for -1, not the token index. (See attached image). If course if this is a multiline string, the you also need /n etc as delimiter.
    If the string ends in a delimiter, you need to clip the last array element. I usually use "reshape array" with the output from [n] as input.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ScanForTokens.gif ‏17 KB

  • What are the username, password and connect string for Designer 6.1.1?

    So that we may better diagnose DOWNLOAD problems, please provide the following information.
    - Server name
    - Filename
    Oracle designer6.1.1
    - Date/Time
    - Browser + Version
    IE 6.0
    - O/S + Version
    Win 98
    - Error Msg
    ORA-12154:TNS:could not resolve service name.
    RME-00220:Fail to connect to repository
    These error messages were shown after I entered system, manager and internal, respectively.

    Hi YungJen Chen,
    There is no general username, password and connect string for
    Designer 6i Release 4.1.1.
    First, you install the client tools using the Installer. See also the
    Designer Installation Guide, Chapter 1, 'Client Side installation'.
    Second, you install the repository into an existing database, using
    the Designer Installation Guide, Chapter 2, 'Server-side installation,
    migration and upgrade'.
    The Installation Guide provides step by step instructions on what
    users you need to create for various purposes. Any database users
    you may need to use such as System or Sys will use the password
    given when you installed the database, or whatever passowrd you
    changed it to since.
    The Installation Guide is available as part of the download, or from
    your Windows Start Menu once the Designer client tools are installed
    or from the Designer Documentation page here on OTN.
    Hope this helps. Regards,
    Dominic Battiston
    Designer/JDeveloper Product Management

  • What are the username, password, and connect string for Designer6i R4.1.1

    As the title, I tried system, manager and internal.
    But it did not work out.
    Thank you for your help.

    Hi YungJen Chen,
    There is no general username, password and connect string for
    Designer 6i Release 4.1.1.
    First, you install the client tools using the Installer. See also the
    Designer Installation Guide, Chapter 1, 'Client Side installation'.
    Second, you install the repository into an existing database, using
    the Designer Installation Guide, Chapter 2, 'Server-side installation,
    migration and upgrade'.
    The Installation Guide provides step by step instructions on what
    users you need to create for various purposes. Any database users
    you may need to use such as System or Sys will use the password
    given when you installed the database, or whatever passowrd you
    changed it to since.
    The Installation Guide is available as part of the download, or from
    your Windows Start Menu once the Designer client tools are installed
    or from the Designer Documentation page here on OTN.
    Hope this helps. Regards,
    Dominic Battiston
    Designer/JDeveloper Product Management

  • How to reduce logical count and scan count for a select query

    hi,
    I have two tables one is master and other is history. i need to combine this two tables into one temporary table.
    I am using the below query to create temp table.
    Select * into temporders
    from
    (select * from orders
    union
    select * from ordershistory) b
    where updateon= (select max(updateon)from (select updateon,name,units,subunits from orders
    union
    select updateon,name,units,subunits from ordershistory) a
    where updateon <='11/08/2008 11:18 AM' and a.name=b.name and a.units=b.units and a.subunits=b.subunits group by name,units,subunits)
    order by report,subunitsorder
    the statistics for this query:
    SQL Server parse and compile time:
    CPU time = 47 ms, elapsed time = 62 ms.
    Table 'Worktable'. Scan count 556, logical reads 1569, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    Table 'ORDERSHISTORY'. Scan count 116, logical reads 339, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    Table 'ORDERS'. Scan count 116, logical reads 285, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    SQL Server Execution Times:
    CPU time = 32 ms, elapsed time = 63 ms.
    (115 row(s) affected)
    you see logical reads and scan count for worktable(temporary) is quite high.
    So anyone can give a solution for reduce the scan count and logical reads.
    NOTE: name,units, subunits,updateon columns have primarykey

    SQL ServerAm i reading it properly? :(
    This is Oracle Forum And not the SQL Server.
    Regards.
    Satyaki De.

  • Scan string for "returns"

    Hi,
    I have a multi lined string and want to put it as list into a listbox (i
    did it with a for loop and the "i"attached to the line index of the
    "pick line" vi) but now a have let my for loop know how many rounds it
    must do! How can scan a multi lined strings for "number of lines"?
    Regards Thijs

    Thijs,
    Use the "Spreadsheet String to Array" function (in string functions). Wire
    it as follows:
    format string: string constant containing "%s"
    spreadsheet string: your string
    array type: (empty) array string constant
    delimiter: string constant containing enter ("\n" with string in code
    display mode)
    The output "spreadsheet" is an array with strings that can be wired to the
    attribute node of the listbox.
    Important notice: \n is not the same as \r ! If your string comes from a
    ..txt file, this can cause unexpected results!
    Regards,
    Wiebe Walstra.
    AIR technical Automation.
    By the way, Thijs. If your in the Nederlands, maybe you'd like to visit our
    annual LabVIEW meeting, PierVIEW. This also applies to the rest of the
    group. Check out www.air.nl, and follo
    w PierVIEW 2001.
    AIR technical Automation
    www.air.nl
    "Thijs Boeree" wrote in message
    news:[email protected]..
    Hi,
    I have a multi lined string and want to put it as list into a listbox (i
    did it with a for loop and the "i"attached to the line index of the
    "pick line" vi) but now a have let my for loop know how many rounds it
    must do! How can scan a multi lined strings for "number of lines"?
    Regards Thijs

  • Paper Jam and Scanning issues for the HP Officejet 6600

    Had to warranty my printer for same issue and refurbished one is worse.

    Hi @Uguessedit,
    Welcome to the HP Forums!
    I am sorry to hear that your HP Officejet 6600 refurbished printer is worse than your previous printer, but I am happy to help!
    For further assistance, I will need some additional information:
    If you are using a Windows or Mac Operating System, and the version number. To find the exact version, visit this link. Whatsmyos.
    If the printer is connected, Wireless, or USB.
    If the printer is able to make copies. Copying a Multipage Original in Order (Collating).
    If the power cable is plugged into a surge protector, or directly to the wall outlet. Issues when Connected to an Uninterruptible Power Supply/Power Strip/Surge Protector. This applies to Inkjet printers as well.
    What type of scanning issues are you having? Are you getting any errors?
    In the meantime, please see this guide, A 'Paper Jam' Error Displays on the HP Officejet 6600 e-All-in-One and 6700 Premium e-All-in-One Pri....
    Thank you for posting, and have a good day!  
    RnRMusicMan
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to say “Thanks” for helping!

  • Scan string for computer user name

    Good morning NI Forums,
    I need direction on a file path scan. I'm trying to get to the user name on any system, primarily XP or 7. I'd like to compare the user name from the "Get System Directory" VI with a constant user name.This way I can pass that to a case structure and close LabVIEW if the computer is logged into the wrong user (there are network read/write permissions which is why I need to control where the program isrun from). Any suggestions for the format string constant or maybe a better mouse trap?
    I've attached my VI for reference.
    Thanks!
    Tyler C. | Certified LabVIEW Associate Developer
    Solved!
    Go to Solution.
    Attachments:
    Check Computer Name.vi ‏12 KB

    I don't have LV2011.
    Have you seen this Knowledgebase article?
    Programmatically Retrieving a Windows User Name in LabVIEW
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Scanning string for uppercase letters

    Hey guys just a simple question that i'm stuck on. im working on a program and i need to scan a string to see if it has uppercase letters. the only thing i know about that even seems helpful is isUppercase but im not sure how i'd use it. i'm basically generating a sentence form categories which are in uppercase and need to expand the sentence as long as there are categories left. id appreciate any help! Thanks!

         String  ts = "i Have a capital";
         boolean hc = false;
         for (int i=0; i < ts.length(); i++)
              if (Character.isUpperCase(ts.charAt(i)))
                   hc = true;
                   break;
         System.out.println(""+hc);

  • Link to Windows 8.1 Printer (Fax, Copy and Scan) Drivers for OfficeJet 4500 G510n-z

    Hello:
    Need to know where I can find updated drivers for my OfficeJet 4500 G510n-z printer.   I am using Windows 8.1 operating system.
    I have tried using the link at HP, but at the point that it supposedly gets to the install window, it asks me to insert the disc that came with the printer.  When I do that, I still get an error message saying something like "the link cannot be found."  I also get another message at some pont indicating that the full version needs to be uploaded.  Then, the same process starts all over again.   I should add that the printer disc says that it is compatible with XP, Windows 7 and other earlier versions, but not 8 or 8.1
    I have tried this 6 or 7 times with the same result.  Dell (the company from which I bought the laptop) was useless and suggested I contact HP. 
    I can no longer scan, either, because the computer isn't recognzing that the printer has a scan function, so when I go to use PaperPort 12 to scan stuff, it doesn't recognize that a printer is attached.
    Any help resolving these problems would be greatly appreciated.
    Thanks!
    This question was solved.
    View Solution.

    Oops!  Thanks "Shlomil" not "Shlomi" - Sorry!

  • Driver and connection string for DB2 7.1 IBM Z/OS Mainframe

    Hi ALL,
                Could someone please provide me the connection string and driver for DB2 7.1 IBM Z/OS Mainframe?
    Regards,
    XIer

    Hello,
    With SAP and DB2 V7 still ICLI which is part of the operating system is used for DB connectivity. For details on the setup see related docs for SAP releases up to 6.20 .
    As of Netweaver 2004 DB2 V8 and DB2 Connect is used.
    If you're talking about Java you need a license either from IBM or if you're OEM customer for DB2 on z/OS it is delivered automatically.
    Regards,
    Thomas

  • Diffrence in snmp RO and RW string for discovery in Cisci LMS?

    i am using cisco LMS 2.6. Is it possible to discover devices through SNMP RW string?
    as LMS is not doing so. is is deffendable for me to have two strings RO and RW for discovery
    of the devices ?

    Hi Pradeep,
    RW is generally used, where you want to set certain variables on route remotely.
    for example, if you want to reload router/switch remotely, or say you want to logout telent user remotely or say clear the interface stats, etc.
    RO will only read the value.
    As per your setting RW should work. If it is not working, then there must be some configuration issue. Either on LMS or router.
    To start with compare the community string what  you have configured on router and what you are using on LMS.
    HTH,
    Smitesh

  • Scan String Token Problem with leading Tokens

    Hi, I'm using the scan string for token to read in a string of tokens that contain a leading "*" char in front of each string and terminates when the token index = -2. This works great if I have say *12345*1234 and so forth, but if there is bad data, say 1234 without the leading "*" in front, the token index return value is still -1 and it returns data which I read in thinking it found the "*". Maybe I shouldn't use the string for token function since it's probably just designed for ending tokens and not data with leading tokens. Is there a way to make this work properly or should I use another method to search for leading tokens in a string?
    Thanks.
    Solved!
    Go to Solution.

    Here.  Try this one.  It does the same thing and uses exposed functions.
    The string functions look for something to mark the end of a string.  All languages that I know of do this.  So, like I said, remove the first element.  I recommend the Subarray function with the index set to 1 and length unwired.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Parse Message.png ‏10 KB

Maybe you are looking for

  • Why wont igoogle work in firefox but works fine in explorer?

    none of the features I choose in igoogle will show up when I use firefox as my browser.

  • How to view develop adjustment photos on LR3.2

    I noticed after adding adjustment on library view, it stamps a small icon on the right lower corner which is very helpul.  I have many photos and when I want to separately view the only adjusted photos, how do I do this? I am sure it is simple but be

  • Pulling in other data to DBI

    Is it possible to pull in data and caculate variables on that data using DBI? For example, can I make a copy of the seeded On-hand Inventory Detail query in the Supply Chain MFG resp, add a column to it showing open sales order quantities? And then c

  • Can i see logfile for oracle-xe on RHEL4  ( redhat OS ) ?

    Can i see logfile for oracle-xe on RHEL4 ( redhat OS ) ? Where the logfile store ? i want to see if i got problem like :can't connect oracle-xe :can't access htmldb :can't run complete and others. Thank you very much pratchaya

  • Flash Player 9 won't install on my Dual 1.42 G4 PowerPC

    I have what seems to be an unusual problem. When I try to upgrade my Flash Player to 9, I have a choice of two downloads, one for Intel-based macs and one for PowerPC-based macs. I choose the download for PowerPC. It downloads to my desktop. I double