LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help needed in creating Front End GUI

Before processing your array, go through the entire array of references and set the visibility of all of them to false.  Then you can set the visibility to true as you assign the names, ranges, and default values of each one as you use them just like you are doing now.   I set array wire to go through the For loop to guarantee that they all get set to invisible before the ones you use are assigned to visible.
0 Kudos
Message 11 of 29
(987 Views)

Thank you, Thank u very much sir..It would have taken me years to get solutions like this.. You are really a genious sir I had tried the logic you said it I was able to get rid of the excess controls I have . But I still have to set the default values to the controls taking the values from the spread sheet.

 

 

 

-Lucky.

0 Kudos
Message 12 of 29
(975 Views)

Originally when you mentioned default value, I was thinking you were just trying to set the initial value which is what you were already doing.  In general, I think the default value is useful only to have an initial value already set when you first start a VI and since you are programmatically defining your VI when it begins to run, that really doesn't matter.  The only other place where default value becomes useful is if a user right clicks on a control and uses Reinitialize to Default Value while it is running.  This is something I don't tend to do from a user standpoint.  I would prefer to handle that as part of the program architecture.

 

However, there is a way to set the default value of a control, but it is more complicated.  First, you need to have scripting which has just recently been made publically available.  See Here.  I've just started playing with scripting in just the last two days, so I am not an expert on it.  But it looks to be pretty cool and powerful.  Installing that exposes a Default Value property node for a control.  However, you can't set the default value of a control on a running VI.  The VI has to be in Edit mode.  So that means you would have to have a starter VI.  Have it run and open a copy of your current VI without running it.  Do the code you are doing now in but in the starter VI.  Since the current VI would still be in edit mode, then you could edit the default values.  As your starter VI finishes, it would invoke the Run method on your current VI and then end itself.

 

I don't have the time to try to work out an example on this, but hopefully my description, the link to scripting, and a good reading of LabVIEW help will get you through.

0 Kudos
Message 13 of 29
(970 Views)
Sir,
 
     Iam trying to integrate the GUI developed in to my main program.The vi is basically developed for CAN communication. Can you pls suggest me how to integrate the developed GUI in to the main program.


What actually we need to do is, we need to compare the received channels on the CAN Bus with the channels defined in the spread sheet. If the channel defined in the spread sheet is received, based on the group to which it belongs to, a control should be assigned to that channel ( from the GUI developed earlier) with the value received along with the channel. And proper care should be taken so that if a channel is received on the CAN Bus for the second time and a control is already assigned to that channel then no control should be assigned to it for the next time. But if the value is different from the value received for the first time, the value should be updated. 
 
           Rx.vi is my main program. Image file shows where we will receive the Channels and its corresponding values on the CAN Bus. 
 
-Lucky 
Download All
0 Kudos
Message 14 of 29
(957 Views)

Sir,

 

     Can you pls suggest me  the steps in integrating  the GUI in to my main vi. 

 

 

-Lucky. 

0 Kudos
Message 15 of 29
(950 Views)

I'm not sure how the two VI's are supposed to interact.

 

Is the data you are getting in the main VI with the CAN bus a list of channels and values you need to pass to the GUI VI?

Is the GUI VI supposed to be a set of controls or indicators?

 

I would pass data between VI's using shared variables.  Another good option would be a queue.

 

In the GUI VI, I'll assume you get a piece of data that is a channel name and a value.  Search your main array to find the matching channel name to get the Group name.  Once you know the group name, search the appropriate smaller array to get for the same channel name to get the index value.  Now that you have the index value, use that on the array of references to get a specific reference.  Write the value to that indicator.

 

I made some changes to your VI to show how a piece of data coming in as a channel name and a value can go into the appropriate control  (Indicator?) using some array searching code.  This is just a section of a flat sequence structure, but in reality would be a while loop that acts on each piece of data coming in.

 

If I was doing this, I would look at storing the control references and the lookup table of channels vs. controls in an action engine.  It would hide a lot of this code in a subVI.  The intial frame of the flat sequence would be a part of an initialization case of the action engine.

 

I think I would also do the array lookup a little differently.  Instead of having 4 separate sub arrays for each control, I would just add another column to the original array for index number.  It would get populated as each channel gets assigned to a particular control reference.  This would make some of the array searching easier as you would only have to search the larger array for the channel name and extract out the group and its index, rather than extracting out the group, and search the group's array to get the index.

 

 

0 Kudos
Message 16 of 29
(941 Views)

yes sir, the data Iam getting in the main Vi on the CAN Bus should be passed to this GUI VI.The GUI VI is supposed to be act as both Controls and Indicators.

 

-Lucky 

0 Kudos
Message 17 of 29
(914 Views)

Hello sir,


            In the same we created the GUI taking each element. When I took a array of knobs and created a property node I could see the visibiltiy option, but I couldnt see the scale range options. Can you pls let me know how to set the scale for each array of knob. (Some time's I should transmit a frame of data so I need to use arrays at that point.)

 

 

-Lucky

0 Kudos
Message 18 of 29
(899 Views)

There was a recent message thread on knobs within a 2-D array that should help you.

 

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=428136#M428136

0 Kudos
Message 19 of 29
(894 Views)

Sir, 

 

     Though it is too much too ask I dont have any other option sir. Pls help me for the last time in creating this GUI. Its really important for me.

 

Iam also trying to develope GUI to Transmit messages.

 

Each ID should be created with a numeric array control. We have a table of 4 columns in the spread sheet


1) ID
2) Name
3) Min value
4) Max value

 

            If a ID is repeated with different channel names say suppose a ID 2566 has four names, then its column size under node property should be set to 4. If it has total 10 different ID's then we should create 10 different arrays with the column size equal to number of times the ID is repeated. And the scale adjusted to the Max and Min values mentioned in the Min and Max tabs in the table (offcourse The array elements has the same scale).

 

After creating this individual arrrays with its respective properties.All arrays should be built together to make it as a 2- D array.Then a property node should be created to it to and set to " change all to read" thus when ever a value is increased or decreased in any array's element that particular element value is being transmited. Iam trying from past 5-6 hr's to seperate the ID's based on its repetation and to set its properties but I couldnt find any luck. Pls for the last time help me.

 

 

- Lucky

0 Kudos
Message 20 of 29
(881 Views)