How to use integer in case structure on FPGA

Hi there,
I was trying to use a case structure on FPGA module. The input to case selector terminal could be arbitrary integer like 0x1EEE or 0x2000 or 0x3FFF. Since I cannot find integer-string conversion on FPGA, how can I do it? Thanks

Hello!
If you want to create a case structure to handle arbitrary integer values, you can always use the decimal representation of the hex value (i.e. instead of 0x00FF, use 255).  If you want to create cases for the hex values, you can right-click on the case structure, and choose Radix>>Hex.  You should notice that all cases are now preceded with an 'x' to denote hex values.  This will allow you to create cases called x00FF, which sounds like what you're looking for.
Cheers,
Matt Pollock
National Instruments

Similar Messages

  • How to run a numeric case structure

    How can i control the numeric case structure using prompt user as my numeric input?
    Message Edited by unknown\ on 07-12-2005 10:25 AM
    Attachments:
    Case Structure.vi ‏478 KB

    Maybe you want something like in the attached code sketch?
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Case_StructureMOD.vi ‏79 KB

  • HOW CAN I CHANGE MY CASE STRUCTURE ?

    I know that my case structure will bring in these results:
    SELECT
    DISTINCT CASE WHEN (V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 0 AND 30 THEN '1-30 DAYS LATE'
    WHEN(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 31 AND 60 THEN '31-60 DAYS LATE'
    WHEN(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 61 AND 90 THEN '61-90 DAYS LATE'
    WHEN(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 91 AND 9999 THEN '91 DAYS+ LATE'
    ELSE NULL
    END DAYS,
    NVL(LCL_PERM_NM,'UNKNOWN')TOR
    FROM NCOER_STATS_VIEW V, LCL_ER_TYPE L
    WHERE L.MIL_CD(+) = V.LCL_ER_TYPE_CD
    AND v.lcl_er_form_cd = '4'
    and NVL(v.lcl_omit_from_stats_ind,'N') <> 'Y'
    AND v.psc_cd = '&&psc'
    and V.lcl_er_recv_dt > ADD_MONTHS(V.ind_er_per_end_dt,3)
    and nvl(v.lcl_omit_from_stats_ind,'N') <> 'Y'
    and v.lcl_er_type_cd not in ('G','Y')
    AND v.lcl_er_recv_dt >= to_date('&&rec_orig_dt','MMYYYY')
    AND v.lcl_er_recv_dt <= LAST_DAY(to_date('&&rec_orig_dt','MMYYYY'))
    DAYS TOR
    1-30 DAYS LATE ANNUAL
    1-30 DAYS LATE CHANGE OF RATER
    1-30 DAYS LATE RELIEF FOR CAUSE/EER SPECL RPT
    31-60 DAYS LATE ANNUAL
    31-60 DAYS LATE CHANGE OF RATER
    61-90 DAYS LATE ANNUAL
    61-90 DAYS LATE CHANGE OF RATER
    91 DAYS+ LATE ANNUAL
    91 DAYS+ LATE CHANGE OF RATER
    However how do I change the query or case structure to count each record?
    I want a count for each line. Do I need a group by clause?

    You can use something like
    SELECT days, count(days) FROM
    SELECT
    DISTINCT CASE WHEN (V.LCL_ER_RECV_DT - ADD_MONTHS(
    GROUP BY days

  • How do I get a case structure's panel?

    I am trying to place a boolean indicator within a case structure via LabVIEW scripting and am not having any luck.
    I started with the following source code, which creates and populates a case structure from an array:
    https://decibel.ni.com/content/docs/DOC-22703
    So my code, rather than put an enum inside each case, creates some compound arithmetic and a mask for each case.  This is all working fine.  I now want to place boolean indicators on the front panel that correspond to each case, and this is where my problem is.  I can create the indicators, but when I look at the block diagram view, all of the indicators are located outside of the case structure, rather than the indicators being inside of each respective case.
    I think the reason is that a boolean indicator is created by passing a reference to the front panel.  But the problem with this is that the VI panel reference does not indicate that the boolean should be placed inside the case structure, just on the panel, so when you view in block diagram mode, it's just thrown the indicators all outside the case structure and wired them up via tunnels.  I am getting the panel reference by accessing the OwningVI field of my CaseSel object.  I feel like there must be some field I should be able to access that indicates to put the block-diagram boolean inside of the respective case structure, but I can't find it.
    I've attached a file with 3 pics in it.  One shows a pic of the code I'm using to create the indicators.  One shows the type of output I'm looking for.  One shows the type of output I'm getting.
    Solved!
    Go to Solution.
    Attachments:
    lv_case_struct.jpg ‏221 KB

    Before you connect the wire to the terminal, call the Move method on the indicator's terminal and use one of the case structure's Diagrams[] as the owner. This will move the terminal into the structure.
    Try to take over the world!

  • How can I make easier case structure? Or can it possible to have one Pause and reset button in same structure.??

    hello,
    I am tring to convert my main test vi in case structure so latter on i can make some changes in that for example i want creat one pause button and reset button in that.
    I am not so much familer with case structure i want your guidence that how can i make my vi in globle case stucture in that i m having case 1 ,case 2...
    i already tried for that but then i got confused.
    here i am attaching my .llb file in that aa.vi is my main testing vi.
    will you plese guide me so i can make confort vi in case structure.
    Or can it possible to have one pause button and one reset button in same stucture,so User can pause or reset execution at any time when they want.
    Thank you very much in advance.
    Attachments:
    aa.llb ‏3338 KB

    Hello,
    I have change my entire structure ,now is it possible to have pause and reset button.
    here i have attached my changed vi.
    if still any changes required then please suggest me.
    Thank you.
    Attachments:
    aa.vi ‏75 KB
    aa1.llb ‏3333 KB

  • How to use TDSCRNPOS in ITCPO structure for positioning the output screen?

    Hi Guys,
        I am having a requirement to display the form as pop up window.
        I think for that I have to use TDSCRNPOS from ITCPO structure.
        But I don't know how to use this option.
       <b>I need to display the print preview as pop up window</b>

    Hi,
    Please check out the below link.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/60b33a28-dca2-2d10-f3b2-d2096b460b1e&overridelayout=true
    Hope it suffice your requirement.
    Regards,
    AL

  • How to use decode or case function in this?

    Hi,
    I want to implement this condition in a query without using any user defined functions
    1.if (T_fees = 'ABC' then if (p_fees>0) then nvl(p_fees,0) else (p_fees + a_fees) else 0)
    2. if(g_fees <> (if t_fees = 'ABC' then if (p_fees>0) then nvl(p_fees,0) else (p_fees)
    else 0
    Is it possible to use any nested 'CASE' statement ?
    This is very urgent...
    Regards,
    Shilpa

    Hi,
    Is it possible to use any nested 'CASE' statement ?Yes it it possible.
    "afiedt.buf" 7 lines, 89 characters
      1  SELECT sysdate FROM DUAL
      2  WHERE 1 = (CASE WHEN 1=1  AND 2=2 THEN
      3             1
      4       ELSE
      5             2
      6*     END)
    SQL>/
    SYSDATE
    07-AUG-06
    1 row selected.
    "afiedt.buf" 11 lines, 139 characters
      1  SELECT sysdate FROM DUAL
      2  WHERE 1 = (CASE WHEN 1=1  AND 2=2 THEN
      3             CASE WHEN 3=3 AND 4=4 THEN
      4                     1
      5             ELSE
      6                     0
      7             END
      8       ELSE
      9             0
    10*     END)
    SQL>/
    SYSDATE
    07-AUG-06
    1 row selected.
    You can implement your logic.
    Regards

  • How to use integer as char

    Hi!
    I have an integer (5). And now i want to use it as char ('5').
    I have already tried (char)(5) but that returns me a strange char--char with unicode (5).
    How should i change the type of variable?
    Thanks

    The following might be logical (not practical).
    char c = ((Integer.toString(5)).toCharArray()[0]);

  • How to use REGEXP for case statement

    Hello everyone, I'm very new here and am struggling with a using REGEXP in a case statement, OK I am using the REGEXP to find all strings that match a specific format for a particular brand of product, for example serial numbers, and I need to be able to say something like [case when(xx.brandid) = '123' then if xx.serialnumber REGEXP_LIKE(xx.serialnumber,'[A-za-z][A-za-z][A-za-z]\d{5,}[A-za-z]$') then 'TRUE' else 'FALSE' end "TRUE/FALSE".]
    Help would be greatly appreciated with this as I feel like I'm going backwards trying to figure this out
    Thanks in advance for any assistance.

    Like this?
    case
       when xx.brandid = '123' and
            regexp_like(xx.serialnumber,'[A-za-z][A-za-z][A-za-z]\d{5,}[A-za-z]$') then
          'TRUE'
       else
          'FALSE'
    end

  • How to use integer constants in switch

    Hello!
    I try:
    Connection.m
    #define CHANNEL_A = 0x01;
    #define CHANNEL_B = 0x02;
    #define CHANNEL_C = 0x03;
    switch (channel){
    case CHANNEL_A:
    return 0;
    case CHANNEL_B:
    return 1;
    case CHANNEL_C:
    return 2;
    default:
    return -1;
    and get: "error: syntax error before '=' token" after "case CHANNEL_A:" string
    Then, I try:
    Connection.h
    extern const int CHANNEL_A;
    extern const int CHANNEL_B;
    extern const int CHANNEL_C;
    Connection.m
    const int CHANNEL_A = 0x01;
    const int CHANNEL_B = 0x02;
    const int CHANNEL_C = 0x03;
    switch (channel){
    case CHANNEL_A:
    return 0;
    case CHANNEL_B:
    return 1;
    case CHANNEL_C:
    return 2;
    default:
    return -1;
    and get: "case label does not reduce to an integer constant" after "case CHANNEL_A:" string

    Or try an enum
    enum CHANNELS {
    CHANNEL_A = 0x01
    CHANNEL_B = 0x02
    CHANNEL_C = 0x03
    enum CHANNELS channel;
    switch(channel) {
    case CHANNEL_A:
    ... do something ...
    break;
    case CHANNEL_B:
    ... do something ...
    break;
    case CHANNEL_C:
    ... do something ...
    break;
    #defines DO NOT HAVE EQUAL SIGNS! What C book are you reading?
    #define CHANNEL_A = 0x01;
    Associates "= 0x01" with the pre-processor macro CHANNEL_A. The pre-processor will substitute "= 0x01" everywhere it sees CHANNEL_A. So when you say
    case CHANNEL_A:
    the pre-processor replaces that with
    case = 0x01:
    and that is NOT correct case syntax, hence your compiler error.
    And *const int* is not a compile time constant, or at least not one that switch/case wants to see. *const int* is a variable that you promise will not change.

  • How do I select different graphs to show using case structure?

    Hello,
    I am working on a piece of code where I am getting  data from 6 different sources (reading temperature & pH on 6 different tanks)...  I am using
    1)  a case structure
    2) while loop
    3)  waveform chart
    Now, I want to have it so, the User selects which graph he wants to see (tank 1, tank 2, tank 3, etc...).  And then, program ONLY SHOWS the graph for THAT TANK...
    So I have an Event Structure with the "Tank #" control, which is supposed to change the graph that is on display.  However, right now, it is not working.
    Let's say I start the program..., then I click "Tank 1"...  it graphs Tank 1...  then I click "Tank 2"...  instead of COMPLETLY CHANGING the graph, it CONTINUES to graph the data from TANK 2 on the same graph.  I.E.:   it plots points  1 - 7  from TANK 1,  then plots points 8 - 15 from TANK 2,....  on the same Graph.
    I don't want that.  I want it to change the graph.   But if I put the graph in the Case Structure, it puts multiple graphs on the Front Panel...  How can I do it?
    NOTE:  Ignore case 3.   And each case should be corresponding to Tank #...
    Thank your for reading--
    Attachments:
    GraphProblem_NI forum.vi ‏3166 KB

    the easy answer is that you should clear your waveform graph before sending new data to it...
    It's as easy as writing an empty array to it's property node Value...
    But.. 
    you've got much... much more cleaning up to do.  Clearing the graph is just one thing.
    Your code is unreadable.  Why do you have 3 While Loops?
    What does the bottom one do?
    Why are you complicating things with cluster going into the queue?  An enumerator would do the same trick.
    Is this code going into a cRIO or cFieldpoint?  If not, what's up with using Shared Variables?  Are you planning to send data over the network?
    Debugging this code will become a nightmare.  Scalability will be worse..
    I would recommend refactoring the code while it is still manageable.

  • Pass the value of the current case in a case structure to a global variable for use in VIs.

    I have built a large queued state machine (>100 cases).  In each state, I run a VI that I have created.  These VIs are usually not very different from one another.  In many cases, I could simply use the same VI over and over again.  There is only one problem with that.  None of these VIs know which case to send the program to next.  I have to change the value of the "NEXT_CASE" constants in the VI and save it under a new name to be inserted into each new case.  Now my program consists of hundreds of VIs whose only difference is the value of their "NEXT_CASE" constants.  This causes all kind of headaches when I have to insert new cases into the state machine, and it is just too much for me to deal with.
    I need to be able to use a global variable to keep track of the current case within my VIs.  I could change it from a string to a number and add or subtract from it to determine which case the program should go to next.  Since I'm usually only skipping from one case to the next (or the previous) I could use the exact same VI in most cases.  Can anyone tell me how to create a global variable that contains the value of the case in my case structure that I could use within my VIs to keep track of the current case?  Let me know if you have any questions.

    Instead of defining the next state inside the subvi, why not do it in the main vi inside each state case?  An output from the subvi could be used with a case structure to determine the next state.  Sort of like, if the subvi returns 0 then next state is State3, else if the subvi returns 1 then next state is State4.
    Message Edited by tbob on 08-19-2005 03:15 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    NextState.PNG ‏5 KB

  • Is it possible to use the case structure in on board progamming

    Hi
    I want to load a certain value in a variable in on board programming based on the encoder. How to implement this in 7344.

    No, it is not possible to use the labVIEW case structure in an onboard program. However, it is possible to implement the functionality you need by using a label, a jump to label on condition function and two on board variables. What you need to do is read the value of your encoder into one of the variables, once this value is in there you will use some of the variable arithmetic functions to compare its value to a value you would load into the second on board variable (the most common way is to use the subtract variables function). The result of the last varible operation is the used inside the jump to label on condition fucntion to evaluate the condition and to jump or not jump back to the label dependding on the result. For a much clearer explanation of this functional
    ity as well as some example code, please refer to chapter 15 of the following manual:
    http://digital.ni.com/manuals.nsf/websearch/EB609F​9BA065EA7A86256D350060C9A0?OpenDocument&node=13210​0_US

  • How to implement index array inside case structure for searching a 3D array?

    Well I have a 3D array and I want to index certain elements from that array. And I have thought of one way of doing this is to have multiple index array functions on the block diagram to search the array simultaneously, but that would be messy. Or I could setup some kind of case structure and place each index array function into individual cases. I've tried the latter, but when I connect the 3D array to the case structure at the"?" it doesn't give me permission because it says I'm hooking up two different types of data. Case Structure is for T or F and 3D array is not a boolean.
    So how can I setup the Case Structure to work for a 3D array?

    A case structure's selection tunnel cannot accept an array.  What exactly are your search criteria?  It sounds like a few FOR loops will be needed.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can i set case structure always true on boolean impulse?

    Hello everyone! I need a little help. All i want is to set a condition when to acquire data from my acquisition board. I have a sinusoidal pulse and when value its near zero (between 0.5 and -0.5) i want to start to write data and also stop condition. How can i make my case structure to remain set to true until next condition? Thanks in advance!
    Attachments:
    Untitled.png ‏104 KB

    sdadasdas wrote:
    Thank you! I'm a beginner in labview and any advice is welcome!
    I highly recommend tutorials if you are really new.  Otherwise, just keep asking questions.  You'll figure it out soon enough.
    3 Hour Introduction
    6 Hour Introduction
    LabVEW Basics
    Self Paced training for students
    Self Paced training beginner to advanced, SSP Required
    LabVIEW Wiki on Training
    Learning NI
    Getting Started with NI Products
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for