Use of Write Key VI with an array of cluster

Hi,
I wanted to use an array of clusters to define some configuration parameters for an application. Unfortunately, "Write Key VI" doesn't support the cluster type. Has anybody modified this function ("Write Key VI") to support cluster and array of cluster? If not, any clue to keep it as simple as possible?
My clusters include boolean, path, U32 and string.
Thank you,
Olivier 
Solved!
Go to Solution.

OD wrote:
Couldn't log to this website. Any alternative ?
Sure see this Nugget.
I have links for other methods included but the Nugget does exactly what you are asking to do. I wrote th Nugget to entertain other developers, but in the end is serves as an example why you may want to find another approach. You'll understand what I mean once you look at that Nugget.
Parapharisng from Jurrasic Park "Just because could do something does not mean we should."
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • How to write a header with an array of u16 to a file with byte stream

    Hello,
    I have a header file and an array of u16.
    The header file's size is fixed with 2048 bytes.
    I need to add the header file at the beginnig of the array of u16. I'm trying to use 'header','pos mode' and 'pos off'terminals in the 'write file.vi', but I don't know how to use them.
    Please give me help
    Thank you in advance

    My example was in LV 6.1 version.
    I attach here the 2 vis in LV 6 version.
    Let me know if it works,
    Alberto
    Attachments:
    write.vi ‏32 KB
    read.vi ‏37 KB

  • Using blue tooth key board with Apple TV, possible?.

    I thought I read somewhere that if you were connected via earth net cable you could use a keyboard with ATV, Any thoughts. I also want to say that Thanks Apple for the update as it appears to me to work very well Thank You.CC

    Thanks Allycat very to the point response. I am more than satisfied with APT now with the firmware upgrade as I haven't experienced any glitches yet, now I gone and done it, jinxed it for sure, CC

  • Using ini-files with write-key/read-key (double) and defined accurarcy

    Hello,
    in a popup the user can insert a numeric-double-value.
    This value is saved in a ini-file using the Write-key-vi with Type = double. Works fine.
    What do i have to do to set the values after the comma?
    So if user inserts 1,532 i want to round to two digits after comma and save it. (-> 1,53)
    Thx
    Solved!
    Go to Solution.

    I don't know how LV deals with different decimal seperators (e.g. comma instead of point), I guess it 'just works' depending on the system locale.
    A few different options are available as follows...
    The Write Key function has a 'precision' input which will set the number of decimal places to save the DBL to (in your case, set this to 2):
    If you are using a numeric field, you can set the 'increment' property with 'coerce to nearest' to prevent them from entering more precision than is available:
    The obvious method for post-rounding the input is to scale up the number, round to the nearest integer and then divide again to limit the precision:
    I couldn't see anything in the numeric/math palettes that does this.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Problem with write key VIs (config-file)

    Hi
    My problem is this: when I use the write key VIs to write to an ini-file, the values are not written/updated in the ini-file. Does
    anybody has a solution???
    thank YOU!!!
    Attachments:
    writetest.vi ‏32 KB

    astroboy wrote:
    Hi Dennis, writing key updates or add lines, but the problem is that it also causes all lines to be clumped together, making it unreadable.
    What's the better way?
    Clement
    I was complaining about the poor formatting of the .ini files myself a couple years ago in this thread. http://forums.ni.com/ni/board/message?board.id=170&message.id=273552
    I found the offending piece of code was buried pretty deep in the Config File VI hierarchy.
    One idea is to go back after the file is written and find where all the section headers are and insert your own blank lines.
    Also look at this thread http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=408776
    You may also want to add kudoes to the config file idea in the Idea board.  http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Comments-in-configuration-file-ini/idi-p/927874#A614 
    Message Edited by Ravens Fan on 09-17-2009 10:29 PM

  • Write an object that has array

    I am trying to figure out how to write a object with an array
    Player[] jim = new Player[30];
    for (int i=0;i<30;i++)
    jim= new Player("" + i);
    I am trying to figure out how to get the number of points jim scores in a month, so i need 31 days and a way to input the number of points he scored. Any help would be great

    Well, i think you don't have to create a whole bunch of arrays to enter jim's scores in 31 days. I presume you already have a separate object called Player. Why not set a List attribute on that object and manipulate the scores there. You don't need to instantiate an array for that.
    public class Player{
        private List scores = null;
        ....... //other attributes here
        public Player(){
            scores = new ArrayList();
        public void addScore(String score){
            scores.add(score);
        public List getScore(){
            return scores;
    }well, of course to get the contained items from the List, do manipulate it using arrays. And well, just parse down the returned scores to int because they are stored as strings here.
    hope that helps.

  • I can only scroll using the arrow keys. In IE/C I can use the touch pad to slide my fingers to scroll. Why cant i do this in FF?!?!

    On my laptop (and most for that matter) you can use the touch pad to slide your fingers to scroll thru a web page. I cannot do this in firefox. It is very annoying and I dont know why cant do this?
    I have reinstalled FF and it still wont scroll! Every other browser i can scroll thru a web page using the touch pad method.
    Why cant i do this on FF?

    Hello and Welcome to Apple Discussions!
    Full keyboard access is useful for people who have difficulty using a mouse. Safari supports standard full keyboard access shortcuts for buttons and menus. If you choose, you can also use the keyboard to highlight links in webpages.
    To turn on full keyboard access:
    Choose Apple menu > System Preferences and click Keyboard & Mouse.
    Click Keyboard Shortcuts.
    Select the checkbox to turn on full keyboard access.
    To highlight links in webpages using the Tab key:
    Choose Safari > Preferences and click Advanced.
    Select the option to highlight each item on the web page using the Tab key.
    With full keyboard access turned on, Safari uses the standard shortcut keys to access menus and windows, plus the additional shortcuts shown in the table.
    Hope this helps!!
    Carolyn

  • I can't scroll using the arrow keys!!

    I have been having a problem lately where I cannot scroll within applications using the up and down arrow keys. on my macbook, using the arrow keys is something i liked to do to scroll in a page instead of using the trackpad, and now it doesn't work... I've noticed it in every web browser installed on the laptop (Safari, Firefox, Camino) and also doesn't work in itunes (making it annoying to easily scroll to another song in the library!) or AIM or other programs... anybody know how I can fix this? thanks.

    Hello and Welcome to Apple Discussions!
    Full keyboard access is useful for people who have difficulty using a mouse. Safari supports standard full keyboard access shortcuts for buttons and menus. If you choose, you can also use the keyboard to highlight links in webpages.
    To turn on full keyboard access:
    Choose Apple menu > System Preferences and click Keyboard & Mouse.
    Click Keyboard Shortcuts.
    Select the checkbox to turn on full keyboard access.
    To highlight links in webpages using the Tab key:
    Choose Safari > Preferences and click Advanced.
    Select the option to highlight each item on the web page using the Tab key.
    With full keyboard access turned on, Safari uses the standard shortcut keys to access menus and windows, plus the additional shortcuts shown in the table.
    Hope this helps!!
    Carolyn

  • There should be a way to index an array with an array of indexes or booleans (without a loop)

    Hi, often I would love to index an array with an array of indexes or an array of booleans without having to loop it.  I.e: let the IndexArray function accept an array of indexes instead of discrete indexes.  The output should then be an array of indexes values.  
    Another use case is to index with an array of booleans, so each TRUE element would index the input array and FALSE elements are not indexed.
    arrResult = arrInput[ arrIndexes ];  or
    arrResult = arrInput[ arrVal > 20 ];
    Would this be useful? Possibly it could be implemented in future versions?

    You forgot the link.

  • The "write key" configurat​ion file vi use of "trim string" prior to writing the data can modify any string data written.

    I tried to use the config VIs to record some front-panel settings for later restoration, one of which could be a single space character (part of a string parsing system).
    I soon discovered that whenever I tried to save that single-space value to an INI file, only a null string was saved.
    After doing some digging I discovered that buried in the Write Key vi is a worker vi called Config Data Modify that uses Trim String on the string data before it is written to the file and that's what was eating my string character. I don't know whether this is a bug or a feature but there are at least three ways to fix it.
    1) Assuming you want to leave the library VIs alone, you can pre-process any stings sent to "write key" to replace all spaces with "\20" and then post-process all strings read using "read key" to replace all instances of \20 with spaces.
      and if you don't mind modifying the library VIs, either to save/use under a different name or to stick back into the library in a modified state (caution - can cause problems when you move code to another machine with an un-modified library) then...
    2) You can yank the trim-string out of the Config Data Modify vi and hope that it does not have any undesirable side effects with regards to the other routines that use Config Data Modify (so far I have not found any in my limited testing)
    or
    3)  You can modify the string pre-processing vi, Remove Unprintable Chars, to add the space character to the list of characters that get swapped out automatically.
    Note that both option #1 (as suggested above) and option #3 will produce an INI file data entry that looks like    key="\20Hello\20World\20"   while option #2 produces an entry that looks like   key=" Hello World "
    The attached PDF contains screenshots of all this.
    Attachments:
    Binder1.pdf ‏2507 KB

    Hi Warren,
    there's a 4th option:
    Simply set the "write raw string" input of the write key function to TRUE
    This option only appears when a string is wired to that function!
    Just re-checked:
    I think it's a limitation of the config file format. It's text based and (leading) spaces in the value are "overseen" as whitespaces. So your next option would be to use quotes around your string with spaces...
    Message Edited by GerdW on 05-02-2009 08:32 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Read Key and Write Key not working as expected with paths on RT

    The configuration file VIs Read Key (Path) and Write Key (Path) don't seem to work as expected (at least not as I was expecting them to) on an RT target.
    When working on my WinXP PC with these two VIs, paths are translated to what looks like is supposed to be a device-independent format before being written to disk. The path C:\dir\file.txt becomes /C/dir/file.txt when writing and vice versa when reading. On my RT target, however, that same path is written to disk as C:\dir\file.txt, unchanged from the native format.
    The translaton of a native path to and from the device-independent format appears to be the responsibility of Specific Path to Common Path and Common Path to Specific Path. These both use the App.TargetOS property to determine the operating system. In the case structure for these two VIs, however, there is no case for PharLap or RTX. (My RT hardware is runnng PharLap; I don't know enough about RTX to comment.) This means that the results of String to Path or Path to String are used without translating between the device-independent format to the native path format.
    This isn't a problem if you create a configuration file on one machine and use it on that same machine. I noticed this only when tranferring a config file from my PC to the RT target, where the target would not open the file paths it loaded from the configuration file.
    This occurs on 7.1.1 and 8.0.  I don't have 8.20 to see if happens there, too.

    In LV 8.2, this was fixed.
    The problem is App.TargetOS returns "Pharlap" on RT systems, and "Pharlap" is handled by the default case ("invalid OS target") in LV 8.0.  In LV 8.2 the default case is "Windows 95/NT", however.  The reason you could write and read an .ini file on RT in LV 8.0 and earlier is because these two VIs (listed below) were both running the default case of "invalid OS target".
    vi.lib\Utility\config.llb\Common Path to Specific Path.vi
    vi.lib\Utility\config.llb\Specific Path to Common Path.vi
    As you saw, this fails when you perform one operation in Pharlap but the other in Windows.  You can fix this by modifying the two VIs listed above.  Just go to the case structure and make "Windows 95/NT" the default case.

  • Config write key outputs data in Notepad++ with equal to sign

    Hi,
    I have a situation where I am trying to write data in Notepad++ using Write key VI in labview library. 
    THe data which I get is in the following format 
    but what i want want the output to be is this way 
    The probelm here is when we wire something to "value", it writes it with double quotes and if is it blank than it writes with =" ". Just to clear it "Class" and "Jammer Input MB/HB BPF" goes to the "key" wire.
    I dont understand how to get rid of those quotes and equal sign.

    Yamaeda wrote:
    Strings are usually written with citation marks to handle spaces. You can deactivate that by wiring True to "write raw string".
    /Y
    I forgot all about that, since I haven't ever cared how it went in or came out.  Nice.
    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.

  • Write an 1d-array of cluster with 3 elements

    Hi,
    I have to make a "Power spectral densities" analyse from my waveform data. The results from this VI is an array of cluuster with 3 elemments. Now I want to write this array of cluster with 3 elements to a file. And later it must be able to use this file with EXCEL!!
    thanks

    Hi
    I found some outer Forum entries about this topic.
    Look at this links:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=49553&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=170&message.id=51526&requireLogin=False
    I hope this helps
    Manuel

  • How can I write a 1d array of cluster with 3 elements to a file?

    Hi,
    I have to make a "Power spectral densities" analyse from my waveform data. The results from this VI is an array of cluuster with 3 elemments. Now I want to write this array of cluster with 3 elements to a file. And later it must be able to use this file with EXCEL!!
    thanks

    Hello schloronzo,
    make a for loop feeded with your array. Inside the for loop unbundle
    the cluster, "format into string" the 3 values, adding the result to
    the ones before and collect them in a shift register. Then save the
    resulting string to a txt-file. If you make a good format string then
    Excel is able to read your txt-file (use tab a separator and CR/LF
    after each 3 values aka "csv format").
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Write 1d array of cluster with 2 elements to file

    HI!
    I'm new at LabView so I hope the question is very simple to you:
    I am using a waveform graph to display several measurements.
    Now I want to save these Measuremens. The data are stored in 1d array of cluster with 2 elements.
    What is the easiest way to do this??
    Thanks

    If you are already using waveforms you can simply wire right up to "Write Waveforms to File.vi" in the Waveform palette under Waveform File I/O.
    Daniel L. Press
    PrimeTest Corp.
    www.primetest.com

Maybe you are looking for