How to set the value of a variable in a cluster in LabVIEW from C#?

Hi guys, I'm working on a small c# program, which using the interface provided by LabVIEW.  And I know that, using lv.SetControlValue(name, value) can set a variable just on the front panel. But in my case, there're several clusters on the front panel. So it confused me how to set the variables in these clusters. For example there's a cluster named clusterA, and a variable in it named valueA, I've tried something like this:
lv.SetControlValue("clusterA.valueA",1);
but it totally not work. Anyone has some experience about this stuff? Thanks a lot!!
Solved!
Go to Solution.

Hey guys, thanks a lot for all your reply. I just find a simply way to solve this porblem. For example, there a cluster named "ClusterA", and there are only two control values in it, which are: an int value named "IntA" (default value IntA = 10)and a  string value named "StringA" (default value StringA = "abc"). In C# if you invoke the method:
var clusterA = (Array) vi.GetControlValue("ClusterA");
you will get an Array looks like: clusterA = {10, "abc"}; Then if you want to change IntA to 123, you just need to do:
clusterA.SetValue(123, 0); // 123 is the value, 0 is the index of IntA in the array clusterA, after this clusterA = {123, "abc"}
After this, you just need to give the array back to LabVIEW by using:
vi.SetControlValue("ClusterA", clusterA);
and now see the panel in you LabVIEW, the IntA is changed.

