Evaluating binary strings with "Don't care" conditions

I frequently have to evaluate binary strings or register values for particular bits. Does anyone have a better way? And if not, perhaps this is a suggestion for NI.
To this point I've used two methods:
1. I turn the data into an actual string in my CVI code and inject X's in the necessary positions. I then perform a string evaluation for equivalence, the string now consisting of '1's '0's and 'x's.
2. Bring the data into the teststep and applying an expression to the data source, masking the appropriate bits. Then evaluate as a numeric with a value that assumes the offended bits "zeroness" or "oneness" depending on how I've implemented.
The first was one requires specialized code, but allows for a little more visibility (in the code at least) of which bits are designated as DCs. But translating a multiple byte and variable length of amount of information into a string is cumbersome. Sure the code is reusable, but I'm not convinced the translation is necessary or best.
The second buries the mask in a window that is, seemingly, infrequently used. I've had colleagues work on a project behind me trying to figure out where the value was being manipulated because I've applied a mask via the source. My original explanation of "ninjas" wasn't well taken...
It seems like it would be ideal for the limits window to allow the use of "X"s when defining a "binary" type comparison so that the mask is clearly defined in the limit itself, and the data as it's passed to and from teststand remains untouched. Also, if this were to be implemented I would hope the property loader would support it.
Am I missing a much easier way to do this? Anyone have a better way?
Thanks in advance!
Colt.
P.S. Why isn't "NI" and "CVI" built into the spell checker?

So in that first case where I am using CVI to "insert" I am building a string type vector that contains ASCII '1's '0's and 'x's. Where the Xs are in the binary position for what I am considering as "don't care".
So say for instance I was converting a piece of data that was 0xEB, with bit 0 being considered a DC for evaluation, I would build a string like "1110 101X" . This string is what I would pass back to teststand. In teststand I would then perform an equivalence test between the two strings.
For the second question about an implementation for the limit, say I open the test step, click on "Edit Limits" then from the drop down in the bottom right I select "Binary". I could then compose a limit in a similar form as described above. Where the limit box could contain something like "0b1110101X". But as for the data I hand to teststand, it would still be just a scalar value, with no masks applied. In the code, or in teststand.
Sorry if I'm not making any sense! I hardly ever do...
Colt.

