Numeric values longer than 32bit?

Greetings,
I'm an EE student currently working as a LV instrument driver developer
for a well-known T&M equipment manufacturer here in Munich.
My problem is the following: Is it possible to handle numeric values
longer than 32bit in LV? Specifically, one of my instrument driver VIs
needs to supply an initialization value to the Wideband CDMA "long code"
configuration menu of a versatile vector signal generator. This value
can range from 0x0 to 0x1FF,FFFF,FFFF (which accounts for 41 bits, if
I'm not mistaken). The instrument expects this value in hexadecimal
form.
A quick and dirty solution could be either to split up the control range
in 32+9 bits, i.e. place two controls on the front panel, or to use a
string control an
d have the user specify the hex value as a string. Both
solutions are not very desirable though, especially since instrument
driver VIs are meant to be used as sub-VIs in customer-specific programs
and for that reason aren't usually accessed from their front panels.
So, are there any other, more elegant solutions than the ones mentioned
above?
Thanks a lot in advance!
(c) Tobias Hermann

In <[email protected]> Tobias Hermann writes:
>My problem is the following: Is it possible to handle numeric values
>longer than 32bit in LV? Specifically, one of my instrument driver VIs
>needs to supply an initialization value to the Wideband CDMA "long code"
>configuration menu of a versatile vector signal generator. This value
>can range from 0x0 to 0x1FF,FFFF,FFFF (which accounts for 41 bits, if
>I'm not mistaken). The instrument expects this value in hexadecimal
>form.
FORMING THE 41-bit STORAGE
You can create any arbitray numerical data length by using a binary
array. This is the best and most direct solution to your needs.
Just remember, LabView allocates binary arrays in multiples of bytes,
so a 41-bit array will be rounded up to a length of 6 bytes or
48-bits; however, LabView knows to return only the first 41-bits to
you upon request.
GENERATING AN ARRAY OF 41-bit VALUES
The next issue is that you need an array of 41-bit numbers. You simply
define this as a 2-dimensional array of binary values. When
initializing this array, be certain you order the dimension indices
such that the fastest moving index has a size value of 41. The slowest
moving index will then be for the actual numerical size of your array.
If you transpose the index definition, nothing will work right! Be
careful!
When your array (above) is defined, it should be shown in LabView as a
brown wire, which deplicts it as a binary 2-dimensional array. If it
is instead shown in a magenta color, then you instead defined and array
(cluster) of 41-bit binary numbers. That will work okay too (and will
even be easier the used), but it will take more storage and will take
LabView longer to handle. However, if you're more confortable will the
latter choice, I can understand that. It does have the feature of being
able to address each 41-bits number directly. With the 2-dim approach
I initially outlined, you'll need to slice out each 41-bit number from
the 2-dim array each time you access (read/write) it.
FORMATTING BINARY INTO HEX
Formatting your storged numbers is an entirely _separate_ issue and
your 41-bits numbers only need to worry about formatting when you
send them to an output device. For a LabView control panel, simply
open a binary array control, then select the appropriate options so
they are displayed in base-2, octal, or hex. LabView supports all
three display formats with any binary indicator.
If you need to format your numbers to a hex string (for an output
device), try the "To Hexadecimal" or "Format & Append" function.
Again, if you're using the 2-dim binary array apprach, you'll need to
slice out each 41-bit number indivdually. If you're using the cluster
(array) if 1-dim 41-bit array approach, you can skip that step.
Frankly, I'm not sure how well LabView's formatting functions work with
1-dim binary arrays, but in principal they should. If they don't work
directly, no big deal. Just cast the 41-bit arrays into U8 numbers
(bytes) and have the formatting function format those numbers into hex
strings; simply one more step.
One question: Why on earth do you want to format the data going
into your instrument in the first place? Almost all instruments will
take binary input _directly_ without formatting it into ASCII (octal,
hex, etc) first. This is much faster because the ASCII of all this
hex stuff requires many more bytes to transfer to your instrument.
Moreover, the instrument then needs to convert the ASCII (hex) back
into binary before it can use any of it. You should investigate
skipping the formatting step altogether. The exception might be
if you're using an RS-232 connection to your instrument where raw
binary isn't allowed. Newer interfaces like GPIB, 1394, etc will
allow binary transfer directly.
COMMENTS ON STRINGS
Don't use strings in LabView. By default, each string get a minimal
memory allocation of 2K. If you define a 100 element (array) string,
that's 200K of memory just to hold those strings. Not a big deal, but
when the memory manager starts doing garbage collection (which is
required with string manipulations), things will really slow down.
String are important, but data should always be stored in a binary
form within any computer, not in ASCII formatted form (hex included).
/\ Mark M Mehl, alias Superticker (Supertickler to some)
<><> Internet: [email protected]
\/ Preferred UUCP: uunet!iastate.edu!mehl
Disclaimer: You got to be kidding; who would want to claim anything I said?

Similar Messages

  • How can I force an "invisible" object to become "visible" when a numeric value is entered?

    So I’m trying to force an “invisible” subform to switch to “visible” when a numeric value greater than or equal to 22 is input into a numeric field.
    I can’t get the following javascript code to work properly with any event. I’ve tried the change, calculate, validate, events and a few more to no avail. The only event that kind of works with the javascript code I’m using is the validate event. When I input the code into the validateevent, the invisible subform becomes visible when an amount equal to or greater than 22 is entered, but when ANY amount is input into this field, an error message pops up that says “NumericField4 validation failed” and the user has to click “Ok” to get rid of the pop up box.
    if (this.rawValue <= 22) {
            Approval23.presence = "hidden";
    if (this.rawValue >= 23) {
                Approval23.presence ="visible";
     Here’s a link to my .pdf: http://www.filedropper.com/salgovform
    The object field that the javascript code is contained in is called: NumericField4 (a.k.a. New Job Grade)
    The subform that I want to become visible when a number greater than 22 is input into NumericField4, is called Approval23.
    I’ve based the javascript code I used on information I gathered from the following thread and associated .pdf . . .
    Thread:
    http://forums.adobe.com/message/1982919
    PDF in thread with the javascript code:
    http://forums.adobe.com/servlet/JiveServlet/download/1981437-8059/Sample_SW.pdf
    I’m pretty sure I’m just missing one little thing that’s throwing everything off!
    Any help would be GREATLY appreciated.

    Hi,
    The following works in the exit event of the numeric field, where the language is set to JavaScript:
    if (this.rawValue <= 22) {
         Approval23.presence = "hidden";
    else {
         Approval23.presence = "visible";
    Here is your form: https://acrobat.com/#d=3gRNt6WBY2bE0K7en4CnSA
    Hope that helps,
    Niall

  • Is it normal for a waveform graph to truncate arrays of values that are longer than others when displaying multiple waveforms on the same graph?

    I am reading back values of several waveforms that were saved to disk using the write to spreadsheet vi. Some of the data sets are longer than others eg. 35 seconds vs 45 seconds. All have the same sample rate.
    See the code segment below. If I select the larger files first then all the data will show. If I select a smaller file first the larger ones will be truncated to the size of the small file. I am using LV 7.0.
    Attachments:
    codesnippet.vi ‏41 KB

    I needed to make some grammatical/ nomelclature changes, But, Could not edit the previous post.
    so posting again
    "Thats because you are inserting into an array of a predefined size.
    For ex,
    When you try inseting a 1D array 'A' of 50 elements as row 1 of a  2 D array of 40 elements(in row 0 ), only only the first 40 elements will get insetred into 2 D array. You lose the last 10 elements of array 'A'
    To avoid this, I suggest you use XY graph( of course you have to create an x axis with the index of each element in the inserted array and plot on xy graph).
    Any doubts, do get back"
    regards
    Dev

  • BDC error-- INPUT VALUE IS LONGER THAN SCREEN FIELD

    Hi all,
             I wrote BDC for VA01. Here I need to pass condition amount to the BDC SCreen ( field name : KOMV-KBETR). When i run the BDC, it is throwing error -- ' INPUT VALUE IS LONGER THAN SCREEN FIELD '.
    Then I passed the amount value manually to the BDC screen field. Still it is not working.
        DATA : v_kbetr1 TYPE komv-kbetr.
        MOVE itab-kbetr1 TO v_kbetr1.
       PERFORM bdc_field       USING 'KOMV-KBETR(08)'
                                      v_kbetr1.      
    Please look into this issue.
    Thanks,
    Murali Krishna.T

    v_kbetr1 type komv-kbetr
    have you seen the code automatically generated after recording in SHDB. You may notice that all the variable will be declared of character type. That is to avoid these kind of problems.
    Change the declaration as character type of length 14. it should work.

  • Why IID_ICURSORREGION no longer name a numeric value in ID CS6 SDK based Plug-in?

    File /Users/pengz/IDCS6SDK1/build/mac/prj/../../../source/sdksamples/JYTCtrl/JYTCtrl.fr; Line 143 # Error: Identifier 'IID_ICURSORREGION' does not name a numeric value.
    But it does not have compile error on window version. It only appears in Mac version.

    Hi! Dirk
    I think I got the answer, which is that I did not include "CursorID.h" file on my .fr resource.
    Thanks for reminding me the head files

  • How do I read from a text file that is longer than 65536 lines and write the data to an Excel spreadshee​t and have the data write to a new column once the 65536 cells are filled in a column?

    I have data that is in basic generic text file format that needs to be converted into Excel spreadsheet format.  The data is much longer than 65536 lines, and in my code I haven't been able to figure out how to carry over the data into the next column.  Currently the conversion is done manually and generates an Excel file that has a total of 30-40 full columns of data.  Any suggestions would be greatly appreciated.
    Thanks,
    Darrick 
    Solved!
    Go to Solution.

    No need to use nested For loops. No need for any loop anyway. You just have to use a reshape array function. The picture below shows how to proceed.
    However, there may be an issue if your element number is not a multiple of the number of columns : zero value elements will be added at the end of the last column in the generated 2D array. Now the issue depends on the way you intend store the data in the Excel spreadsheet : you could convert the data as strings, replace the last zero values with empty strings, and write the whole 2D array to a file (with the .xls extension ) using the write to spreadsheet function. Only one (minimal) problem : define the number of decimal digits to be used;
    or you could write the numeric array directly to a true Excel spreadsheet, using either the NI report generation tools or ActiveX commands, then replace the last elements with empty strings.
    We need more input from you to decide how to solve these last questions. 
    Message Edité par chilly charly le 01-13-2009 09:29 PM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Example_VI.png ‏10 KB

  • JMS Queue XML numeric value out of range

    Hi
    I have an interface that process the root element of the JMS message.
    It is failing on the step Load JMS to XML. The error states: numeric value out of range.
    I've analysed the message and determined the exact data item which is 11 digits long.
    The JMS model only accomodates for numeric(10,0). I tried changing it, but still get the error.
    Any idea what I need to do so that this step will process that data without error?
    Cheers
    PS ODI 11.1.1.6

    Hi All,  I have one scenario to read the source file . The file delimiter is '|' . The no of pipeline for each line is 17. So if a line containing more than 17 , send an error email. For this first i am printing tota pipeline in ecah line to afile called pipelinecount.txt . Then i will read this file and send each value to while loop /for loop , where it will get > 17 , it will exit the process and send an email.  But here in script i am getting error at while line. Could anyone help.   #! /bin/kshset -x SOURCE_DIR=/vp01/SrcFilessed 's/[^|]//g' /vp01/SrcFiles/Test.txt | awk '{ print length }'> /vp01/SrcFiles/pipelinecount.txtcd $SOURCE_DIRwhile line in `cat pipelinecount.txt`; do if [ $line -eq 17 ];thenecho "No issue in pipeline"exit 0;fiif [ $line -gt 17 ];thenecho "No of pipelines exceeded the expected. Please verify the source file." | mailx -s "WKFS Load: Failed" [email protected]

  • Numeric Value Out Of Range Error in Callable Statement

    I keep getting an error whenever I try and pass in a value greater than 9000 into my stored procedure. The procedure call looks like this:
    sSelect = "execute sp_storedproc ?, ?, ?, ?, ?, ?, ?";
    CallableStatement call = objConn.prepareCall(sSelect);
    call.setString(1, "TEST"); //DB TYPE = VARCHAR
    call.setInt(2, 4); // DB TYPE = INTEGER
    //*******************PROBLEM LINE***************************
    call.setFloat(3,(float) 9001); //DB TYPE = MONEY
    call.setInt(4, 25 ); // DB TYPE = INTEGER
    call.setFloat(5,(float) 0); // DB TYPE = MONEY
    // output parameters
    call.setDouble(6, 0);
    call.setDouble(7, 0);
    call.registerOutParameter(6, Types.DOUBLE);
    call.registerOutParameter(7, Types.DOUBLE);
    // execute stored procedure
    call.execute();
    // retrieve value
    val1= call.getDouble(6);
    val2= call.getDouble(7);
    I keep getting a "[Microsoft][ODBC SQL Server Driver]Numeric value out of range." error.
    I'm using MS SQL server 2000. The error only occurs when I pass in values > 9000. Since there's no direct mapping between java data types and SQL MONEY data type, I've tried passing every possible type into the procedure with the same result (e.g. float, long, double, int, BigDecimal). If anyone has come across this problem and knows a solution please help!!
    Thanks.

    knows a solution please help!!Modify the stored proc so it takes a varchar. In the stored proc convert the string to the correct type. In java use setString() to pass in the value.

  • Dump with ORA-01438: value larger than specified prec

    Hello All,
    I am getting a dump in production with the above said error and the ST22 gives me further analysis that
    "If the error occurred in Open SQL, there is probably an inconsistency
    between the NAMETAB and the ABAP/4 Dictionary.                      
    Compare the length specifications of the fields in the NAMETAB with 
    those in the ABAP/4 Dictionary and contact someone who is able to   
    perform a consistency check and eliminate the problem.              
    In most cases, this person will be your SAP consultant.             
    Please make a note of the actions and input which caused the error. 
    Please make a note of the actions and input which caused the error. 
    To resolve the problem, contact your                                
    SAP system administrator.                                                                               
    Choose "Print" for a hard coopy of the termination message. You can 
    display and adminster short dump messages using Transaction ST22.                                                                               
    Error analysis                                                                               
    The problem has arisen because, within the database interface,      
    one of the data buffers made available for the INSERT (UPDATE)      
    is longer than the maximum defined in the database.                 
    On the other hand, it may be that the length in the NAMETAB         
    does not match the maximum length defined in the database.          
    (In this case, the length in the NAMETAB is longer.)                 "
    First time it gave me one record so I dropped that record and again executed the program but next time it gave me other record.
    So I am not sure it is related to data error or database error. I can not debug the program in production and dev also as it is difficult to repeat the data in dev.
    Any clues on this ?
    Thanks in advance
    Sameer

    Looks like a precision error:
    ORA-01438: value larger than specified precision allowed for this column
    Cause: When inserting or updating records, a numeric value was entered that exceeded the precision defined for the column.
    Action: Enter a value that complies with the numeric column's precision, or use the MODIFY option with the ALTER TABLE command to expand the precision.
    Rob

  • Execute immediate with a string longer than 32767

    hello,
    is there a possibility to make an execute immediate with a statement, that is longer than the 32767 max. bytes for varchar`s? We get in a CLOB SQL-Statements with data that are longer than 32767. It would be easy if it were possible to make an execute immediate but because of the length limit it seems impossible. Does anybody know an alternative way to execute the sql-statements in the CLOB-Column?
    Anna

    6 execute immediate to_char(sql_text) into var_num;As a matter of interest have you tried this with a CLOB that is bigger than 32K?
    When I try it the PL/SQL limit gets enforced:
    SQL> declare
      2    c clob;
      3  begin
      4    dbms_lob.createtemporary(c, true);
      5    dbms_lob.writeappend(c, 43, 'CREATE OR REPLACE PROCEDURE big_p AS BEGIN ');
      6    for i in 1..800 loop
      7       dbms_lob.writeappend(c, 6, 'null;'||chr(10));
      8    end loop;
      9    dbms_lob.writeappend(c, 4, 'END;');
    10    execute immediate  to_char(c);
    11  end;
    12  /
    PL/SQL procedure successfully completed.
    SQL>  declare
      2    c clob;
      3  begin
      4    dbms_lob.createtemporary(c, true);
      5    dbms_lob.writeappend(c, 43, 'CREATE OR REPLACE PROCEDURE big_p AS BEGIN ');
      6    for i in 1..8000 loop
      7       dbms_lob.writeappend(c, 6, 'null;'||chr(10));
      8    end loop;
      9    dbms_lob.writeappend(c, 4, 'END;');
    10    execute immediate  to_char(c);
    11  end;
    12  /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at line 10
    SQL> Cheers, APC

  • Validation To check numeric value

    BEGIN
    IF :P3_TOTAL_AMOUNT >= :P3_NET_AMOUNT THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    END;
    The function returning boolean should compare total amount and net amount and through error if it less than net amount.
    It works fine when the value of TOTAL amoun =365 and value of net amount = 364*(if it is all numeric value and no zero behind it)*
    But the problem is
    when is use Total amount = 9 and net amount = 100 (It doesnt works becuse it just takes 1 from the net amount and eliminates the zeros behind the 1(100) and it doesnt comes up with a error after validation )
    Is there any one who can help me with this
    Thanks,
    Hary

    Lev,
    I'm not sure I follow. If you use to_number with a format mask and the user doesn't follow your mask, you'll get an error:select to_number('1000','999G990') from dual;This throws an "ORA-01722: invalid number" exception. That's why I say to try calling to_number without a format mask first, to handle the trivial case of the user not putting in the grouping separators (or whatever else is involved in your format).
    You could, of course, put in a validation to make sure that the number follows the format you're expecting before you convert it (either for further validation, as in the original post, or for processing), but then you have multiple places where the format mask is specified--not to mention the annoyance for users when they put in a number only to be told that they need to use the appropriate grouping separators as well. My solution uses the data dictionary to get the format mask assigned to the page item and feeds that to to_number; if I change the page item's format mask, all of my processes automatically handle the new format. Because of the extra lookup, it's slightly slower than hard-coding the format mask, but that should be minimal as long as you don't use it in a where clause.
    -David

  • Can one assign a numerical value to a variable?

    Hi All,
    Good afternoon,
    I am currently working on a form that has strings as values in 2 different listboxes, and depending on what is selected a message pops up. Here is the script I wrote, but it does not seem to work right
    var a=aKlaclistbox.raWvalue=="SSK";
    var b=bZlaslistbox.raWvalue=="SGT";
    a.value=1;
    b.value=2;
    if(a > b){
        xfa.host.messagebox("You cannot select a lower officer as the rating officer");
    It does not work, and I am just wondering if there is any way I can get around it so that I can compare the values. I need help from anyone on this forum.
    Thanks
    v/r
    Tammy

    There's probably a better way of doing this, as, depending on how many ranks you have, it could get cumbersome. Like using an array or something like that but not sure how to accomplish that.
    If there are a lot of ranks to compare I think I'd suggest reworking things so that you can use the numeric value of the list box, it will be much easier in the long run.
    As I mentioned above, I don't think the following is valid code:
    var a=aKlaclistbox.raWvalue=="SSK";
    Nor is (unless dealing with global variables):
    a.value=1;
    I think you need to do something like the following (hopefully someone else around here might have a better idea!):
    var a;
    var b;
    if (aKlaclistbox.rawValue == "SSK") {
         a = 1;
    if (bZlaslistbox.rawValue == "SGT") {
         b = 2;
    //You would need a series of else/if with the above to map the different rank values.
    if (a > b) {
       xfa.host.messagebox("You cannot select a lower officer as the rating officer");

  • Non numeric value in numeric field giving error

    Hi All
    I am using BAPI for creating sales order. If user is giving non numeric value in Quantity field it is giving error. Because quantity field data type is Double.
    Please Help.
    Thanks
    Raktim

    Hi Banerjee,
                 Create a String/int/long Context variable and point it to UI Input element.Do the validation  for correct input value. once the validation is succesful assign that value to RFC BigDecimal variable by Explicit casting.
    Hope this might solve your problem .
    Thanks
    Madhan

  • How to get the day as numeric value without formatting the date?

    Hello,
    to reduce the costs of a sql-statement I need to get the day of a date-value as number (to compare it to a numeric value) without any formatting. Every formatting results in a full table scan of the table with the date field. Is there any function to solve this problem?
    Oracle version is 11g.
    Thanks Carsten

    CarstenDD wrote:
    select T1.SYSID from T2,T1
    where T2.SysT1 = T1.SYSID
    and T2.Date1 < '01.03.2011' --German date format
    and to_number(to_char(T2.Date2,'DD')) = 1
    and T2.Inactive = 0
    The explain plan shows a full table scan on T2. With EXTRACT(DAY FROM T2.Date2) there is no difference.It probably would and should in any case.
    Look at your predicates, which of them would reduce the resultset to a fair size compared to the total number of records in the table?.
    - You may have a huge number of records when you say date less than
    - Of these perhaps one seventh have day = 1
    - My guess is that most have Inactive = 0
    Besides, you should not rely on implictit char to date conversion, always use TO_DATE
    How many records are in the table? - How many will that query return?
    Regards
    Peter

  • Bug in sort of numeric values in ( title and album ) string.

    The Bug in the sort-function of the iPod results in mixed up track list.
    An album with more then 9 tracks will be sorted in the wrong way, when only title or filename or album field is just to give a track a number. The play order is 1, 10, 11, 12, 13, 2, 3 , 4 , 5, 6.... instead of the correct order 1,2,3,4,5,6...10,11, 12...
    For example: After playing the track named "The Beatles - Yellow Submarine - 1 - Yellow Submarine" the ipod will play "The Beatles - Yellow Submarine - 10 - Baby, You´re A Rich Man" instead of "The Beatles - Yellow Submarine - 2 - Hey Bulldog."
    The programmer have to search the string for numbers and join all numeric values to a single number.
    Example: Sample data :abc123. is "a" a number? no. is "b" a number no. is "c" a number no. is "1" a number? yes. store. is "2" a number? yes. join to "1". (now we have "12"). is "3" a number? yes. join to "12". (Now we have "123") -> EOL
    Is "123" largen than "99"? yes! is "123" larger than 124. no!
    Thats it. In perl you need 1 line of sourcecode, in c and c++ this can be done in 10 lines. In java (there a objects for this type of sort).
    And every user will be happy and nobody has to do the 01, 02, 03 workaround or reimport their audiobooks.
    Alternativly Apple should thing about storing the original filename in the ID3 tag or itunes database. This would make sorting the files without id3 tags (believe me or not, there are many people using mp3 for 10 years and have no id3 tags in there mp3-library) in itunes possible. (there is a god free tagger for mac os but no for windows.)
    A company like Apple should have the ability to correct the error / bug in the iPod-firmware (have the same issue in classic and iphone) or itunes-softwar.
    This is a wellknown and very common error done by newbie programmers or people who have not read the documentation of the software-libraries.

    I still have an H140 in the cupboard. As I recall that needs leading zeros on filenames to sort properly. Since both WMP & iTunes include leading zeros it was never really an issue. THE Rename should be able to extract the track numbers from part of the filename and is also able to generate counters, along with the usual functions of setting tag fields from part of the file and/or folder name. Unfortuanetly THE Rename is still on the complicated side - I suspect there would be no easy way to lump together the variety of options that it has while keeping it very simple.
    Once you've used an external program to adjust the tags you can make iTunes re-read them just by selecting the group of files in question, using CRTL-I to "Get Info." and then clicking OK +without making any changes+. iTunes will recheck it's database against any values in the tag and update as required. Given the lack of existing tags I would imagine that you don't let iTunes reorganise your music at the moment and would suggest you keep things that way at least until you are sure that all the tags have been correctly applied and you have a suitable backup. I stick to a Artist/Album/## Track structure which I don't let iTunes manage so that I can always recover details from the filesnames if I should ever accidentally edit more tracks than I intend.
    tt2

Maybe you are looking for