How to display updated values in an array of clusters?
Hi all!
I am designing and coding a LabView application. In one of the modal dialog boxes of the application, I have to dynamically create an array of a cluster in the front panel. The array of the cluster is one dimensional. The number of rows of the array control containing the clusters is dynamic, depending on the user input. I have selected number of rows of the array as 4 in the test vi. The number of columns is fixed to 1.
The cluster comprises of two elements - a numeric indicator labeled "Machine #" and a radio button control with three choices. The three choices are "Pump", "Compressor", and "Fan". I am assigning a machine number to the numeric indicator in the cluster during initialization of the screen. Similarly, I am assigning a default selection - "Compressor", among the three choices of the radio buttons of the cluster. This is done for each element of the array.
As far as I can figure out, I am assigning these values correctly. However, I am unable to see the changes on the front panel in the values of the elements within the cluster during the run time. What am I doing wrong? How can I solve this problem?
I am uploading the test vi that I have written till now. Any help is much appreciated. Thanks a lot in advance.
Sincerely,
Aninda
Hi!
Maybe, I forgot to attach the VI in my previous posting. Here it is.
Sincerely,
Aninda
Attachments:
SetupScrn2.vi 59 KB
Similar Messages
-
How to get updated value at run time in oracle forms
How to get updated value form oracle database on a field in oracle forms 6.0 at run time if the same form is opened by multiple users and both have get the same maximum value if one commit the record then how other would get that maximum value with out exiting that form...
This issue is fairly common and Forms handles the situation by displaying the error, "Record has been updated by another user. Requery to see changes." if a user tries to update a record that was updated by another user.
If your data is in a base table block, you can check before you save by checking the value in the form against the database using the Get_Item_Property('<BLOCK.ITEM>',DATABASE_VALUE). You can compare the value returned by the built-in against the value in the field to see if they have changed. This could be a lot of work and a lot of network traffic if you are checking numerous items in your data block. Forms has a standard locking mechanism that will lock the queried record as soon as a user makes any changes. If another user queries and attempts to change the record locked by another user - they will receive a "Record Locked" message.
Francois brings up a valid point. Perhaps you should review the link Francios provided as well as this one: How to ask questions the smart way
It is always a good idea to review your thread before you post it and ask yourself, "Could I answer this question given the information I've provided and the way I've asked the question?"
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
How to display the value of a column in a chart at the top of each column
How to display the value of each column in a chart at the top of each column?
Like this?
Done using chart Inspector.
For details, see Chapter 7, Creating Charts from Numerical Data in the Numbers '09 User Guide. The guide may be downloaded via the Help menu in Numbers.
Regards,
Barry -
How to display 7 values of single field in row wise.
hi,
how to display 7 values of single field in row wise.
thankx in advance.hi ,
do it like this :
1 Place ur UI element in tranparent container with Layout as Row Data and Layout Data as Row Head Data
2 Ur first UI , which contains the first value as Row Head Data ,
3 Others as Row Data
u can do it with Matrix Data as well
if u want to give space , u can use HORIZONTAL GUTTER and set its width to medium / large / Xlarge
also there is a UI element "INVISIBLE ELEMENT" ,
1 u can use this UI element to provide space between ur other UI elements in the view
2 u can insert a text element as well , and in the Text property of the element press ALT + 0160.
u can give the space bw UIs as desired.
regards,
amit -
How to display filter values in analyzer
Hi expert,
I want to add filter into analyzer, above data table, I insert a few rows, and add text to hold filters, but after quit from design mode, inserted rows for filters dispear, and its spaces are taken by data table. could you please tell how to display filter values .
Many Thanks,It is looking like you are saving them as workbooks. It will be possible to maintain fliters if you save with the filters given by workbook properties, not by manual feeding.
let us know with clear expectation if you are not clear with it. -
How to display negative values in a screen field of a screen
Hi All,
Please let me know how to display negative values in a screen field of a screen.
thanksHi Kishore,
You can do this method. In the screen , create a text field of CHAR instead fo creating an INT4 field.
I have created a field of CHAR of name say TEXT.
In the main program,
declare a variable of the same name ie. TEXT.
data: TEXT(5) TYPE C.
In PBO, just assign the negative values.
It will work.Since there is automatic conversion between character and integer data types, it will work for positive values as well.
Regards,
Sylendra. -
Setting Values in an Array of Clusters via COM
Hello everybody,
I need some help concerning LabView and COM (ActiveX).
I'm working on NT 4.0 with LabView 5.1 and I've written a COM-Client in Visual
C++ 6.0 which controls LabView.
I can set the values of normal Controls, Arrays and Clusters.
But I'm not able to set values for an array of clusters.
Does anybody know how to do this ?
Or is it impossible ?
Many thanks in advance,
Ralf Erdmann>> I need some help concerning LabView and COM (ActiveX).>> I'm working on
NT 4.0 with LabView 5.1 and I've written a COM-Client in Visual>> C++ 6.0
which controls LabView.>> I can set the values of normal Controls, Arrays
and Clusters.>> But I'm not able to set values for an array of clusters.>>
Does anybody know how to do this ?>> Or is it impossible ?>> >>With no more
information, the my answer is, I'm not sure. It is generally>possible to
set controls by constructing a matching Variant. Make the>array a safe-array,
the cluster a safe-array, and the elements of the>cluster be variants of
compatible types to what is in the array.>>If you can't get it to work from
this, you may want to include the>LV datatype in an email and contact support.>>
Please allow
me to get more precise.
For my testings I used a cluster with just one element (type double)
in an one-dim array with just this cluster as only element.
A LV-Cluster is represented as an array of variants in COM.
So I have an array of arrays. With an array beeing no datatype
I don't know how to put an array into an array to
construct a variant to pass to LV.
How can I solve this?
Thanks for help.
Ralf Erdmann -
Using DMA to update values in an array
Good afternoon,
I've been running into a few problems with my vi, and I'd like to give a bit of the background information before I ask my questions. I'm using Labview 8.5 and the NI USB-6009 DAQ. I want to use an encoder to control values that are being written to a file for DMA. I found that I couldn't use the encoder as an external clock since the 6009 DAQ doesn't have this capability. So I've been trying to go a differenet route by using a case structure with a True/false statement to allow me to input values from a simulated signal into a write vi (each time the encoder pulses, a value from the simulated signal should be inputed into the write data storage vi). From there, I want to then read those values and put them into an array. So the plan is to have a 10 element array that reads in values from the storage file (just like in FIFO for FPGA). As I continue reading values, the oldest value of the 10 element array will leave the array and be replaced by a new value.
Now here come the questions, I'm using the Write/Read data storage vi's and I keep getting errors. First, if I'm wanting to use DMA to read these values am I using the correct vi's, or is there a different route? Also, once I read these values into the array how would I be able to constantly update the array in a descending order from begining to end of the stored values?
I'm posting my most recent vi that I've been editing. Also, in advance, thank you!
-tjm
Attachments:
Using Encoder as an analog input 10_9_13 - Copy - Copy.vi 390 KBThank you for your reply.
First, I'm ultimately trying to use the array as input into a visual display for a meter (to display the mean of the array). I've been successful (in the past) with inputting into an array by not using DMA and using the Sort 1D Array point by point vi. The only problem is the timing mechanism with the encoder, and you are correct with stating that there is uncertainty with the encoder when trying to retrieve values from the input signal (sine wave). I thought about going down the route of using the encoder as a counter (since I am able to see the counter increase by a single digit with each pulse).
My question would then be how to control the case structure with a counter input?
I'm posting both my setup with the Sort 1D Array Point by Point and the simple vi for the encoder as a counter. My idea is to try to merge the two and have the counter control the case structure.
Is there a way I can do this?
Attachments:
Sort 1D Array Pt by Pt.vi 189 KB
Using Encoder as a counter input 10_9_13.vi 123 KB -
My situation is that I have an array of clusters on the front panel. Each element is used for a particular test setup, so if the array size is three, it means we have three identical test setups that can be used. The cluster contains two string controls and a button: 'device ID' string, 'start' button and 'status' string.
In order to keep the diagrams simple, I would like to use a reference to the array as input into a subvi. This subvi will then modify a particular element in the array (i.e. set the 'status' string).
The first problem I encounter is that I can not select an array element to write to by using the reference. I have tried setting the 'Selection s
tart[]' and 'Selection size[]' properties and then querying the 'Array element' to get the proper element.
If I do this, the VI always seems to write to the element which the user has selected (i.e. the element that contains the cursor) instead of the one I am trying to select. I also have not found any other possible use for the 'Selection' properties, so I wonder if I am doing something wrong.
Of course I can use the 'value' property to get all elements, and then use the replace array element with an index value, but this defeats the purpose of leaving all other elements untouched.
I had hoped to use this method specifically to avoid overwriting other array elements (such as happens with the replace array element) because the user might be modifying the second array element while I want to modify the first.
My current solution is to split the array into two arrays: one control and one indicator (I guess that's really how it should be done ;-) but I'd still like to know ho
w to change a single element in an array without affecting the others by using a reference in case I can use it elsewhere.> My situation is that I have an array of clusters on the front panel.
> Each element is used for a particular test setup, so if the array size
> is three, it means we have three identical test setups that can be
> used. The cluster contains two string controls and a button: 'device
> ID' string, 'start' button and 'status' string.
>
> In order to keep the diagrams simple, I would like to use a reference
> to the array as input into a subvi. This subvi will then modify a
> particular element in the array (i.e. set the 'status' string).
>
It isn't possible to get a reference to a particular element within an
array. There is only one reference to the one control that represents
all elements in the array.
While it may seem better to use references to update
an element within
an array, it shouldn't really be necessary, and it can also lead to
race conditions. If you write to an element that has the
possibility of the user changing, whether you write with a local, a
reference, or any other means, there is a race condition between the
diagram and the user. LV will help with this to a certain extent,
especially for controls that take awhile to edit like ones that use
the keyboard. In these cases, if the user has already started entering
text, it will not be overwritten by the new value unless the key focus
is taken away from the control first. It is similar when moving a slider
or other value changes using the mouse. LV will write to the other values,
but will not rip the slider out of the user's hand.
To completely avoid race conditions, you can split the array into user
fields and indicators that are located underneath them. Or, if some
controls act as both, you can do like Excel. You don't directly type
into the cell. You choose w
hich cell to edit, but you modify another
location. When the edit is completed, it is incorporated into the
display so that it is never lost.
Greg McKaskle -
How to get updated values from the loops while they are running
Hello,
I am having difficulty solving a very basic problem, how to access the updated values from the 'FOR loop' while its running? Basically, the VI I am currently working on calls two sub VIs. Each sub VI has a for loop, and both VIs may or may not run for same number of iterations. My goal is to read the values at each terminal inside the loop of both sub VIs, in the Main VI. I tried to achieve it using Global Variables, but in main VI it displays only the last iteration value from both sub VIs. Could anyone please tell me whrere am I going wrong? Is there any other/better way to achieve this.
I appreciate any input on this issue.
Kudos are (always) welcome for the good post. :-)
Solved!
Go to Solution.Dennis,
In attached VI, I can see the values changing in the sub VI from the main VI with the numeric indicator whose reference is passed on to the sub VI. Now if I wanted to store or use those values how do I do that? I tried to chnge the indicator to control and read from it (in the attached VI) , but the the indicator updates only once. Tried to create a property node and read the Value from it and it didn't work either.
Thanks in Advance!
-Nilesh
Kudos are (always) welcome for the good post. :-)
Attachments:
main-1.vi 8 KB
sub-1.vi 9 KB -
How To Display Minus value in SAP SCript
Hello Guys.
I am working on a Script. My Problem is that For a fields BSAD-DMBTR.
I have to show this fields value as minus or plus as per condition with fields
<b>bsad-shkzg</b>. In my Internal table it's update as minus but when I am calling Write form with loop. the value is not display with minus sign.
How can I display value with minus sign in SAP script.
Regards
Swati,,Hello Guys..
Thanks for Reply. But I am doing that thing already. My Internal table is updated with minus value. My Problem is not That.
let's suppose.
itab-name = 'xyz'.
itab-value = 100.
append itab.
itab-name = 'xyz1'.
itab-value = -1 * 100.
append itab.
loop at itab.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'LINE'
function = 'SET'
type = 'BODY'
window = 'MAIN'
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
codepage = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
endloop.
Now when value is printed in SAP Script both value is display as plus .I want to display secound value as minus.
Please reply it's urgent.
Thanks
Swati.... -
sir i want to know d solution for displaying ascii value?/?
also sir plz tell how to convert ascii to hex and hex to ascii????
i am finding difficulty to make d program.... dats y i have attached any file bcz my program is not prepared yetHi sir,
convert your string to an U8 array and display that array in an array indicator set to hex display.
Or switch your string to hex display…
Also read this! It's a pain to read your message for non-native English speakers!
-
How to get the values of an Array using JSP Tags
Hey guys,
I need some help. I've splited a String using
fn:split(String, delim) where String = "1,2,3,4" and delim is ,
This method returns an Array of splited Strings. how do i get the values from this array using jsp tags. I don't wanna put java code to achive that.
Any help would be highly appreciated
ThanksThe JSTL forEach tag.
In fact if all you want to do is iterate over the comma separated list, the forEach tag supports that without having to use the split function.
<c:set var="list" value="1,2,3,4"/>
<c:forEach var="num" items="${list}">
<c:out value="${num}"/>
</c:forEach>The c:forTokens method will let you do this with delimiters other than a comma, but the forEach tag works well just with the comma-delimited string. -
How to display the values stored in the database in the combobox on load?
I am develping one application where in
I wanted to display the values in the combobox which I am taking from the database and in the same form passing that value in same form after selecting it,My program is running fine for the first time but next time it is giving me NullPointerException.
So can anyone tell me please how I should develop the this application to avoid this exception?
Thank You
PraddyThanx a lot for showing interest in answering my query.I am pasting my code for ur reference.Please try to reply ASAP.
Thank You,
Praddy.
CODE:
======
<html>
<head>
<script language="javascript">
function submitthisform(thisForm)
thisForm.submit();
</script>
</head>
<body>
<form method=post name=samepgm>
Select City: <select name=city onChange='submitthisform(samepgm)'><br><br><br>
<option value=''></option>
<option value='All'>All</option>
<%@ page language="java" import="java.sql.*" %>
<%
String scity = request.getParameter("city");
System.out.println(scity);
Connection con = null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:property","","");
Statement st = con.createStatement();
ResultSet rs1 = st.executeQuery("select distinct hcity from housefinance");
while(rs1.next())
//String ohname = rs1.getString("hname");
String ocity = rs1.getString("hcity");
//out.println(ohname +"<br>");
out.println(ocity +"<br>");
%>
<br><br><br><option value='<%=ocity%>'><%=ocity%></option><br>
<% }
rs1.close();
if(scity.equals("All"))
ResultSet rs2 = st.executeQuery("select * from housefinance");
while(rs2.next())
String ohname = rs2.getString("hname");
String ohadd1 = rs2.getString("hadd1");
//String ohadd2 = rs2.getString("hadd2");
String ohcity = rs2.getString("hcity");
String ohpcode = rs2.getString("hpcode");
String ohtelno = rs2.getString("htelno");
String ohfaxno = rs2.getString("hfaxno");
String ohemail = rs2.getString("hemail");
String ohmobile = rs2.getString("hmobile");
%>
<pre>
<tr>
<td><p>Company : <%=ohname%> </p></td>
<td><p>Address : <%=ohadd1%></p></td>
<td><p>City : <%=ohcity%> </p></td>
<td><p>Pin : <%=ohpcode%></p></td>
<td><p>Telphone : <%=ohtelno%></p></td>
<td><p>Fax No: : <%=ohfaxno%></p></td>
<td><p>Email : <%=ohemail%></p></td>
<td><p>Mobile No. : <%=ohmobile%></p></td>
</tr>
</pre>
<%
else
ResultSet rs = st.executeQuery("select * from housefinance where hcity like '%"+scity+"%'");
while(rs.next())
String ohname = rs.getString("hname");
String ohadd1 = rs.getString("hadd1");
//String ohadd2 = rs.getString("hadd2");
String ohcity = rs.getString("hcity");
String ohpcode = rs.getString("hpcode");
String ohtelno = rs.getString("htelno");
String ohfaxno = rs.getString("hfaxno");
String ohemail = rs.getString("hemail");
String ohmobile = rs.getString("hmobile");
%>
<tr>
<td><p>Company : <%=ohname%> </p></td>
<td><p>Address : <%=ohadd1%></p></td>
<td><p>City : <%=ohcity%> </p></td>
<td><p>Pin : <%=ohpcode%></p></td>
<td><p>Telphone : <%=ohtelno%></p></td>
<td><p>Fax No: : <%=ohfaxno%></p></td>
<td><p>Email : <%=ohemail%></p></td>
<td><p>Mobile No. : <%=ohmobile%></p></td>
</tr>
<hr>
<% }
%>
</select>
</form>
</body>
</html> -
How to display(binding) values in the table from more than one node?
Hi,
I have two nodes (TRIPS & AMOUNTS)in the context. How to bind these values into the table control?
When i bind second one, first one is getting replaced.Hi Mog,
Of course it is possible to create a table from attributes of more than one node, and in some cases this is still necessary, but you have to do this the hard (manual) way.
If you have a table control, have a look at the properties and the elements belonging to it.
First of all, there is the property "dataSource", which binds to a multiple node (let's name it TableRootNode). This means that for each element of THIS node, one row is created. In each row the data of exactly one element of this TableRootNode is displayed.
Then you have columns in this table. Inside of the columns there is a header and an editor. The editor is the interesting part.
Normally the primary property of this editor is bound to an attribute of the TableRootNode. Then everything works as expected. If it binds to an attribute of a subnode (SUB) of TableRootNode, then in row i the data of the subnode of the i-th element of TableRootNode is displayed. There is no need for SUB to be a multiple node, but it must not be a singleton.
If you bind a property of the editor to an attribute, which does not lie in the subtree of TableRootNode, then you will see the same value in each row.
Now it depends on the structure of your context. Take the node, which is relevant for the change in each row (I assume it is TRIPS) and bind the table to the node as you are used to. Then for each additional column, you have to create a new column in the tree, create a new header element with a title and a new editor (e.g. textview or inputfield) and then bind the right property of the editor to the corresponding attribute in node AMOUNTS).
If these 2 nodes do not have parent-child-relationship, the tip to create a new node, which consists of the attributes of both nodes is the only solution.
Ciao, Regina
Maybe you are looking for
-
File cannot be found when trying to open emailed fdf file
Hello all. I'm starting to lose my mind here so I thought I'd ask the community for any help. I'm using Acrobat Pro X. I have a PDF that a new hire is supposed to fill out. All the fields work and save just fine. There's 2 buttons at the end of the d
-
I have over 1000 songs on an old computer and I want to copy them to a new one - I have a hard drive but it seems to only copy my purchased songs - any ideas?
-
How do I 'save as' on imovie 10 projects?
Hi I've created a movie in imovie but need to modify content and save as - how do I do this? Why has the file functionality been taken off - very frustrating! Cheers
-
Time Machine disk not showing up in Migration Assistant
I have backed up my Snow Leopard with Time Machine and I'm trying to import my stuff into Lion using Migration Assistant. However, my Time Machine disk is not showing up in Migration Assistant even though it's connected and shows in Finder. Any idea
-
Extra characters appearing when using VISA
Hi, I am new to labview and have a problem I've been working on for a few days. I am reading masses printed from a scale hooked up by a RS-232 to USB connection, with the ultimate goal of recording mass vs. time. Currently random letters appear in th