Similar Messages

  • Creating all binary strings with n 1's and n 0's

    if i wanted to create all possible strings of n 1's and n 0's where there are never more 0's than 1's using 2 for loops and recursion how would i go about this? (the first for loop controlls how many 1's are in the string the second how many 0's up to the number of 1's) What would the recursive alogrithim have to look like inorder for me to create every possible string of n 1's and n 0's where there are never more 0's than 1's ?

    {color:#ff0000}Cross posted{color}
    {color:#000080}Including this post --{color}{color:#0000ff}
    http://forum.java.sun.com/thread.jspa?threadID=5223773
    http://forum.java.sun.com/thread.jspa?threadID=5223679
    http://forum.java.sun.com/thread.jspa?threadID=5223774{color}{color:000080}
    Cross posting is rude.
    {color}

  • CF10 is evaluating strings with comma's as complex types (Array), formerly they were just Strings

    Coldfusion 10's behaviour appears to have changed in the evaluation of strings with commas.
    Example:
    FORM.IDS = 123456, 654321, 789101  (Form Submission)
    <cfset fieldname="IDS" />
    <cfset test1 = FORM[fieldname] />
    <cfset test2 = evalute("FORM.#fieldname#") />
    In Coldfusion 9 the value of test1 and test2 is reported as "123456, 654321, 789101".
    In Coldfusion 10 the value of test1 and test2 is reported as an array. "Array (3)".
    Is this expected behaviour?  This is jacking up an application we are trying to upgrade and did not expect this one.  Any help will be much appreciated.
    Cheers
    Lee 

    ldavis101 wrote:
    Coldfusion 10's behaviour appears to have changed in the evaluation of strings with commas.
    Example:
    FORM.IDS = 123456, 654321, 789101  (Form Submission)
    <cfset fieldname="IDS" />
    <cfset test1 = FORM[fieldname] />
    <cfset test2 = evaluate("FORM.#fieldname#") /> [BKBK: typo corrected]
    In Coldfusion 9 the value of test1 and test2 is reported as "123456, 654321, 789101".
    In Coldfusion 10 the value of test1 and test2 is reported as an array. "Array (3)".
    Is this expected behaviour? 
    No, that is unexpected. Please report it as a bug.

  • Using "don't care" in digital state machine?

    Hi:
    I am trying to use the digital state machine component and received some advice from tech support about how to properly make a state.txt file.  However, the simulation of the state machine freezes when a "don't care" condition is encountered for any of the inputs.  Here is what my state.txt looks like: 
    I'm assuming that an "x" represents a "don't care".
    Any advice, comments, etc.  Would be greatly appreciated.
    Attachments:
    state-x.txt ‏1 KB

    The digital state machine is a XSPICE model and the 'don't care' condition is not supported by the XSPICE model engine.
    Tien P.
    National Instruments

  • I have just bought a new pc with windows 7 my old one can not be started so I can not deauthorise etc, how do I now put my iphone 4 on my new computer, I don't care about the songs I have those on external hard drive, but I don't want to loose my contact

    I have just bought a new pc with windows 7 my old computer cannot be started so I cannot deauthorise it etc, how do I now put my iphone 4 on my new computer, I don't care about the songs I have those on external hard drive, but I don't want to loose my contacts, calenders etc

    Terry,
    Plug your iPhone 5 into your Leopard Machine.
    Fire up iPhoto.
    The phone should become available in iPhoto, and then you can import the camera roll.
    -Alan.

  • Just about had it with Apple - they really don't care!

    I’ve got to say that I’m just about finished with Apple! For nearly two weeks now it has been virtually impossible for me to download apps onto my iPad 2 or iPhone 4S. The apps start downloading, get part way then stop and start downloading again. Eventually I get a message saying the app cannot be downloaded at the moment. On the very rare occasion (only 2 apps ou tof an attempted 12) when I can get an app to install, and iTunes tries to download it onto my computer, the same happens and I get an err 8008. I tried raising a support ticket with Apple, only for some support guy to not bother reading my message properly and ignore the fact that this is happening on 3 differen tdevices. I have spent over £1,200 pounds at the Apple store in less than amonth. The iPad and iPhone are being returned this week for a full refund – I’m getting Android devices! Apple don’t care as long as they’re getting the cash!

    A sales and marketing professor once said something very accurate about Apple - "Apple's innovation lies not within its technology, but the presentation and simplicity of its technology"
    Im sorry to burst your bubble, but Apple is in no way a revolutionary brand as far as technology goes. The technology they use has been around for years in PCs. The LG Prada beat the Iphone as far as touch screen phones go. 
    But Apple is a marketing genius because of the presentation of their product, and the simplicity of it

  • Mail Excel as attachment with input as binary string

    Hi Experts ,
    I want to design BAPI which will have one string as import parameter.
    I will get binary data in this string.
    Now i want to mail this binary data string as excel attachment.
    Anyody knows how to convert this binary string to internal table and then send this as attachment?
    Thanks & Regards ,
    JIgar.

    check these sample programs
    BCS_EXAMPLE*

  • 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

  • Conversion of Decimal to Binary String

    Hello Labview People:
    I'm rather new to Labview, so this may be a simple-minded question . . .
    I would like to take a numeric control and have the decimal input
    converted to a binary string of 8 bits. So, for example, if I were to
    put in the number '127', I would get out (on an indicator) the string:
    01111111
    The number '128' would show on the indicator as:
    10000000
    It seems to me that this should be simple, but somehow I cannot figure
    out how to do it. Must an array be built bit by bit to accomplish this?
    (I'm afraid I don't yet know how to build arrays.)
    Thanks in advance for any help you provide!
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    Or, you can go under the numeric function, and look for conversions, get
    decimal to byte array conversion.
    Then what you need to do is to get an array selection vi, and index to zero.
    I don't remember the exact name of the VI's because I don't have LabView
    here with me.
    Perhaps this complicates things
    Steven
    "Timo Miettunen" wrote in message
    news:[email protected]..
    > use format into string VI from string palette
    >
    > format string should be "%08b" for 8 bits, "%016b" for 16 bits etc.
    >
    > timo
    >
    > Ananda Dave wrote:
    > >
    > > Hello Labview People:
    > >
    > > I'm rather new to Labview, so this may be a simple-minded question . . .
    > >
    > > I would like to take a numeric control and have the decimal input
    > >
    converted to a binary string of 8 bits. So, for example, if I were to
    > > put in the number '127', I would get out (on an indicator) the string:
    > >
    > > 01111111
    > >
    > > The number '128' would show on the indicator as:
    > >
    > > 10000000
    > >
    > > It seems to me that this should be simple, but somehow I cannot figure
    > > out how to do it. Must an array be built bit by bit to accomplish this?
    > > (I'm afraid I don't yet know how to build arrays.)
    > >
    > > Thanks in advance for any help you provide!
    > >
    > > Sent via Deja.com http://www.deja.com/
    > > Before you buy.
    >
    > --
    > -------------------------------------------------
    > Timo Miettunen
    >
    > Fincitec Oy Production Department
    > e-mail: [email protected]
    > Address:
    > Lumikontie 2 Tel: +358-16-2151245
    > PO BOX 11 Fax: +358-16-221561
    > FIN-94600 KEMI Finland
    > -------------------------------------------------

  • Logic for correcting strings with different barckets

    can any one tell me the simple logic for correcting strings with different barckets
    suppose say for eg.
    (<{abc}>defgh) should evaluate to TRUE
    (<{abc>} should evaluate to FALSE
    Things to check is
    1. number of opening brace and closing brace
    2. Their position are correct or not
    If the above two conditions are met than it is TRUE else FALSE
    i guess string function with decode and lenght function or case should do but bit difficult to develop this logic in with sql
    Thanks,
    AAK

    Hi,
    Here is non REGEXP_REPLACE version ( Unfotunately dont have 10G to feel the power of REGEXP_REPLACE.
    SQL> ed
    Wrote file afiedt.buf
      1  SELECT DECODE(SUM(CASE
      2                    WHEN Left = '(' AND Right =')' THEN 0+Count_Bracket
      3                    WHEN Left = '<' AND Right ='>' THEN 0+Count_Bracket
      4                    WHEN Left = '{' AND Right ='}' THEN 0+Count_Bracket
      5                    WHEN Left = '[' AND Right =']' THEN 0+Count_Bracket
      6                    ELSE
      7                       1
      8                    END
      9                    )
    10         ,0,'Valid','Invalid')
    11  FROM
    12  (
    13     SELECT SUBSTR(str,(len+1 - level),1) Left, SUBSTR(str,(len + level),1) Right, MOD(LENGTH(str),2)
    14     FROM
    15     (
    16      SELECT
    17         REPLACE(translate('&exp','abcdefgh','        '),' ') str,
    18         LENGTH(REPLACE(translate('&exp','abcdefgh','        '),' '))/2 len
    19      FROM DUAL
    20    )
    21    CONNECT BY LEVEL <= LEN
    22* )
    SQL> /
    Enter value for exp: (<{abc>} )
    old  17:        REPLACE(translate('&exp','abcdefgh','        '),' ') str,
    new  17:        REPLACE(translate('(<{abc>} )','abcdefgh','        '),' ') str,
    Enter value for exp: (<{abc>} )
    old  18:        LENGTH(REPLACE(translate('&exp','abcdefgh','        '),' '))/2 len
    new  18:        LENGTH(REPLACE(translate('(<{abc>} )','abcdefgh','        '),' '))/2 len
    DECODE(
    Invalid
    SQL>
    SQL> /
    Enter value for exp: <{[()]}>
    old  17:        REPLACE(translate('&exp','abcdefgh','        '),' ') str,
    new  17:        REPLACE(translate('<{[()]}>','abcdefgh','        '),' ') str,
    Enter value for exp: <{[()]}>
    old  18:        LENGTH(REPLACE(translate('&exp','abcdefgh','        '),' '))/2 len
    new  18:        LENGTH(REPLACE(translate('<{[()]}>','abcdefgh','        '),' '))/2 len
    DECODE(
    Valid
    SQL>
    SQL> /
    Enter value for exp: ([{<>}])
    old  17:        REPLACE(translate('&exp','abcdefgh','        '),' ') str,
    new  17:        REPLACE(translate('([{<>}])','abcdefgh','        '),' ') str,
    Enter value for exp: ([{<>}])
    old  18:        LENGTH(REPLACE(translate('&exp','abcdefgh','        '),' '))/2 len
    new  18:        LENGTH(REPLACE(translate('([{<>}])','abcdefgh','        '),' '))/2 len
    DECODE(
    Valid
    SQL>
    SQL> /
    Enter value for exp: (<{abc}>defgh)
    old  17:        REPLACE(translate('&exp','abcdefgh','        '),' ') str,
    new  17:        REPLACE(translate('(<{abc}>defgh)','abcdefgh','        '),' ') str,
    Enter value for exp: (<{abc}>defgh)
    old  18:        LENGTH(REPLACE(translate('&exp','abcdefgh','        '),' '))/2 len
    new  18:        LENGTH(REPLACE(translate('(<{abc}>defgh)','abcdefgh','        '),' '))/2 len
    DECODE(
    Valid
    SQL> Note: Only thing needs to care is " translate('<{[()]}>','abcdefgh',' ') " if string has some additional characters please include here.
    Regards

  • Decoding binary strings from 10 bit A/D converter

    Hi all,
    I'm working on a project for school that requires me to take data from an A/D converter ( the A/D is on a Motorola HCS12 microcontroller) and send it to a PC running LABVIEW to decode the binary string into a numerical value.  The value will be plugged into an equation.  I planned on using the serial port on the PC for the comm port.  Are there any examples available or any advice to get me started in the right direction. 
    While I have programmed with LABVIEW in the past (academically) I am not proficient.  And this type of interfacing I have not done before, only GPIB.
    The A/D is 10 bit.  How quick LABVIEW decodes the binary string and returns a value is not important. 
    If any more info. is needed let me know.    

    Be confident. That should not be a big problem, since you'll get the help of the LV community
    The most difficult part will be to establish the communication with your micro-controler. But if you can do that with Windows hyperterminal, then you are nearly done ! There are examples of serial com in the examples shipped with LV.
    The string to decimal conversion will not be a problem, whatever the string format : the conversion is done using functions also shipped with LV.
    Hope to see you soon with more specific questions.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Scan arrays from binary string

    I have TCP connection that is sending a great number of fixed size arrays that I need to convert. Is there a simpler way to do that than the one I have attached?
    Attachments:
    Scan from binary string.vi ‏16 KB

    Sorry, I didn't write my question clear enough.
    I know how to do TCP data transfer. I also know how to unflatten the binary string back to data, but I was hoping there was a clearer way to do it than the way I suggested. For scalar values one can make a cluster containing the data in the binary string and only one "unflatten from string" is needed.
    However, if the binary string is composed of arrays (even though they are fixed in size) I need one unflatten string for each array. In my case I have many small arrays. The attached example with only three arrays was only to illustrate what I wanted to do.
    I have now found a way using a cluster of clusters. I don't know if this is the ideal way of doing this, but it works, and when enabling "view cluster as icon" I can make the code much more compact and easier to read
    Attachments:
    2012-07-04_120216.jpg ‏385 KB

  • Creating a string with hiearchical data

    This is being done in Crystal 8 will all updates applied.
    I have a database with records that are linked to a series of "folders" that are hierarchical in nature as shown below:
    Folder 1:
         Folder 1.1
              Folder 1.1.1
    Folder 2
        Folder 2.1
    All of the folders can have data records attached to them.
    The database represents the folder structure in a table with the following attributes:
    Folder ID   (integer)
    Folder Name (String)  (such as "Folder 1"
    Folder Parent ID (integer)
    (other non-related fields)
    If the folder is at the root level, then the value in Folder Parent ID is 0, otherwise, it is the Folder ID of the parent folder.
    I need to be able to create a string field that displays the path for any given folder that I can insert into a group header or footer, or into a report header if the report deals with records in a single folder.  Desired format for the  string is: 
    "Folder 1> Folder 1.1> Folder 1.1.1"
    I need to be able to display at least 6 levels of folder indentation.
    I have tried several ways to create a formula that will reliably produce the desired string, and can get close, but cannot completely address the problem.  My most successful approach was to put multiple instance of the table into the report and link the Folder Parent ID of one level to the Folder ID of the next level down and then use the data to build the string with a formula like this:
    Local StringVar Result := {portfolio_master.portfolio_name};
    local stringvar ExitLoop := "1" ;
    if  ExitLoop = "1" then
        Result := {portfolio_master_1.portfolio_name} + "> " + Result
    else
        ExitLoop := "0";
    if {portfolio_master_1.parent_id} NE 0 AND ExitLoop = "1" then  // NE replaces Crystal not equal symbol which will not show
        Result := {portfolio_master_2.portfolio_name} + "> " + Result
    else
        ExitLoop := "0";
    if {portfolio_master_2.parent_id} NE 0 and ExitLoop = "1" then
        Result := {portfolio_master_3.portfolio_name} + "> " + Result
    else
        ExitLoop := "0";
    if {portfolio_master_3.parent_id} NE 0 and ExitLoop = "1" then
        Result := {portfolio_master_4.portfolio_name} + "> " + Result
    else
        ExitLoop := "0";
    if {portfolio_master_4.parent_id} NE 0 and ExitLoop = "1" then
        Result := {portfolio_master_5.portfolio_name} + "> " + Result
    else
        ExitLoop := "0";
    Result;
    This formula works so long as the folder in question is exactly 5 levels deep.  Changing the nature of the links(inner join, left outer join etc.) between the instances of the table in the Database Expert changes the data that is visible, but I can't find a combination that will show ALL of the needed information for all of the folders. 
    I understand that this is a brute force approach, and that there must be a different way to skin the cat.  My preference would be to "walk the tree" with a loop structure, but I don't see any way to do the needed data look up within the loop.
    Any suggestions would be greatly appreciated!
    Thanks,
    L. Jasmann
    Edited by: ljasmann1 on Jun 23, 2010 9:09 PM
    Edited by: ljasmann1 on Jun 23, 2010 9:33 PM

    I have been working to adapt the code provided above to my application.  Although I have worked with Crystal for quite a while, this is the first time that I have attempted to use SQL in Crystal... and it is just not working.. probably because I am no doing something very basic.
    Here is  the code as currently set up in the SQL Formula Editor.  Only major difference from the code provided above is that the ID fields are integers instead of strings, and the field that I want to print out is a string field separate from the ID fields....  I have substituted the field names from the table I am referencing for the ones in the code above.  The table that I am using has been selected using the Database Expert.
    DECLARE @Value int, @pf int, @FolderPath VarChar(MAX)
    SET @Value = "portfolio_master"."portfolio_id"
    SELECT @pf = "portfolio_master"."parent_id" FROM portfolio_master WHERE "portfolio_master"."portfolio_id" = @Value
    SET @FolderPath = "portfolio_master"."portfolio_name"
    WHILE @pf <> 0
    BEGIN
    SET @Value = @pf
    SELECT @pf = "portfolio_master"."parent_id" FROM portfolio_master WHERE "portfolio_master"."portfolio_id" = @Value
    SET @FolderPath = "portfolio_master"."portfolio_name" + ' > ' + @FolderPath
    END
    SELECT @FolderPath AS FolderPath
    When I test the SQL statement it errors out on the very first statement (the DECLARE statement).  If I substitute a different statement in front of the DECLARE statement, it errors on that statement.
    Here is the error that I get back. The database is using MS SQL Server.
    Error in compiling SQL Expression:
    Failed to retrieve data from the database.
    Details:  ADO Error Code:  0x80040e14
    Source:  Microsoft OLE db Provider for SQL Server
    Description:  Incorrect syntax near the keyword u2018DECLAREu2019,
    SQL State:  42000
    Native Error:  156 [Database Vendor Code:  156].
    Any pointers would be greatly appreciated...
    Thanks,
    Larry Jasmann

  • How can I convert a U32 array into binary string?

    Hi
    I would like to find an efficient way to convert an array of 8192 U32 into a single binary string!!!
    the solution below  last 550 ms on an RT target to convert 8192 U32.
    The same code running on Labview (not RT) last 100ms. I don't understand why there is such a difference.
    I've tryed to replace the inner loop and convert by a format string whith U32 on entry and %032b as parameter but it lasted same time.
    Thanks a lot

    Your picture of your code didn't come through. You can't link to a picture that's on your computer, as a server on the internet cannot access your computer to display the picture for others to see. You have to upload the picture as an attachment. Then, if you want to actually display the picture in the message you have to edit your post, insert a picture, and when it asks for the URL you enter the URL of the picture. You can get the URL when viewing the message, as the link is within the message itself.
    As for your question, can you just use the TypeCast function?

  • How to avoid error message re: an exception that I don't care about

    I written a script that allows a user to click on a thumbnail image and then the script will change the html in order to play a particular video. It works, except that it throws some kind of error and I don' t know what it is. Since it works, I don't care what it is, but I would like to catch it. The popup error window says "An error occurred inside a plug-in contained on this page." Any ideas on what the error might be? Below is my code.
    <script type="text/javascript">
    function PlayVideo($Thumbnail)
    // Then there is a PHP section where I look up the video file, $VideoFile, in a database with $Thumbnail as my criteria. For now, I have a file hardcoded into the param.
    var $NEWhtml; // variable to build new script to swap with
    $NEWhtml ='<object id="MP4player" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="400" height="250" codebase="http://www.apple.com/qtactivex/qtplugin.cab">\n';
    $NEWhtml +='<param name="src" value="VideosApproved/Toad Singing.mp4">\n';+
    +$NEWhtml+ ='<param name="autoplay" value="true">\n';
    $NEWhtml +='<param name="loop" value="false" >\n';+
    +$NEWhtml+ ='<embed width="400" height="250" pluginspage="http://www.apple.com/quicktime/download/" type="video/quicktime" autoplay="true" controller="true"></embed>\n';
    $NEWhtml +='</object>\n';
    // REMOVE OLD ELEMENT
    var specialzone = document.getElementById('MP4section');
    var element = document.getElementById('MP4player');
    element.parentNode.removeChild(element);
    // ADD NEW ELEMENT
    var specialzone = document.getElementById('MP4section');
    var change = document.createElement('MP4player');
    change.innerHTML = $NEWhtml;
    specialzone.appendChild(change);
    return true;
    </script>

    This site supports java
    Java != javascript

Maybe you are looking for

  • Suddenly cannot bring up project

    When trying to open my current project, I get a red dot with X through it in lower left corner of JSC main window. Do not get anything else in the navigator, outline or properties windows. It seems I can create a new project OK, but the current one i

  • JCO_SYSTEM_FAILURE   and J2EE restart

    Hi All, We are currently encountering an issue with IDOC to HTTPS scenario that we we are working on. There are several RFC that are being performed in the mapping to retrieve information from R/3. The mapping has been tested sufficently with data fr

  • Can't drag anymore mp3 into ITunes version 11.1.138

    I now have ITunes Version 11.1.138 but I used to have an earlier version 8 before. At that time I was able to simply drag an mp3 (from whichever pc file)  into  Itunes which also inserted the same mp3 into my 160G Classic IPod. Now with ITunes Versio

  • Opening PDF files in Windows 8 software?

    Would like to know if anyone is having problems with opening pdf files on the new Windows 8? If so, have you found a way to resolve it?

  • "the device is not connected. Please connect your Zen MicroPhoto to your computer" ?

    Hi I have just bought it today, and the installation went thru without any trouble. Then when I connected my mp3 player as the book says I for one cant install it (since there's no driver for it) and when I look in the 'Zen MicroPhoto Media Explorer'