How to create Type Def constants

I tried doing some searching but I just see stuff on enums vs rings.
I am trying to set up HW configuration. I have multiple boards I am talking to and would like to combine the IO into 4 arrays. DI, DO, AI, and AO. I can do this fine but I am worried if the designer decides to insert/change one IO point. (e.g. Board 1 slot 2 is an input and it is desired to change to an output). This would of course shift every point after that alteration by 1 and I would have to go through all of the code from the ground up an modify it. Instead it seems I should be able to create a I32 cons array that is a type def used through out the code that would look something like the following:
[i32 array]
0
1
2
15
3
4
5
6
16
7
8
The idea is that at initial design the array was likely 0,1,2,3,4,5,6 etc but since slot 2 was changed it ended up being 15 and I just have to shift the type def constant. I would then use the type def constant to map the data properly before it reaches any of the other code.
Am I missing something or is there no way to have constants update in this manner??? Only enums? that seems poor
Message Edited by CJasnoch on 03-26-2008 01:00 PM

falkpl wrote:
I usually simulate the CONST by using a vi that returns the constant.  An example is pi (YES I KNOW THIS IS ALREADY PROVIDED BY LV) place the double constant 3.14.....on the block diagram, and wire it to an indicator, select one terminal and wire it out.  Change the icon and your done.  This is different from the saved value typedef in one important way, the data can not be changed without opening the vi, which can be protected.  this can be used in conjunction with a typdef for complex data types.    An example of this is a version cluster, having a major, minor and revision integer inside of a cluster, typedef this and then make a vi called application version use the typdef for the constant on the diagram and the indicator out of the CONST Vi.  This is my prefered method to simulate a CONST in labview.  This is not as elegant as a preprocessor directive in C but it works nicely.
Paul
That's the way I do it, too.  This method, combined with blanking the B&W icon of the VI and drawing an icon that doesn't use all the space of the 256 color slot lets you create something effectively similar to the primitive constants NI has.
=============
XP SP2, LV 8.2
CLAD

