Updating a control array

Thats all great guys! Thanks a lot....
Just one last question... is it possible to update values held in a control
array whilst a program is executing (other than manually!!), by loading them
from a spreadsheet file?
Cheers for any advice (As you see, I'm quite new to all this!)
"Randy H" wrote in message
news:[email protected]..
> John,
>
> Sure. If the reading of the file is the first thing done in your
> program, then this will be an easy task. That is how LabVIEW loads. It
> stores a bunch of options in the LabVIEW.ini file. When LabVIEW first
> launches, it parses this file ans starts LabVIEW with the correct
> options. You would be doing something very similar.
> Also, the way you are
aproaching this is exactly what you would need
> to do if you build your VI into an executable. See
>
href="http://pong.ni.com/public.nsf/websearch/BCFF7D3335E256E286256509006772
3D?OpenDocument">this
> as an example.
>
> Randy Hsokin
> Applications Engineer
> National Instruments
> http://www.ni.com/ask

Yes you can. There's a couple of routes you can go.
1) LabVIEW has the function Read From Spreadsheet File in the File I/O palette. This will import a spreadsheet saved as comma or tab separated text data (not native Excel).
2) Use ActiveX to read an Excel file. There's a shipping example called Write Table to XL that demonstratesm how to write to rows and columns. I've attached an example that reads a single cell. It's an example that I downloaded from somewhere I don't remember. Search the forum for other examples.
3) Treat the spreadsheet as a database and use either NI database connectivity toolkit or LabSQL (http://jeffreytravis.com) to run SQL queries on it.
Once you've read the data, it's then a matter of copying to the control by means of
a local variable or property node.

Similar Messages

  • RA data only updated in Controlling Area currency..

    Hi Guys,
    When we run the Results Analysis for WBS Elements, we are getting the message " RA data only updated in Controlling Area Currency ".
    How can we make this message gone or why is the system updating only in CO Area Currency.
    Thanks
    Srik.

    Hi,
    The company code currency for this WBS is different from the Co Area Currency assigned in the Co Area definition.
    However still system is updating only in the Co Area Currency.
    Thanks,
    srik.

  • Problem in adding "TableLayoutPanel" control array type functionality on windows form dynamically using drag and drop

    Environment: -
     (Application Machine)
    OS Name             : -
    Microsoft Windows 7 Professional/XP SP2/SP3            
    OS Bit Version      : -
    32 Bit                     
    Application Name: - Designer.exe                                  
    IDE                  
        : - Visual Studio 2008                        
    EXE Application development: -
    VB. Net
    Application Type: -
    Application “Designer.exe” was designed in vb6.0 and now, it has been upgraded to Visual Studio 2008 and it works properly.
    Product Description: -
                 We have an application Designer.exe, which is used for designing “Forms”.
    It has menu option with following option like Panel, Text Box, Combo Box, Button etc. We drag any of this menu items and place it to form.
    Requirement: -
    We have
    critical requirement in product. In Designer.exe, we need to align form margin, while we increase or decrease window. And for that we have searched that 
     “TableLayoutPanel” components can be helpful.
    Problem description: -
    Earlier code was in vb6.0, now it has upgraded to Visual Studio 2008. In vb6.0, we have used control array for memory utilization with Combo Box, Group Box, and Text
    Box etc.
    But, for alignment we have to use “TableLayoutPanel”
    control array type functionality on form.
    Code Snippet: - For earlier designing component e.g. Frame
    'Required by the Windows Form Designer
    Public WithEvents Frame1 As Microsoft.VisualBasic.Compatibility.VB6.GroupBoxArray
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.components = New System.ComponentModel.Container
    Me.Frame1 = New Microsoft.VisualBasic.Compatibility.VB6.GroupBoxArray(Me.components)
    CType(Me.Frame1, System.ComponentModel.ISupportInitialize).BeginInit()
    . Kindly suggest approach for implementing requirement.
    Kindly help us to complete the requirement. I will be really
    thankful for any assistance.

    Hi S.P Singh,
    Welcome to MSDN.
    I am afraid that as Renee Culver said, these forums donot support VB6, you could refer to this thread:
    Where to post your VB 6 questions
    You could consider posting this issue in these forums below:
    These forums do not support Visual Basic 6, however there are many third-party support sites that do. If you have a VB6-related question please visit these popular forums:
    VB Forums
    VB City
    Thanks for your understanding.
    Best Regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Control array of callback functions?

    Apologies for my basic question.
    I am experimenting with control arrays and so far am able to collect data in string controls that are inside control arrays.  Works well.  Naturally, none of these controls need callback functions.
    Now I have need of some momentary command buttons in a control array as well.  So my question is, should I use a single callback function for all of the button controls in that single array?  And if so, how do I go about identifying which element in the control array called the function?  From reading on the forums, it seems as if use of the callback data parameter might get me there.
    Just wanted to ask before I get off track.  Thanks!
    Solved!
    Go to Solution.

    Yes, callbackData can be of help in such a situation, but if you can limit to switch on array index to discriminate what to do your button callback could be something on this line:
    int CVICALLBACK BtnAttayCallback (int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2)
    int handle, index;
    switch (event) {
    case EVENT_COMMIT:
    handle = GetCtrlArrayFromResourceID (panel, control);
    GetCtrlArrayIndex (handle, panel, control, &index);
    switch (index) {
    // Your code here
    return 0;
     (No CVI install here so I cannot test it: double check the code but it should reasonably work)
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Error to update  Grid Control 10.2.0.3 for 10.2.0.5

    Hi i'm receve this error to update gril control in new repository . first im install new database 11.1.0.7 and create a news database(install OMS together) . after i'm update install of grid control. i'm install a version 10.2.0.3 and make upgrade OMS for 10.2.0.5. In install agent i receve error in java.
    silentInstall2009-06-19_06-02-37AM.log
    Error finding file /u01/app/oracle/agent10g/sysman/config/emoms.properties
    Error finding file /u01/app/oracle/agent10g/sysman/config/emoms.properties
    String index out of range: -10
    An error occured while trying to execute command.
    The file /u01/app/oracle/agent10g/config/ias.properties cannot be found while looking for variable InfrastructureUse.
    At this time, the Oracle Application Server middle-tier will be shut down. There may be a brief pause in the installation while the middle-tier processes are stopped.
    "An error occured while trying to execute command."
    File not found: /u01/app/oracle/agent10g/Apache/modplsql/conf/dads.conf
    File not found: /u01/app/oracle/agent10g/Apache/modplsql/conf/cache.conf
    A runtime exception occurred during the execution of this action.
    A runtime exception occurred during the execution of this action.
    This silent installation was unsuccessful.

    Yes this is what I do, but still receive "Insufficient privileges to write to that location". So I am forced to use normal file system to be able to continue.
    After that I run into the current problem saying OMS configuration failed (see details....) and I try:
    ./opmnctl startall
    opmnctl: starting opmn and all managed processes...
    ================================================================================
    opmn id=uxlpgrid01:6200
    3 of 5 processes started.
    ias-instance id=EnterpriseManager0.uxlpgrid01
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ias-component/process-type/process-set:
    OC4J/home/default_island
    Error
    --> Process (pid=0)
    no port available from the port range
    failed to start a managed process after the maximum retry limit
    no port available from the port range
    no port available from the port range
    Log:
    none
    ias-component/process-type/process-set:
    OC4J/OC4J_EMPROV/default_island
    Error
    --> Process (pid=0)
    no port available from the port range
    failed to start a managed process after the maximum retry limit
    no port available from the port range
    no port available from the port range
    Log:
    none
    Then:
    ./opmnctl status
    Processes in Instance: EnterpriseManager0.uxlpgrid01
    ------------------------------------------------+---------
    ias-component | process-type | pid | status
    ------------------------------------------------+---------
    DSA | DSA | N/A | Down
    HTTP_Server | HTTP_Server | 23861 | Alive
    LogLoader | logloaderd | N/A | Down
    dcm-daemon | dcm-daemon | 27021 | Alive
    OC4J | home | N/A | Down
    OC4J | OC4J_EM | 10403 | Alive
    OC4J | OC4J_EMPROV | N/A | Down
    WebCache | WebCache | 23872 | Alive
    WebCache | WebCacheAdmin | 23863 | Alive
    Overwhelming :-(
    Thanks for helping
    Askia.

  • Control Array Access Problem while loading panel on 2 Tabs

    I am using LabWindows CVI 10.0. My intention is to programmatically disable a control array in a panel.
    Problem:
           I am loading a panel with control array in TabControl pages -  Tab0 and Tab1.
    Error occurs, While programmatically accessing through below functions.
    GetCtrlArrayFromResourceID( Tab0_panel, CTRLARRAY) -  Able to get resource ID.
    GetCtrlArrayFromResourceID( Tab1_panel, CTRLARRAY) - Not able to get resource ID.
    Its giving error as Resource ID not found in UIR.
    Error picture i have attached below for reference.
    Please give some suggestions.
    Solved!
    Go to Solution.
    Attachments:
    Error.PNG ‏7 KB

    Ok, if you didn't use it so far you should use it now  : If you are accessing controls on a tab panel you have to use the correct panel handle using the function GetPanelHandleFromTabPage, you can not simply use the constant defined in your UIR.
    Have a look at the example TabExample.cws for an example of this function.

  • How many ways can I update a control programmat​ically???

    1. local (or global) variables
    2. property nodes.
    3.
    I'd like to know if there are more possibilities especially when a control is used. we can always right a value into an indicator when an indicator is used.

    Ok, so the CLD could be a moving target. I posted these question in an email and now awaiting an answer.
    What are the criteria used to grade the CLD exam? What are the specific finding and recommendations used when determining a grade?
    In two instances of taking the CLD the graders comments are shown below.
    After a comparison of the two cases, here are my comments. “Property nodes and local variable are not to be used”. I’ve posted a question asking what other ways are there to programmatically update a control. “Unnecessary bends in wires are not to be used”. What criteria determine when a wire bend is unnecessary? Should all wires not have bends thus bends in wires are not allowed? “Errors not handled….error terminal on property node not wired”.  As I read the exam requirements, I did not come across a case to handle an error in any step. Simply connecting an error terminal and providing a case doesn’t handle errors. I’m almost certain my code in Case2 does not generate programmatic errors. “NOT gate used rather than inverted input where available”. Are you saying NOT gates are not be used, is there some advantage? Maybe I was able reuse duplicate code in Case2 and in one of the cases the NOT gate was appropriate since is read well on a block diagram and the change was effortless.
    Case1:
    Style: Overly complex solution. Property Nodes used to update values. Unnecessary bends in wires. Error terminals on property nodes unwired. Errors not handled.
    Functionality: Application not fully implemented. Logic of implementation is not correct. Boolean latch action is not implemented where necessary.
    Documentation:
    Case2:
    Style: VI is not modular – repeated code is not placed in SubVIs. Use of local or global variables. Unnecessary bends in wires. NOT gate used rather then inverted input where available. Errors not handled.
    Functionality: Application does not function as specified.
    I have no idea what NI is looking for as far as “Style”. Lets define this and have a point system in place for determining “Style”. What “Style” allocates 15 points in the CLD exam?

  • How to extract a cluster controls array in 8.2 PDA Module

    Hi Everyone,
    I'm in the process of porting an application from LV 8.2 to LV 8.2 PDA. The application relies
    heavily on using the controls[] property node which I just found out is not
    supported in LV 8.2 PDA. Does anyone know of any alternative method of
    extracting a cluster's controls array without using a property node?
    I've attached an example of the application.
    Thanks for your help,
    John.
    Attachments:
    Controls Property example.JPG ‏77 KB

    Hello Jon,
    Currently, there is now way to obtain a reference to a control inside a cluster in LV PDA. I have experimented a great deal with alternatives, but to no avail. However, I think you you may be able to accomplish the same behavior using just an unbundle, or just using explicit controls outside of a cluster. Hopefully we will have that functionality in a future version of LabVIEW PDA.
    Xaq

  • Control Array with 22 image controls

    Hello, I want to make an control array out of 22 image controls in Visual Basic language. I was struggling with different methods and am not sure how to proceed. The image controls are already on the form, just need the array to easily manipulate the properties of
    the controls in a control loop.
    Would any of this work? If not how would I make the statement?
    file: App.xaml.vb (phone app)
    NonInheritable Class App
        myimageArray()
    As Image Public Sub
    New()
            InitializeComponent()
            myimageArray =
    New Image() {Image1, Image2,}'And so on up to 22
        End Sub
    End Class
    Or simply This:
    InitializeComponent()
    Image [] myimageArray = new Image[22](); But in VB equivalent

    Thanks for the consideration. Anyway I wrote a statement that worked:
    Dim myImageArray() As Image = {clipView(), clipView1, clipView2, clipView3} 'on up to 22
    Probably other ways to do this but it works as intended for my phone app.
    If  I am in the wrong place, then
    1000 apologies.
    end if

  • Events in cwgraph Control array

    I have created a control array of cwgraph at run time.
    Now all the properties are accesible but I am unable to fire events (with index) on cwgraph....
    please help.

    When the sub for the event in a control array gets called it will get passed the index of the control for which it will be called.
    The simplest way to handle the events then is to use a case structure which selects off of the index parameter. The following example should illustrate this.
    Regards,
    -Amaury R.
    Attachments:
    control_array_events.zip ‏4 KB

  • Control Array or Dynamic Controls in adf

    Hi All,
    Is that possible to create control arrays or we can create dynamic controls in adf like .net. Please advice or share some sample code.
    Thanks,

    Thanks for your reply. Actually i want to create some buttons in runtime. means if i have 10 records in table i need 10 buttons on my page but they should share the same code by passing the index of control.
    Thanks

  • Updating with Host Arrays

    Hello,
    I would like to query the Oracle community about an item
    that is giving me some trouble.
    I am developping a real time data base for a utility and I
    have situation where I receive messages from the SCADA of which
    not all are included in the database (for example, the firmware
    of some SCADA components has not been programmed correctly and
    gives the wrong ID number); I have to update the data base and
    then resend to other process the messages I have received.
    Naturally I do not want to resend the messages that contain the
    wrong information, and as this is a real time data base, I try
    to use the fastest techniques available (to the best of my
    knowledge), in this case, host arrays.
    The trouble is, when updating with host arrays, if no data
    is found for a particular ID ( Error ORA-1403), oracle continues
    and follows on with the next item in the host array, which is
    great, but it does warn you (as far as I know), that that
    particulat member of the host array is not included in the data
    base.
    Is there any method with which I can find out which member
    (s) failed in the update? or which members succeded?
    Thanks!!!!
    null

    I found after testing that your response is correct.
    The database does not consider '0 rows updated' a true error condition, therefore sqlerrd[2] reports the number of rows that WERE updated,NOT the array offset of the row that did not get updated.
    Furthermore, through extensive testing, I have found that the behavior I was told to expect by Oracle is NOT how Oracle behaves. Specially, if I have 5 array items, and item 3 does not result in an update, sqlerrd[2] reports 4 - meaning 4 rows updated, not 2, meaning that the third array item failed to result in an update.
    If the first item does not result in an update, the second item results in an update, and the 3rd item results in an oracle error (field too large for instance),sqlerrd[2] does not return 2 as expected (indicating the error occured in array item 3) but instead returns a 1, indicating one row was updated before the error occurred.
    Test scenario as follows:
    for some table, col1 CHAR[10], col2 CHAR[3] with the following rows:
    200010, ABC
    200020, ABC
    200030, ABC
    200040, ABC
    200050, ABC
    The statement in the ProC code:
    UPDATE tablename SET col2 = :v1 where col1 = :v2;
    col1 array holds:
    200011
    200020
    200030
    200040
    200050
    col2 array holds:
    XYZ
    XYZ
    XYZZ <<< note field too long forcing Oracle error
    XYZ
    XYZ
    I would expect based on the documentation that sqlerrd[2] returns 2 (3rd array element results in Oracle error), but what happens instead is sqlerrd[2]
    returns 1 (indicating that one row was updated, col1=200020, before an error was encountered in 3rd element of array.
    If col2 array holds:
    XYZ
    XYZ
    XYZ
    XYZ
    XYZ
    I would expect based on the feedback in the TAR that sqlerrd[2] would return 0 indicating that the first array resulted in a 1403 - what I get is 4,
    indicating 4 rows were updated as a result of this array.

  • Control array in duplicate panels

    I have a panel containing tabs with control array created using CVI 2010 UIR.  When I load the panel twice and try to access the control array(using GetCtrlArrayfromResourceID) of a tab from the second panel, I am getting an error that 'Resource ID not found in UIR file'.  (Note: I have used the panel handle from GetPanelHandleFromTabPage). Does control arrays gets duplicated when the panel are duplicated as well?

    This issue was submitted under bug ID 364746. We It will be resolved in a future version of LabWindows/CVI. I apologize for the inconvenience.
    National Instruments
    Product Support Engineer

  • UIButton control array and getting action to fire

    I've got a screen with several buttons (like the Stocks App's time period buttons) I put them into a control array and can get them to draw just as I want to on a page.
    My problem is, I can't get any buttons in the control array to fire and call the action method for the button(s). The event doesn't get triggered. If I take the buttons out of the array, they'll fire fine, but I'm trying to write some compact code.
    Am I doing something wrong, or is this by design?
    Here's some code from my init:
    for (int i = 0; i < 7; i++)
    UIButton *actionButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
    actionButton.frame = CGRectMake(0.0, 0.0, 35, 20);
    [actionButton setBackgroundColor:[UIColor redColor]];
    [actionButton setAlpha:.05];
    [actionButton addTarget:self action:@selector(actionButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    [actionButton addTarget:self action:@selector(actionButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    [actionButton setEnabled:YES];
    [actionButtons addObject:actionButton];
    [actionButton release];
    }

    I see I didn't cut and paste in that last post very well. But I'm revisiting this issue and I'm still stuck!
    Let me restate my question:
    If I create UIButton on my UIView, I can set the action and tie it to a method, using code like this:
    [actionButton addTarget:self action:@selector(actionButtonAction:) forControlEvents:UIControlEventTouchUpInside]
    -Creating the UIButton - easy to do
    -Adding Action to the button - easy to do
    -Getting the method to trigger from an action on the button - easy to do.
    That's Great!
    I however, want to create an array of UIButtons:
    Creating the Array of UIButtons - easy to do
    Adding Actions to each button before I add it to the array - easy to do
    Getting the method to trigger from an action on the button in the array - *I'm lost!*
    The event just doesn't fire. Is it because the button is in an array? Help!

  • How to adjust a "control array" size

    I have a program that creates a digital PWM signal with variable duty cycle. The duty cycle changes every 50 ms, but the overall wave frequency stays at a frequency determined by the user. I have the VI attatched.
    My problem is this...I need to be able to control the overall cycle time. This means the size of my array of duty cycles needs to adjust based on the cycle time (i.e. a cycle time of 1 second would require 20 of the 50 ms slots, while a 1.3 second cycle would need 26).
    I currently have only 4 slots in my array, meaning the total cycle time is .2 s. I understand how to manually add and remove elements to the array, but I can't figure out how to add a control to it so that the array size changes automatically, allowing much quicker entry of data. As of now I can make it work, it just takes super long to add or delete array elements. The ideal situaton would have a constant control for cycle time divided by 50 that would change the array size.
    I can't find any info on this, and I think I even saw a post asking that this kind of feature be added. I'm relatively new to this program.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    var_duty_cycle.vi ‏25 KB

    Currently, your VI is a one-shot deal. What you need is a state machine that updates the pct duty cycle array control as a function of the frequency while the current I/O code is idle.
    I would use an array of clusters, where each cluster contains e.g. a sequence number, a duty cycle, and a string as element label. Show the scrollbar and set the size whenever the relevant inputs change. Do you want to reset the current setting when the number changes or do you want to retain the current settings as much as possible? You could just use the existing values, reshape to the larger or smaller size, and write it back to the control via a local variable. Set all elements  except the percent to disabled so they act as indicators and cannot be changed by the user.
    (You also need to program around it if the operator tries to manually add more elements. A better solution would be this idea, so vote for it .)
    Some more general comments bout your code:
    Why do you use extended precision floating point. All your waits are internally just integers. EXT makes no sense
    There is a primitive for 1/x. However, you could just do a 1000/x and eliminate the multiplication afterwards. SInce you are dealing with integers, you can even do the division using quotient&remainder. Depending on the allowed frequency range there are possibly no orange data needed at all.
    Make the diagram constant representation match the rest of the code.
    The pulses/50ms indicator belongs before the loop. No need to recalculate and refresh it over and over from the same input values.
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • Sent mail does not show up in Sent (airplane) mailbox

    My dad just got his first Mac. He depends on (massive amounts of) email for his work, and used Outlook on his old laptop. Switched to Mac and is using Mail.app now. All his old email is now imported (with O2M) and mostly looks fine. Except any email

  • Anyone Successfully Using iChat Today? (Fri, Jun23rd)

    Just checking to see if anyone is successfully getting an AV chat session going today. I usually connect with no problems, but since the past day or so, I haven't been able to connect with either any of my buddies (California/New York/Shanghai). Migh

  • Invoice Block - Price Variance (PP)

    Hi Folks, I have a question in Invoice block for Price variance (PP) I have maintained the following upper limits Absolute Check limit Value - 5 Percentage Check limit 5% I am creating PO for 1MT with a price of 4,720 INR, i have done GR Now Invoice

  • RDS for Quality Management in SAP

    What are the business process and process flow of RDS in QM. and what are the difference of RDS with standard SAP ? from where I can get documents of business process and process flow of RDS for QM ?

  • Can list value of size can be limit in designer?

    Can list value of size can be limit in designer? How to configurate it? Thanks