Programmatically controlling strings in typedef enum

Hi there,
on an user interface I want to offer a typedef enum as a pulldown menu to select plugins that are dynamically loaded from a subdirectory. Whenever a new plugin is copied into this directory, the enum menu shall be updated automatically. Yes, I have already searched the forum and found an older thread where they write that enums cannot be altered programmatically. Isn't there really any workaround?
See the attached example vi. I want to use the enum instead of a ring menu because with the typedef enum the case structures are automatically extended if the enum itself grows.
Any hint on how to program such "auto update features" most elegantly?
Thanks,
Peter
Attachments:
autoupdate_of_enum2.zip ‏20 KB

Hi Peter,
i think it is not possible in this way. Who should insert the new function into your case structure?
Use a combobox/ring and an event strucure. If the user change the value of the combobox/ring, build the path to the selected vi.
See the attached example.
Mike
Message Edited by MikeS81 on 06-02-2008 02:03 PM
Attachments:
main_LV80.vi ‏16 KB

Similar Messages

  • Programmatically controlling NI-1407 standard video types

    Is it possible to programmatically control the standard video type on a NI-1407 Frame Grabber. For example, switch between RS-170 and CCIR within LabView code. (I know this is a simple chore if you utilize MAX)

    J Mazzetta,
    The information for the current camera type in contained in a text file in the IMAQ/data folder. You can parse this file and change the text string identifying the camera file. Here is a link to a KB on our website with an example to do this:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/ccc5bb5990aa416786256c23006e687c?OpenDocument
    Best Regards,
    Chris D
    NI Applications Engineer

  • Ring -- typedef enum

    Hi all!
       after years of inactivity on this board.... here I come again!
       I have some "typedef enum", and I'd like to tie them at develop time to Ring controls.  Is it possible?
       Thanks!
    Graziano

    Graziano:
    Welcome back!
    Do you mean that you want to assign enum values to your ring items?
    You can do that if you build the list for your ring in code, not in the UI editor.  In the UI editor, just put down an empty ring, then in your code, before you display the panel, build the ring list using InsertListItem(), specifying an enum as the value.  An enum is basically an int, which is the default data type for items in a ring control.  See the CVI Help topic titled Programming with ring controls for more details.

  • I have a Text control string box with some initial text. I would like to highlight old text with click of mouse and type in new data from keyboard

    I have a text control string box with some initial text (says: Please enter Name). I would like the operator to click on the text control box and have it automatically highlight so that when new data is typed in the old erases (all at once) and the new data is now in the text box.
    I tried using the "Text.Selection" property node and when I run it and put the mouse inside the text box the initial text is highlighted and if I press "delete" on the keyboard or if I start to type in new data the initial data does delete but once I start to type new characters they erase each other. For example if I want to type in “Willi
    am” I type the “W” and then the “I” but the “I” erases the “W” and now I am only left with an “I” in the text box and so on. I appreciate any help

    It seems you are continuously setting the property node over and over again. This should only happen once if you mouse over it.
    Create a property node for your text control with the following three items:
    (1) KeyFocus (wire a "true" constant to it)
    (2) Text.SelStart (Wire a "zero" constant to it)
    (3) Text.SelEnd (Wire a constant containing the string length of the text).
    Put this property node inside an event structure, triggered by "Mouse enter" on the string control.
    (see if the attached example works for you)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Enter_Name.vi ‏23 KB

  • Set cursor in Control String component

    Hello:
    I would like to set cursor in "Control String" automatically when I open my VI. If I open my VI, cursor should be seen automatically in the text field of "Control String". The user hasn`t set cursor by mouse into this field. Has anybody an idea how can I do?
    Thanks!

    Create a property node for the control on your block diagram and set the Key Focus property value to TRUE.
    http://zone.ni.com/reference/en-XX/help/371361H-01​/lvprop/ctrl_key_focus/
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Can I programmatically control an xbox 360 console from a PC using a USB cable?

    I have an application that may require LabVIEW, some software normally associated with LabVIEW or both...
    I would like to be able to programmatically control an Xbox 360, via a PC, and through the use of a USB cable connecting both. I have setup a separate Xbox 360 console as a "dedicated server" for my gaming clan. I would like to be able to have the PC issue scripted commands according to a schedule, that will cause the console to power up, start the specific game (disk in the machine already), and then proceed through a number of Xbox 360 controller button actuations to cause the game to essentially be ready to play.
    If possible, I would like to find software that I could install on my PC (currently run with a Windows XP SP2 OS, but I have access to many versions of Windows and also Linux and soon, Solaris Unix).
    I have tried using various Infrared devices that connect to and are controlled by my PC, but none so far have allowed the infrared signals to work once the game is launched (apparently, only controller signals generated through a USB cable or through RF from a wireless Xbox 360 remote work once the game is launched - and that probably because the IR signals are meant to control the console as a media device).
    I would appreciate any direction that you 'all could offer. Thanks in advance!

    Thanks for your replies everyone, and thanks to NI for this great forum!
    The last solution appears to be pretty close to what I'd like to do. If I understand you Robert, I would attach a DAQ to my PC via USB and would control that device via software, then the DAQ connects to a digital output controlled relay (looks multiple wires, and screw-on connections) and then there would be separate wires connecting 'channels' (my term) from the relay to individual button wires inside of the gaming controller? The signals coming from the controller following this would therefore appear as normal.
    If this is correct, could you suggest any specific devices for this? I see that NI makes several USB DAQ's includng the USB-6501, 6008, and 6009. I also have seen many digital output controlled relays available from different vendors. I could use some assistance with the finer points for choosing the correct ones to purchase.
    In case it makes any difference although the controller has analog functions my requirements are for only the digital buttons only as I would simply be proceeding through the Console's menu (left, right, up, down, enter/select, etc.), launching the game, and then within the game continuing to choose among the game's menu items, ultimately according to a script. So, I don't see any need to be able to actuate either of the 'sticks' which are analog in nature.
    Thanks!

  • Programmatic controls appearing at different times

    Here's a weird one. I'm playing around with programmatic controls (as opposed to those created and connected in IB), and in my viewDidLoad function, I create a textbox and button as below.
    I animate into this view using a spin motion, based on the sample utility template, that all works great.
    The weird part is that the text box is visible during the spin, and the button doesn't appear until just after the spin is complete.
    Is there something different about those controls, or am I forgetting an important property of the button that affects when it becomes visible?
    Thanks in advance for any thoughts...
    -(void)viewDidLoad
    [super viewDidLoad];
    CGRect frame = CGRectMake(20.0, 68.0, 280.0, 31.0);
    UITextField *aTextField = [[UITextField alloc] initWithFrame:frame];
    aTextField.textAlignment = UITextAlignmentCenter;
    aTextField.borderStyle = UITextBorderStyleRoundedRect;
    aTextField.autocapitalizationType = UITextAutocapitalizationTypeWords;
    aTextField.keyboardType = UIKeyboardTypeNamePhonePad;
    aTextField.returnKeyType = UIReturnKeyDone;
    [self.view addSubview:aTextField];
    CGRect frame2 = CGRectMake(20.0, 100.0, 100.0, 31.0);
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn.frame = frame2;
    [self.view addSubview:btn];

    I pasted your code into FlipsideViewController.m and it seems to work fine. I can't reproduce the delayed visibility you reported. Are you seeing this behavior on both the Simulator and the Device? Is your code in that same file? What changes have you made to the template, especially RootViewController.m?

  • Programmatically obtain disabled items within Enum, Array, etc.

    Hi,
    I am attempting to obtain the disabled state of every control and indicator and save this to a configuration file for a specific VI; which includes a broad range of arrays, strings, booleans, enums, etc. For simple objects, such as a string, that only have a single value this is easy using property nodes like this:
    For more complex objects, such as an enum, that have multiple values the above method only works for the enum object itself not the items within. If a property node is created for one of these more complex objects there is a property called "DisabledItems[]" which is not available using the Ctl property node (I assume because not all controls and indicators have multiple items). I would like this function to be compatible with all VIs so manually creating property nodes for the more complex objects is out of the question.
    Does anyone know how to generically and programmatically obtain the disabled items of one of these more complex objects? The same goes for arrays, clusters, rings, etc. 
    Thanks for any help,
    Aric
    Solved!
    Go to Solution.

    You can use the Class Name or Class ID property to find out what kind of control it is then use the To More Specific Class to cast the RefNum to the correct class.  You then have access to the properties you're interested in.
    Kelly Bersch
    Certified LabVIEW Developer
    Kudos are always welcome

  • Just checking on another odd feature: Typedef enum Property Node "Value" not reflecting changes in the Typedef?

    Just encountered this odd behavior in LV 2011 which I reduced to the following example:
    - create a new VI and drop an enum control on te FP.
    - make this control a typedef and open the corresponding typedef
    - create a "case 1" item and a "case 2" item
    - save the typedef (I used the name Typedef Control 1) and CLOSE it (this is to allow updating of the original control).
    - drop a case structure on the diagram and connect the enum to it:
    So far so good. Now create a "Value" Property node for the enum and use it instead of the terminal:
    If I now go back to the typedef and add a "case 3" item, save the typedef and close it, the control is updated, but the Property node is not.
    How do I know that? For one, the Case Structure contextual menu does not offer to create a case for every value. Also, if I add a "case 3" case manually, it turns red.
    Luckily, the magic Ctrl-R key stroke actually does solve this problem.
    Tested in LV 2011.

    By Ctrl-R trick do you simply mean running the VI?  That is one way to force a recompile, but if you hold down Ctrl while pressing the run button you can recompile without running.  This should not be "dangerous" in any situation.
    As you have drawn your example, I see no reason not to use a local in that situation (ok, maybe for vanity).  Still, I view the behavior you describe as a bug, and it should certainly be fixed for the benefit of local haters out there.  You have to be a little careful where you draw the line between what gets handled in real time and what gets handled only at compile time.

  • How to control string by program in multicolumn listbox (color, justify, style, size).

    It necessary because the dimension of the multicolumn listbox change when the program running and all cells must have the same apearance
    Thank you very much beforehand for your answer.
    Warmly,
    Alain Carbonnel

    I don't think it is currently possible to do this programmatically. You loose the ability to control the text properties of a string programmatically when you put it in any kind of array.

  • Scripting Crash- "Create from Data Type" on Typedef Enum

    I just encountered a crash that I can duplicate in both LabVIEW 2013 and 2012 (student).
    Attached is a project that contains the code I used on 2012. Run the target VI.
    (I can get the project I had in 2013, if needed, sometime next week)
    Basic steps:
    Create a type def enum
    Place it on a VI
    Use scripting to get ahold of the Control Terminal and get the data type
    "Create from Data Type"

    Haha, I saved your code and ran it while I still had another project open... didn't really think that one through. Thank you, Auto-save.
    So it looks like the crash happens at the Create node. I can get rid of the crash by removing the Type Def link from the enum.
    I'm not at all an expert in scripting and have only used it a few times. Could a workaround be to get a reference to all of the Controls on the FP and copy the Control with the same Label "Enum" (instead of loading the terminal and creaing a new terminal)? Maybe creating a typedef by data type is what's causing the crash, but copying an already existing control will work.

  • Need a way to send a command control string to printer.

    I am trying to print a USPS intelligent barcode (IBC) on a postcard size bill. The post card is approxiamtely 70 characters in width and 2-up. The command string that needs to be sent to the printer to print the IBC is 27 characters in length. The remaining data (data that actually needs to be barcoded) is 33 characters making the strin a total of 60 characters. My problem and questions is "How do I define a print field that will hold all 60 characters and allow me control over the area/position where the barcode is printed?". The IBC print position must conform to USPS Template Standards. Could someone please help me with this?

    Hi,
    Java card does not support string and char types. if you want to send string/chars for example 'Hello World' to the card and store them then you need to convert them into hex format and then send the converted hex string to the card.
    The command APDU will be then,
    CLA  --- Your class byte, can be 80
    INS  --- Your Ins byte, can be 01
    P1   --- Parameter P1 can be 00
    P2   --- Parameter P2 can be 00
    LC   --- Length of Hello World hex string (0B)
    Data --- Hellow World Hex String (48656c6c6f20576f726c64)
    Le -- 00

  • Is there programmatic control over Java control panels

    We have users who may not be able to (or we may not want them to) change their JRE settings.
    Anyone know if there is a way to deselect the browser JRE option in each version of the Java control panel? We'd like to do it programmatically.

    jcrofts wrote:
    Hi,
    I've attached a 1TB drive to my APE which I've split into two partitions. I want to use one for Time Machine backups
    As DaddPaycheck says, that's not supported. See Using Time Machine with a USB drive connected to an Airport Extreme *User Tip,* also at the top of this forum.
    and the other for user data
    That's unsupported, too. From http://support.apple.com/kb/HT2426
    +*The AirPort Extreme (802.11n) works with disks that have a single partition . . .+*
    As with Time Machine backups, it often works anyway (I have several partitions on my AirDisk), but is "iffy" at the least.

  • Programmatically changing string text color in an array of string indicators

    Hi,
    I have an array of string indicators and I'm trying to format certain values different colors.  While I'm able to do this on a single string indicator I can't figure out how to handle the indexing of the array.  I have seen several examples with array of clusters but I am unable to translate to array of string indicators.
    Any help would be appreciated.
    Regards,
    ShotSimon
    Attachments:
    Changing text color in an array of string controls.vi ‏9 KB

    Instead of a string array, where all elements have the same format, you should use a table, which basically behaves as a 2D string array. But there, you can adjust all text attributes (if you are using LV 8.x). See this thread
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Changing tab control strings

    I found that if I modify the TEST_UUTS string in ModelStrings.ini, I can change the text displayed in my entry point button.
    [MODEL]
    TEST_UUTS = "ATE TEST"
    SINGLE_PASS= "DEBUG"
    Similarly, I made changes to UIControlOperatorInterfaceStrings.ini to change what shows up in the tabs for my Top-Level VI in the TestStand 3.5 Operator Interface.
    [TSUI_OI_MAIN_PANEL]
    EXECUTION = "Test Execution"
    SEQUENCE_FILE = "Test Sequence"
    Now for my questions - one specific, one general
    1) If I add a page (tab) to my tab control (say Quick  BIT), I was told I could just create a contant in CustomStrings.ini and TestStand would grab the text out of that file.
    [TSUI_OI_MAIN_PANEL]
    QUICK_BIT = "Quick BIT"
    How/where does it do that?  I assume this constant (QUICK_BIT) would have to be unique and it would have to be specified in one of the properties dialog boxes somewhere?
    2) In general, where does TestStand use these contants (say, for example, the one for TEST_UUTS)?

    Hi,
    You have to call the TestStand - localize Front Panel.vi, which is found in the TestStand Palette in your LabVIEW. You need to provide the Engine reference which you can obtain from IAppllicationMgr.GetEngine and also a string containing the section name found in your CustomStrings.ini
    Regards
    Ray Farmer
    Regards
    Ray Farmer

Maybe you are looking for

  • ActiveDocument indesign version (cs4 or cs5.5)

    Hi how can we get whether the active document is cs4 or cs5.5. I need to remove pasteboard items. But i have 2 different codes for indesign cs4 and cs5.5. Please help. Thanks, Sangeetha M

  • Installed Blu-Ray burner in Mac Pro. Vista Bootcamp compatible?

    I have a Mac compatible blu-ray burner in my Mac Pro. Will Bootcamp transfer the necessary driver for it to work in Windows Vista or Windows 7? Anybody else have a Blu-ray burner in their Mac Pro's?

  • Negative Posting - Billing Document

    Hello, May I kow the use of 'Negative Posting' field in billing document. In which way this would be useful. Thanks in advance.

  • Testing executable Jar file on different OS

    I wrote a very simple Java program that counts cards. I know it works on Windows and I assumed that because it is written in Java that it will work on any operating system. However my friend said he ran it on a Mac and it bombed out. So I would like

  • Problem: Multiple albums created

    I don't know if any of you are having the same issue, but I am noticing that multiple albums are being created in iTunes 7. For example, I have 10 songs that were all downloaded from the same album in iTunes.... They are all tagged correctly as the s