Similar Messages

  • Cluster Typ-Def Constant Reset

    Hi all,
    Ahhhhhh....  I have a typ-def cluster array with many elements in each cluster.  I created a vi, in which I delcared a 20 elements with specified values (a vi that contain constant values).  I made a minor change in my typ-def, and all the values that I keyed in got reset.  How do I avoid that in the future?  Thx!
    Yik
    Kudos and Accepted as Solution are welcome!
    Solved!
    Go to Solution.

    Diane's suggestion is the only to solve your problem. Defaults values do not carry over from a typedef. The one thing you can do is save the defaults values you want in your typedef and recreate the constant. New constants created will pick up the current default values. However once you change the typedef all the constants you have will get reset.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How to create a dynamic constant?

    Hi everyone,
    I would like to create a dynamic constant similar to CATEGORY_dim or TIME_dim for the dimension AcctDetail, and then be able to link it to Script Logic in order to use it there. Does anyone know if this can be done?
    Thanks very much.

    Hi Bzaratev,
    No need to add a new dynamic constant. You can use dynamic script in the DM side like this,
    PROMPT(SELECTINPUT,,,,"CATEGORY,P_CC,TIME")
    You just directly wirte down the dimension name.
    For the standard usage, we use format %{XX}_DIM", XX is the dimension type.
    PROMPT(SELECTINPUT,,,,%CATEGORY_DIM%%ENTITY_DIM%%TIME_DIM%)
    So if you want to use AcctDetail, you can just write it PROMPT(SELECTINPUT,,,,"CATEGORY,P_CC,TIME,AcctDetail")
    Hope this helps.

  • How to create type pools

    Hi Experts,
    I have a query like can we create custom "type pools". if yes, then what are the steps to create it.
    Thank you in advance.
    Samad.

    hi..
    Pls check the f1 help in ur system.
    It gives u  simple examples. Anyway,
    Typepool falls under - Data types.
    Data Types
    You can define program-local data types in ABAP programs that can be used for typing or declaring additional data types and data objects according to validity and visibility.
    The corresponding statements are:
    1. TYPE-POOLS
    2.  TYPES
    3.  INCLUDE TYPE
    TYPE-POOLS
    Syntax
    TYPE-POOLS tpool.
    Effect
    Declaring global data types and constants from a type group.
    The TYPE-POOLS statement declares the data types and constants of type group tpool You can specify it in the global data declarations of an ABAP program or in the declaration section of a class or interface. The data types and constants of the type group are visible as of this statement in the current context.
    Notes
    If the declared type group tpool integrates a further type group with the TYPE-POOLS statement, its data types and constants are also declared.
    ,,Data types declared using type groups cover ABAP Dictionary data types of the same name.
    Example
    Declaration of the predefined type group abap. By referring to the table type abap_func_parmbind_tab from the type group abap, the system declares an internal table parameter_tab for the dynamic parameter transfer to function modules.
    TYPE-POOLS abap.
    DATA parameter_tab TYPE abap_func_parmbind_tab.
    regards,
    Padma
    Edited by: Padmashree RamMaghenthar on Oct 13, 2008 11:18 AM

  • How to create types of materialized views

    Hi
    Can you please tell me how to create vaious types of materialized view.Also please tell me differences among them.

    Oracle docs at tahiti.oracle.com contain exactly the info you need as said previous poster. You can look into SQL reference about MV create statement that contains a brief overview of all types as well as data warehousing guide which contains at least 4 chapters that are about MVs - Basic MV, Advanced MV, Basic query rewrite and Advanced query rewrite.
    Gints Plivna
    http://www.gplivna.eu

  • How to create Hi Def DVD?

    I'm using a Mac ProBook. I recently went on vacation and have video from a hi DEF camcorder as well as a GoPro. The video looks great on the high DEF TV direct from the camcorder or GoPro. I download the video to the Mac Pro book and edit it on I Movie. Everything looks good played back on the Mac Pro book screen. When I burn it to a DVD and play it back on high DEF TV quality is very poor. I am now using toast titanium 11 and even purchased the plug-in for Hi Def / Blu Ray and still the results are the same, poor quality. What am I doing wrong?

    DVD is standard def, period.  If you are using iMovie and burning to DVD, you are getting standard def video regardless of what the source video was. 
    To get high def video you need a BluRay burner and BluRay media.  They are not the same as DVD burners and DVD media.   The DVD drives in all Macs are DVD drives, not BluRay drives.  Macs have never come with BluRay drives.
    There may be some additional issues depending on the camcorder you are using, and the GoPro, and how you are using them in iMovie.  But the biggest factor is DVD vs. BluRay.

  • Create type on a path (circle)

    Does anyone knows how to create type on a path (circle) so the first line of text flows on the top and the second line on the bottom?
    Thanks!
    Wisine

    http://indesignsecrets.com/quickly-add-type-to-top-and-bottom-of-an-ellipse.php
    Bob

  • Type defs changes not reflected in block-diagram constants?

    I'm struggling with strict type-defs today.
    If I create a strict type-def, say of a cluster with an enum in it, and save it. Then create a block-diagram constant from the strict type-def in a blank vi. Then make changes to the strict type-def (say, add another item to the enum), the block-diagram constant ghosts out , as it should. If I then select "Apply changes" from the strict type-def menu, the ghosted block-diagram constant becomes un-ghosted, as it should. BUT, it hasn't update!? If I look for the new item in the enum, it isn't there!? I'm sure it should be, right?
    No changes that I'm making to my type-defs or strict type-defs are being reflected in my block-diagram constants (which are definitely still linked to the controls with "Auto-update from type-def" checked on). It does work for front panel controls and indicators though - just not block diagram constants.
    I'm using LabVIEW 8.5.1, Win XP Pro. Any ideas anyone?
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

    Solved. I think.
    I tried a range of type-defined controls, including an enum, a ring list, a cluster with an enum inside it, and a cluster with a ring list inside it.
    Changes to the enum items were reflected in all vi controls and block diagram constants.
    Changes to the ring list items were not reflected in the controls or block diagram constants.
    This snapshot shows the the last item available in each ring and enum list. Clearly the rings were not updated when the custom controls were. (Yes, I applied changes and saved too).
    Switching to strict type-defs only impacted  the front panel controls, as Ben highlighted, because this is GUI related. You can see from this second snapshot where all type-defs are now strict type-defs that all enums and rings updated to reflect all three items, but the block diagram rings are still out of date
    I expect somebody will tell me now that this is normal behaviour??? 
    Message Edited by Thoric on 09-10-2008 02:31 PM
    Thoric (CLA, CLED, CTD and LabVIEW Champion)
    Attachments:
    custom_control_test.jpg ‏53 KB
    custom_control_test_stricttd.jpg ‏54 KB

  • How do I make a Type Def an Enumerated type?

    Bare with me as this is my very first time using a Type Def
    I tried following the tutorial at http://zone.ni.com/devzone/cda/tut/p/id/5318
    The first one worked alright that was the Master Mode, but that was starting with a previously created control.
    My first attempt at creating a new control did not go so well, see my Sys1 control.
    How do I make the control an enumerated type so it names the cases for me when creating a new control? 
    Message Edited by RTSLVU on 04-21-2009 09:55 AM
    Attachments:
    Sys1.ctl ‏5 KB

    No one mentioned in this thread yet so I add...
    That if you do a right-click replace then naviagte to a enum, the new enum will retain all of values and you don't have to re-enter them.
    An extention of this idea is useful when creating an enum with a 100 values or more. Write code to populate a ring control with the required strings then after, dod the replac with thing.
    Sure has saved me a lot of work.
    Ben 
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to create a macro for a planning type in MC8b transaction

    Hi,
    I am presently working for a product allocation demand, which have a information structiure with characteristic and key field.
    the characteristic are production allocation quantity, incoming order quantity, and open order quantity.
    i have created a planning type in which the data updation takes from the excel file to the planning type in mc95.
    but i need to create a macro for this planning type .
    can any body give the details information how to create a Macro for a planning type.
    Thanks and regards
    GopalKrishna

    Dear Gopal
    May be the link would be helpful to you.
    [Planning Types and Macros|http://help.sap.com/saphelp_46c/helpdata/en/a5/631cc443a211d189410000e829fbbd/frameset.htm]
    Drill down the left tab once you opened the link, for more information.
    Thanks
    G. Lakshmipathi

  • How can I Change data in a type def control containing a Xcontrol with a local variable

    Hello
    I made a Xcontrol and I inserted this control in a type def.
    When I want to change the control's data with a local variable in a VI, the VI change nothing. The change of data isn't perform
    How can I correct this issue?
    Thanks for your help
    Solved!
    Go to Solution.

    Hello,
    What's your LabVIEW version ? Do you have a simple example program which demonstrates this behavior ?
    I found another discussions related to your issues with Xcontrols:
    updating type defs in Xcontrol Facade
    No Data Change event generated for a XControl in a Type Def
    XControl facede.vi 
    Hope this helps.
    Regards, 
    Steve M.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Vidéo-t'chats de l'été : présentations techniques et ingénieurs pour répondre à vos questions

  • How to create a account key for application type M ?

    Hi Guys,
    How to create a account key for application type M ? and link the same with
    Gl account.
    thanks.

    Hi
    Please create the account keys or transaction keys in
    SPRO-> IMG-> MM-> Purchasing-> Conditions-> Define Price Determination Process-> Define Transaction/Event Keys
    Thanks & Regards
    Kishore

  • How to create a  contract? ( Types: volume,time,quality contracts)

    Hi Gurus,
    How to create a  contract? ( Types: volume,time,quality contracts)
    Give the procedure to create above mentioned types of contract.
    Bye
    Narasimha Rao Gunda

    1.Access the transaction choosing one of the following navigation options:
    SAP ECC menu     Logistics  Materials Management  Purchasing   Outline Agreement  Contract  Create
    Transaction code     ME31K
    2.On the Create Contract: Initial Screen, enter the following values and choose Enter:
         Vendor               xxxx          
         Agreement type          MK          
         Agreement date          Todayu2019s date          
         Purchasing Organization          
         Purchasing Group          xxx          
         Plant               xxx     
    3.On the Create Contract: Header Data screen, in Validity End field, enter end date (e.g. two years in the future) of the contract and choose Enter.
    4.On the Create Contract: Item Overview  screen, enter the following values:
         Material                              
         Target Quantity      10000               
         Net price          xxxx usd per 100 PC          
         Plant          1000
    5.Remark: Delete any entry in the field storage location.
    6.Additional step:
    If you want to use the information of an existing info record mark the line of the agreement item (item 10) and go to Environment  Info record. On the Info record: General Data screen choose Conditions. On the screen Display Gross Price Condition (PB00): Condition Supplements you can see the value of the gross price (here: 1282.5 per 100 pieces.).
    7.Choose Save (Check if the automatic print function of the contract works).

  • How to create a line type in data dictionary

    How to create a line type in data dictionary?Please explain step by step?
    Thanks & Regads,
    Sairam

    Hi,
    the details abbout the line type.
    The line type of a table type can be defined by:
    o Specification of a type that already exists (data element,
    structure, table type, table, view) whose properties are then copie
    as properties of the defined table line.
    o Direct type input, where data type, number of positions, and, if
    required, decimal places, are entered directly.
    o Specification of a reference type.
    and SE11 and click on datatype and click on table type and enter the line type.
    Thanks
    Shiva

  • How to change the font color in a strict type def programatically

    Could someone suggest a way to change the font color of a string indicator in a strict type def cluster programmatically? The cluster contains a label that is color-coded to match the function of the data channel represented by that cluster.  The function of each channel is not predetermined, so the font color needs to be changed programmatically.  To represent all channels, I have arranged a large cluster that contains 100 instances of the control.  This makes it essential that the control be strictly type defined in order to change the layout of the clusters uniformly.
    Can anyone suggest either a method by which I can let the control remain a strict type def and change the font color, or a method by which I can programmatically change the control from a strict type def to a type def?  Currently, I am saving the control as a strict type def every time I make a change and then saving it again as a type def when I am ready to run the program.  This works fine, but just seems inelegant.  This color-coding is used throughout the program in various indicators, so a neat solution would be greatly appreciated.

    As mentioned in my Nugget on Type definitions you can create strict type-defs that contain type-defs.
    If you make your data definition a type and put that definition in a strict type-def (one of each flavor) you can use the appropraite strict type where each is required.
    Yes the data structure will have another level of nesting so if you are "too far gone" you may not like this idea.
    Otherwise you can write a VI that opens the typed-def and do a "save as..." and use it everytime you edit the type-def.
    I hope something helps!
    Ben
    Message Edited by Ben on 10-06-2008 10:26 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Strict_of_Typedefs.PNG ‏30 KB

Maybe you are looking for

  • Help my safari doesn't work

    Process:         Safari [1057] Path:            /Applications/Safari.app/Contents/MacOS/Safari Identifier:      com.apple.Safari Version:         7.0 (9537.71) Build Info:      WebBrowser-7537071000000000~3 Code Type:       X86-64 (Native) Parent Pro

  • HP Laserjet Pro Scan not correct

    Since a few days the scans are not scanning properly using the flatbed anymore. If I have a selection box over something that I want to scan, the result is shifted a bit. A part of the right side is cut off and shown on the left in the scanned image.

  • Where is the black background in Imovie 13?

    there use to be around 48 backgrounds in Imovie 11, now there are only 12. So the black background is missing and i use this one a lot..

  • Determination of Purchasing area ?

    Hi Folks What is determination of Purchasing Area ? Why it is need to determine and at which level ?

  • Web Gallery / Mobile Me - issues with IE 6?

    Hi, I have uploaded my latest set of photos on the web gallery. But when I want to see the web gallery with IE6, it says - "We recommend a newer browser" and it lists the three browsers - IE7, FF 1.5 or higher and safari 3.0 or higher. There is a but