Format into SI string (always kHz)

Hello,
I'm reading DBL sample rate values from different RF bands and using the value to create a file header in order to store complex 32IQ binary data to file. I'm using the format into string function to do this but I always want the sample rate to be represented in kHz and I haven't thought of a way to force this to always be the case. I'm using a format string of %.3p which for sample rates such as 13125 and 400000 it returns 13.125k and 400.000k respectively and that is what I want. However, one of my bands is 3750000 Hz and the format into string returns 3.750M. I would like it to return 3750.000k instead. Anyone have any ideas on how I could accomplish this?
Thank you,
Tim
Tim Sileo
RF Field Account Specialist
National Instruments
You don’t stop running because you get old. You get old because you stop running. -Jack Kirk, From "Born to Run" by Christopher McDougall.
Solved!
Go to Solution.

I would guss that the internal code that shows the SI units is using the 'multiples of three' flag to determine the magnitude. If you use the advanced properties to select between engineering and SI units, the 'multiples of three' box is disabled when you select SI. 
I experimented with various display formats, but could not get the combination you indicated.
I believe the SI standard reccommends that prefixes for which the exponent is divisible by three are used.( http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_​prefixes )
LabVIEW is displaying the number to the SI standard. Your desired display type is not standard SI units (although it may be common and practical in your environment/industry).
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