Similar Messages

  • How to set the value of process variables/payload using a managed bean?

    Hello,
    Someone can give me an example about how to set the values of a process payload in a managed bean?
    thank you!

    Try this:
    jsf page:
    <af:selectOneChoice label="Select Suburb"
    requiredMessageDetail="Select a suburb"
    valueChangeListener="#{selectOneChoiceBean.onValueChanged}"
    validator="#{selectOneChoiceBean.validate}"
    unselectedLabel="None" autoSubmit="true"
    binding="#{selectOneChoiceBean.selectOneChoice}"
    value="#{selectOneChoiceBean.value}">
    <f:selectItems value="#{selectOneChoiceBean.selectionList}"/>
    </af:selectOneChoice>
    backing bean:
    public class SelectChoiceBean {
    private List<SelectItem> selectionList;
    private String value = "B";
    private RichSelectOneChoice selectOneChoice;
    public SelectChoiceBean() {
    initSelectionList();
    public void setSelectionList(List<SelectItem> selectionList) {
    this.selectionList = selectionList;
    public List<SelectItem> getSelectionList() {
    return selectionList;
    public void onValueChanged(ValueChangeEvent valueChangeEvent) {
    System.out.println(valueChangeEvent.getNewValue());
    // Add event code here...
    public void validate(FacesContext facesContext, UIComponent uIComponent,
    Object object) {
    // Add event code here...
    private void initSelectionList() {
    selectionList = new ArrayList<SelectItem>();
    selectionList.add(new SelectItem("A", "A label"));
    selectionList.add(new SelectItem("B", "B label"));
    selectionList.add(new SelectItem("C", "C label"));
    public void setValue(String value) {
    this.value = value;
    public String getValue() {
    return value;
    public void setSelectOneChoice(RichSelectOneChoice selectOneChoice) {
    this.selectOneChoice = selectOneChoice;
    public RichSelectOneChoice getSelectOneChoice() {
    return selectOneChoice;
    }

  • Scope issue: Trying to set the value of a variable in a calling (upper) script from a called (lower) script

    Hi,
    I have a basic scope question . I have two .ksh scripts. One calls the other.
    I have a variable I define in script_one.ksh called var1.
    I set it equal to 1. so export var1=1
    I then call script_two,ksh from script_one.ksh.  In script_two.ksh I set the value of var1 to 2 . so var1=2.
    I return to script_one.ksh and echo out var1 and it still is equal to 1.
    How can I change the value of var1 in script_two.ksh to 2 and have that change reflected in script_one.ksh when I echo var1 out after returning from script_two.ksh.
    I've remember seeing this I just can't remember how to do it.
    Thanks in advance.

    Unfortunately Unix or Linux does not have a concept of dynamic system kernel or global variables.
    Environment variables can be exported from a parent to a child processes, similar to copying, but a child process cannot change the shell environment of its parent process.
    However, there are a few ways you could use: You can source execute the scripts, using the Bash source command or by typing . space filename. When source executing a script, the content of the script are run in the current shell, similar to typing the commands at the command prompt.
    Use shell functions instead of forking shell scripts.
    Store the output of a script into a variable. For instance:
    #test1.sh
    var=goodbye
    echo $var
    #test2.sh
    var=hello
    echo $var
    var=`./test1.sh`
    echo $var
    $ ./test2.sh
    hello
    goodbye

  • How to get the value of a variable defined in javascript in JSP

    how to get the value of a variable defined in javascript in/through JSP????

    In Javascript you can use the DOM to access the input element and set it's value before submitting the form. Then it's value will just be passed.

  • How to find the value of a variable in other program

    How to find the value of a variable in other program say I am in a FM and this FM is being called in from other program and I want to know some of the variable details of the program from the FM itself. Imagine if this is a txn. and I need to know the details from some of the programs while executing the same transaction
    Regards
    Vin

    Hi Vinayak,
         you will be having your first program values in internal table or some variables,
        when you are calling the second program you wii use like this,
        SUBMIT <Second Program Name> USING SELECTION-SCREEN '1000'
                           WITH s_emp(second program select-options)   IN t_emp(first program variables)
                           WITH p_chk   EQ t_chk
                           WITH p_r1    EQ t_r1
                           WITH p_month EQ t_month
                           WITH s_cust1 IN t_cust1
                           WITH p_r2    EQ t_r2
                           WITH s_cust2 IN t_cust2
                           WITH s_week  IN t_week
                           AND RETURN.
    you have pas like this to get your first program details.

  • How to get the value of a variable in FOX?

    Hi,
    In the FOX program how to get the value of a variable defined in planning area?
    can anyone give me some sample code?
    thanks

    Adding to the last reply,
    you can use VARI(variable) to get the count of the values.
    In the latest version of BPS, you may also use the following new foreach construct:
    FOREACH var IN VARIABLE  variable_id.
    Regards - Ravi

  • How to set the value of something in a component from the main application?

    Hi,
    Maybe I've been working on this too long, but I can't figure
    out how to set the value of the text property of a text input field
    in a component from my main application in an mx:Script block. I
    have a component called Login in the components folder, and I need
    to set the text value of empNum. In my mxml declaration at that the
    top, I've declared these components as xmlns:c="components.*" So
    logically, the property I'm trying to set is c.Login.empNum.text. I
    can't figure out the correct syntax to get this to work, and I've
    tried everything I can think of. Does anyone have any suggestions?
    I'm thinking this should be an easy one, and I'm just missing
    something.
    Thanks!
    Holli

    Did you try giving it an id ?
    <c:MyLogin id="loginScreen" /c>
    So later you can do loginScreen .empNum.text = "my text"
    Laurent,

  • How to set the value in SelectOneChoice

    Hi,
    I need an help....
    can anyone please tell me how to set the value in SelectOneChoice.
    I want to set the value at index 3
    i am trying selectOneChoice1.setvalue(new Integer(3)); but it is throwing an NullPointerException.
    Thanks,
    Neha

    Hi,
    is it ADF bound? If so then you set the default value to the list binding in the PageDef file. The value of the component must be bound to a method expression, which is why you see an exception. However, I think we need more information
    Frank

  • HOW to set the value attribute of FORM INPUT data to a variable in a JSP

    eg. Registration.jsp
    The data is accessed from an hidden field called course
    for example, if I have "Java programming" in the field course, and I use
    an expression to access the value from the hidden field.
    **My problem is that the data gets truncated to "Java" , I need "Java Programming"to display. The code looks like this
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <INPUT TYPE="text" SIZE=12 NAME="course"
    VALUE=<%=getParameter("course") %>
    IS there ANY OTHER WAY to set the value of VALUE to a variable?

    Instead of value=<%=request.getParameter("course")%>
    Use double codes
    value="<%=request.getParameter("course")%>"

  • How to set Dynamic value to context variable

    hi all
    Can anyone suggest me how to change value of context variable.
    In short i need to set dynamic value to context variable
    here is my code in web.xml
    *<context-param>*
    *<param-name>sessionTimeOutValue</param-name>*
    *<param-value>200</param-value>*
    *</context-param>*

    ChintanPatel wrote:
    here is my code in web.xml
    *<context-param>*
    *<param-name>sessionTimeOutValue</param-name>*
    *<param-value>200</param-value>*
    *</context-param>*You can set the session time using httpsession.setmaxinactiveinterval

  • How to change the value of a variable in new ABAP debugger.

    Hi Guys,
                 I can't change the value of a variable in the new ABAP debugger.. when I change its revert back to old value. but this is not the case with the old version. How to do this..
    Cheers
    Senthil

    Hi,
    1. Dobule click in the variable in the variable tab.
    2. Click the Change icon in Detail.Dis.
    3. enter the new value and press enter
    Refer
    [http://www.sapdb.info/new-abap-debugger/|http://www.sapdb.info/new-abap-debugger/]
    [http://help.sap.com/saphelp_nw70/helpdata/en/84/1f624f4505144199e3d570cf7a9225/content.htm|http://help.sap.com/saphelp_nw70/helpdata/en/84/1f624f4505144199e3d570cf7a9225/content.htm]
    <removed_by_moderator_together_with_points>
    Regards,
    SB
    Edited by: Julius Bussche on Jun 24, 2008 8:21 AM

  • How to set the value for Power Cost in SCCM reports in Euro's?

    Hello,
    I have found out how to change the value of the 'cost' of the KWh for these reports (reporting) . But ther original settings where displayed and set in USD($) with some other values. I have of course changed the USD to EUR (€) in my case, but my question
    is: how do i know what I have to fill in in the field : costOfKwh, according my manager for my organisation it is in euro's 5,9 euroct/Kwh
    Do I have to fill in 5,9 or 0,59 or 0,059 ???
    Then also ther are some other values set in the original reports, like :
    KwhConsumptionDesktopComputerOn value = 0,07
    KwhConsumptionLaptopComputerOn  value = 0,02
    KwhConsumptionDesktopMonitorOn    value = 0,03
    Do i have to leave this settings ?

    Yes, I know this is an old post, I’m just trying to clean them up.
    The default of 0.09 is 9 cents/ KwH so  I’m assume that 5.9 cent (euro) so that you bet 0.059
    BTW if you have edit the report to change $ to € then you can also set eh default value to whatever the current power cost is too.
    http://www.enhansoft.com/

  • How to set the Value in Dropdownbyindex

    Hi Experts,
    I am New to Webdynpro-ABAP.
    I have one Dropdownbyindex field. I need to set the value from BAPI. how to set that values in Dropdown..
             I need Basic step-by-step procedure.
    Regards,
    P.Manivannan

    Hi,
    1. First import the BAPI in to WD component using create->service call.
    2.The BAPI import, export and Table parameters will be set in to the Component Controller context.Then drag this BAPI node to your view.
    3.In the 'texts' property of DDbyindex bind the BAPI output node which will be the Table parameter of the BAPI.It could be under CHANGING node.
    4.In WDDOINIT method just click the code wizard and enter the method name which you will give when importing the BAPI.Automatically the values from the BAPI will be loaded into your Dropdown when you run the application.
    Regards,
    Dinesh

  • How to set the value in the xml node.

    Hi
    I am having the application PDF which can be submitted by user using the button. while submitting 
    i am using below code to set the value in the xml node.
       xfa.data.assignnode("employee.id","123",0):
    So its generating the xml like below.
    <employee>.
    <id>123</id>.
    </name>
    </employee>
    Now i need to generate the xml like  below.
    <employee id= "123" >
      </Name>
    </employee>
    So how to set/create the id node like above?
    Advance Thanks.
    Regards,
    Dhiyane

    Hi Dhiyane,
    You will have to set the contains property if the id node to "metaData", that is;
    xfa.data.assignNode("employee.id","123",0);
    xfa.data.employee.id.contains = "metaData";
    Very clumsy if you have a number of them, in which case you might want to look at using E4X.
    Good luck
    Bruce

  • How to set the value of application item using pl/sql in application process

    Hi guys,
    I want a global variable (application item) whose value will be set at the start when a user logs in to the application. The value will be retrieved from database using a sql query. I do not know the exact syntax to set the value of application item in application process. Also i want to know in which type of application process should i use to set the value of application item when a user starts a session. The value of application item varies from user to user.
    Please help.
    I am using apex 4.2
    Regards,
    Waqas

    You can use the application item as bind-variable with its name. ie. your application item is named G_MY_APPLICATION_ITEM, then you can access/set it using :G_MY_APPLICATION_ITEM.
    For example
    BEGIN
        -- assign like a variable
        :G_MY_APPLICATION_ITEM := 'LARRY';
        -- use in a SQL statement
        SELECT WHATEVER_COLUMN
          INTO :G_MY_APPLICATION_ITEM
          FROM MY_TABLE
         WHERE USERNAME = :APP_USER
    END;
    Peter

Maybe you are looking for

  • Regarding Adding multiple SAP Scripts in one Transaction

    Hi All, I have a requirement where i will have to develop one custom transaction which will have multiple SAP Script Forms to it. The scenario is as below: First i will have to create a Program with Selection-Screen with 10 Radio buttons in one Block

  • How do I change my default email to something other than Mail?

    Whenever I try to use the "contact us" button on websites, Mail pops up but I want to use another email provider. Anyone know how to set my other emails as the default?

  • 10.2.1.2102 - UNHAPPY USER !!!

    I have downloaded and installed it........ BUT since then the battery lasst half the time it did before, and my contacts are just ONE BIG MESS !!!!! Emoticons in text messages just shows as a '?' I am so unhappy that i am ready to ditch the phone ...

  • "Approver Not Found"

    Hi all, In purchasing, though i am able to get the approval done for Standard Purchase Order and Requisition through the respective hierarchy, I am unable to do so the same for Blanket and Planned Purchase Order. Further, The Hierarchy as define in H

  • If I already bought an app do I have to pay again to gift it?

    I Bought minecraft, and I have a friend who only has the lite version. Do I have to pay for the app again to gift it to him?