Similar Messages

  • Turn a string that shows hex data in normal format, into a string that shows the same data in hex format

    I have a string of arbitrary length - say, 1AB1C0 - in normal format. I would like to have a function which takes that string in, and outputs the same exact characters, but in hex format. So the input will read 1AB1C0 in normal string format, and the output will read 1AB1C0 in hex string format.
    I am doing this because I have found the end device works better if I send the bytes as a hex string vs. as an array of U8. Furthermore, I manipulate a lot of byte streams in my program, and I find the string parsing tools less cumbersome to use vs. the byte array parsing tools - however, they only work on the strings as they appear in normal mode. So I have reasons in different parts of my program to have the string in normal vs. hex formats; but I cannot figure out any remotely elegant way to cast from one to the other.
    Solved!
    Go to Solution.

    CraigRem wrote:
    So the input will read 1AB1C0 in normal string format, and the output will read 1AB1C0 in hex string format.
    Well, you need to scan the hex formatted string two bytes at a time to an U8 numeric and then cast it back to a string. There are many ways to do that, here are two possibilities. (Mkae sure to use the correct representations as labeled).
    (I still don't quite understand your reasoning why you need this).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    NormalToHex1.png ‏12 KB

  • How can I convert IDoc in XML format w/DTD into a string?

    I want to send by e-mail outbound IDoc in XML format with its document type definition (DTD).
    I want to be able to get the same output result into a string than the XML file IDoc port type with DTD activated.  I have created a FM (based on SAP "OWN_FUNCTION") assigned to an IDoc port of type ABAP-PI that executes the following processing steps:
    1-Extract outbound IDoc information to get the sender & recipient mail addresses (EDP13 / EDIPHONE tables).
    2-Convert & Transform IDoc data into XML string using FM IDX_IDOC_TO_XML.
    3-Prepare and send e-mail with XML attachement using FM SO_NEW_DOCUMENT_ATT_SEND_API1.
    I cand generate the e-mail with the XML file attachement but FM IDX_IDOC_TO_XML does not convert the IDoc with proper formating and DTD.
    What should I use to accomplish the IDoc conversion to XML w/DTD into a string?
    Should I use XSLT tools ?
    How does that work?
    Thank you
    Carl

    muks wrote:
    Use decimal string to number
    Specifically, you can define a constant with a different datatype on the input on the lower left if you need a different datatype (e.g. U8, I64, DBL, etc) Are all your values integers or do you also need to scan fractional numbers? In this case, you should use "fract/exp string to number" instead.
    LabVIEW Champion . Do more with less code and in less time .

  • A class to format an XML string into indented xml code

    I am looking for a class or a piece of code to format an XML string into indented xml code
    for example: an XML string as follows
    <servlet><servlet-name>Login</servlet-name>servlet-class>ucs.merch.client.system.LoginServlet</servlet-class></servlet><servlet-mapping><servlet-name>Login</servlet-name>
    to format into :
    <servlet>
    <servlet-name>Login</servlet-name>
    <servlet-class>ucs.merch.client.system.LoginServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Login</servlet-name>
    <url-pattern>/Login</url-pattern>
    </servlet-mapping>
    e-mail : [email protected]

    Xerces has a class called OutputFormat
    If you have your XML document in memory, you can format it using the method setIndenting(true) on the OutputFormat class. The following is an example:
    assuming xmlDoc is our document and fileName is the name of the file we wish to write to:
    OutputFormat format = new OutputFormat(xmlDoc);
    // setup output file name
    PrintWriter printwriter = new PrintWriter(new FileWriter(fileName, false));
    // construct an XMLSerializer for writing the document
    XMLSerializer serializer = new XMLSerializer( printwriter, format );
    // Ensure output is indented correctly...
    format.setIndenting(true);
    // set serializer as a DOM Serializer
    serializer.asDOMSerializer();
    // serialize the document
    serializer.serialize(xmlDoc);
    hope this helps!
    Rob.

  • Input XML Format needs to be Translated Into CSV String Format

    Hi,
    I need to translate input xml format to CSV string format in BPEL.
    How to use xpath function to do this?
    Thanks

    1. In the partner link of the file adapter you can run the wizard and create a XSD according to your CSV format.
    (you just need to create an example of CSV)
    The wizard will create a XSD automatically.
    2. Assign an invoke activity to that partner link.
    3. Use transformation to pass data from your XML input into the invoke variable.
    Arik

  • Format into string 16 bit signed integer

    Is there any format specifier string for "Format into string", whereas the result is an I16 string?
    My problem is when I use "%d" and the input string is 65535, the result string should be "-1".
    Solved!
    Go to Solution.

    Are you trying to get an integer out of an ASCII string (Scan from String) or turn an integer into a string (Format into String).  You title and question seem to contradict each other.
    Assuming you are trying to scan from string, it looks like you need to scan into a U16 and then use a conversion bullet to turn it into an I16.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Scan I16.png ‏11 KB

  • Format Into String

    Hello all,
    I would like to format a string with "a white space" between each
    string member. i am at odds as for the format, for the "format
    string" in the Format Into String function. let me rephrase that...
    the format which needs to be used to format the "FORMAT STRING" in the
    Format Into String function.
    i looked at the help, but it seemed very nebulous to me. all i need is
    to have "a white space" or a "carriage return" between the string
    members and store it to a file.
    thank you,
    cheers,
    -U

    > I would like to format a string with "a white space" between each
    > string member. i am at odds as for the format, for the "format
    > string" in the Format Into String function. let me rephrase that...
    > the format which needs to be used to format the "FORMAT STRING" in the
    > Format Into String function.
    >
    > i looked at the help, but it seemed very nebulous to me. all i need is
    > to have "a white space" or a "carriage return" between the string
    > members and store it to a file.
    >
    The format string is basically what ANSI C uses, but that string
    function has a dialog to help you build it. Either double click the
    node or right click and use the last item.
    In the dialog, you can place a format string followed by an exact string
    followed by another format
    string. For the exact string you can enter a
    space to output a white space, but to do a carriage return you have to
    use a \n or \r.
    Another way to do this, which I think is much easier and easier to read,
    is to use the Concatonate Strings node with three inputs. To the top
    wire the first string, to the middle wire a string constant from the
    next to last row. This is a much cleaner way to do the constants. And
    on the bottom input put the other string.
    Format into String is much more powerful when appending many types of
    data, but the simple append is clearer when it is powerful enough.
    Greg McKaskle

  • How not to omit leading binary zeros with format into string

    I'm using format into string to format serial data .  The problem I'm having is that Format into String with "%b" format identifier omits leading zeros
    in the string..   ie...  "3" becomes "11" when I need it as "0011"
    Solved!
    Go to Solution.

    see figure:
    Attachments:
    Example_VI.png ‏3 KB

  • Format Into File bug, repost#2

    Dear All,
    I have found a strange bug/feature in Format Into File.  A 3 digit integer number argument (eg. 123) together with the format string " %04d" should result in " 0123" being written to file but instead fails with error cluster;
    STATUS=TRUE
    CODE=4
    SOURCE=Format Into String in format_into_file_bug.vi. 
    I have appended a demo VI. Can anybody reproduce /explain this? My platform is WINXP Pro, LV6.1
    Thanks
    Tom Crane
    Ps. *Please* can anyone tell me how to delete unwanted posts from this BBS?  I find hitting the TAB key in IE -- a pretty innocent activity, which I constantly do without thinking results in multiple aborted posts, which I cannot see how to remove.  My apologies for those posts.  

    I have tried your demo using LabVIEW V7.11.  Worked out of the box, no errors.  I do not have LV V6.1 on any machines.  Have you tried using the format into string and then the write characters to file? Instead of the format to file function?
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • Format Into File bug, repost

    Dear All,
    I

    I have tried your demo using LabVIEW V7.11.  Worked out of the box, no errors.  I do not have LV V6.1 on any machines.  Have you tried using the format into string and then the write characters to file? Instead of the format to file function?
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • How do I copy the string portion of an enum into the string portion of a cluster?

    I want to do this for the an entire array of clusters.  I'm trying to use a for loop.  Can't figure out how to parse the string portion of the enum into the string portion of the cluster.
    Alternatively, I'd be happy if I could figure out some way to tie the enum to the array of clusters, but I figure that gets problematic.
    DH
    Solved!
    Go to Solution.

    Dark Hollow wrote:
    OK, let's say that the enumerated type has N elements.  I want to initialize an N element array of strings.  How do I reference each string in the enumerated type to get to each string?
    Easy way to do this is to use GetNumericInfo.vi, part of the Variant library, found in vi.lib\utility\VariantDataType\GetNumericInfo.vi.  Wire your enumeration to the Variant input; one of the outputs is an array of the strings in the enumerated type.
    The more complicated way is a for loop, in which you typecast the iterator terminal value to the enumerated type, then use Format Value.  You can get the maximum value of the enumeration by casting 0 to the enumerated type, then decrementing; cast that back to a numeric and add one to get the right value to wire to the N terminal.
    EDIT: just thought I'd add, since RavensFan's reply popped up while I was writing mine - I don't like the Strings[] approach because it doesn't work on RT targets, and I lost a lot of time once due to this trying to figure out why my code wouldn't run properly on an RT system but worked great on my development computer.

  • In report layout, can format a long string display as Column mode?

    Hi,
    Just want to check in report builder any way can format a long string into a column mode?
    Example: I have a field to hold 8000 character, and would like to print
    30 character in each line, when reach 50 line, then print in column i/o to print next page?
    Any idea ? Thanks a lot if you can share your experience with me.
    best Regards,
    Klnghau

    hi let say your field name is x
    then if your want it word wrap then it's simple just get one field and make it's vertical
    elasticity variable. and asign the field to it..
    but if you want your field to be displayed as
    first colunm and then beside continuation of that column but in 2nd one...
    then create 2 formula columns make your field legth been distributed half in each.
    so cf_1 is:
    decalre
    t varchar2(1510);
    begin
    if length(:x) > 1500
    t := substr(x, 1, 1500); -- as 30 x 50 = 1500
    else
    t := :x;
    end if;
    return t;
    so cf_2 is:
    decalre
    t varchar2(1510);
    begin
    if length(:x) > 1500
    t := substr(x, 1500, length(:x)-1500); -- as 30 x 50 = 1500
    else
    t := '';
    end if;
    return t;
    and then in design view
    field1 field2
    for field1 source is cf_1 and
    for field2 source is cf_2
    that's all
    Enjoy Oracle...

  • How to convert JAVA.SQL.DATE date in YYYY/MM/DD format into DD/MM/YYYY

    i am using informix database which accepts date value in the form of DATE format......
    the other part of my application takes date from the field in DD/MM/YYYY format...so i have to convert my java.sql.date in YYYY/MM/DD fromat into DD/MM/YYYY fromat of same type before inserting into db......
    but using parse method in SimpleDateFormat class can get the result only in java.util.date format...
    and also using format method can result only in string conversion........

    816399 wrote:
    i am using informix database which accepts date value in the form of DATE format......Huh?
    Maybe you mean Informix (fronted by JDBC) expects date values as java.sql.Date objects?
    the other part of my application takes date from the field in DD/MM/YYYY format...
    so i have to convert my java.sql.date in YYYY/MM/DD format into DD/MM/YYYY format of same type before inserting into db......I am not sure why you are talking about formats here.
    There is no formatting inherent in a java.util.Date object
    nor in a java.sql.Date object.
    but using parse method in SimpleDateFormat class can get the result only in java.util.date format...
    and also using format method can result only in string conversion........You can easily create a java.sql.Date object from a java.util.Date object.
    String s = "31/12/2010";
    java.util.Date ud = new java.text.SimpleDateFormat("dd/MM/yyyy").parse(s);
    java.sql.Date sd = new java.sql.Date(ud.getTime());
    ud = sd; // java.sql.Date extends java.util.Date so no conversion is needed

  • IPhoto says it won't import photos from my Fujifilm Finepix S1000 camera because it's the wrong format (jpeg).  It always has before... but I upgraded to Lion then went back to Snow Leopard and now it's not working.  Suggestions?  Thanks!

    iPhoto says it won't import photos from my Fujifilm Finepix S1000 camera because it's the wrong format (jpeg).  It always has before... but I upgraded to Lion then went back to Snow Leopard and now it's not working.  Suggestions?  Thanks!

    As a Test:
    Hold down the option (or alt) key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

  • Assign sysdate into a string variable ?

    Hi
    How to assign a sysdate into a string variable.
    Pleae help me...
    Rgds
    Merlina

    Basically impossible, since the two things can reasonably be described as a "sysdate" -- either a long or a Date object -- aren't Strings.
    Also I suppose you could reformat them as a String. But there are a lot of ways you could do that (a String representation of the long, in decimal or hex or octal or any arbitrary base, or a Date formatted in any arbitrary way, etc.).
    What exactly do you want to do, and why?

Maybe you are looking for

  • How do I back up Apeture photos to iCloud?

    Hi Appreciate any ideas folks may have on this one.  I've signed up for iCloud and photostream is working nicely.  I was hoping that I could use iCloud as a backup application for my Mac.  Most precious item is photos and videos.  I've tried both Car

  • Date & Time Showing always in the toolbar.

    I just switched to Snow Leopard. Before I switched I was able to make BOTH the date & time to show always in the toolbar. I can't remember how I did it on the earlier O.S.'s Thank you for your help.

  • *** FOX in basic infocube ??? ***

    Hi ! Do I need to create an infocube real-time type to execute just a FOX formula or a FOX formula run without problem in a basic infocube ? Thanks, Leandro.

  • Running a pre-test script to setup my test data

    I am trying to run a script from e-Manager Enterprise to setup or stage my data prior to the playback of my test branch. I think i could do it with vba in a dummy e-Tester script or via a third party test. Has anyone ever done this and what is the be

  • Obtain a primary token for a user who does not have permission to logon locally

    I would like to know whether it's possible to obtain a primary token for a user who doesn't have permission to log on locally. If yes, what the recommended way is for doing that. I called LogonUserW with logon32_logon_network logontype for user which