Indexing array of references element by element
Hello,
I have a simple question. How do I go about indexing an array of references element by element? For example, when using a cluster reference, there is a property node called "controls [ ]" that we can pass into a for loop. For a normal array, "enable indexing" is usually automatically turned on when entering a for loop. Why is it that for an array of references, this is not the case? Thanks for the help.
Solved!
Go to Solution.
Attachments:
array_of_references.JPG 35 KB
Since the Get Image is a method, it has to work on something, and that would be a picture control or indicator. (If you look at the Get Image Method for the array, you'll notice it only returns an image of the front panel object, so I think you'd just get a picture of the array as it looks on the FP).
So you'd send the picture to an indicator, then use the Get image method on that indicator immediately afterwards. See attached. I didn't try this out so I can't be sure it would work, but I think it would. But it would still be a major hack compared to just using the Picture to Pixmap VI.
Message Edited by Ravens Fan on 03-27-2009 01:03 AM
Attachments:
Array_of_References[1]_BD.png 12 KB
Similar Messages
-
Creating array of references to another array's elements
I have been coached by NI support to read an array of picture files into an array of picture indicators and then in order to save memory, establish an array of references to the array of picture indicators' elements so that I can use them in a subsequent loop. Does anyone know a quick way to create this array of references from an array of picture indicators?
Solved!
Go to Solution.My understanding is there is only one reference to an array element. There is no such thing as references to different array elements.
Why wouldn't you use a reference to the array, use the value property node, then use index array to get out the picture you are interested in? -
How can we get the reference of XML element on frame as soon as frame is created in Document?
Hi,
When ever we copy any text/table cells from any frame, and paste it directly on page, A new Frame is created and the pasted text is placed inside that frame.
Now to capture this frame creation, We have two possible solutions:
1) Attach Observer on Document 'kDocBoss' on IID_IHIERARCHY_DOCUMENT and it will notify on frame creation in update function.
2) Notification event on new story creation.
Now, I need to perform some changes in the newly created table, for example:
a) Need to delete XML tags from newly created frame
b) Need to perform action on table cells if any in the created frame.
But the problem is, when the event comes, I can access basic properties of frame like it's name, type etc, but it does not give me the
XML element on frame or tables in frame until the event is com pleat.
I know it's quite a specif requirement, but I guess many of you might have faced these kind of challenges, while processing the event.
Does any one has any idea how I can get the reference of XML element on frame as soon as it is created?Hi Kapoor,
please give also others a chance, and excuse that I get up late on vacation ;-)
Anyway, I'd keep the story creation responder to recognize the copy, then combine it with an observer on the backing xml story to catch the associated XML element which is created there. Something like below:
UIDRef xmlStoryRef = Utils<IXMLUtils>()->GetBackingStore(doc);
InterfacePtr<ISubject> subject ( xmlStoryRef,IID_ISUBJECT );
subject->AttachObserver(observer,IID_IIDXMLELEMENT,observer->GetAttachIID()); -
No reference found in element, incorrect attachment reference
Hi All,
I am getting this error. While invoking a webservice.
That web service require me to send using SOAP with Attachments .
the element is declared like this in wsdl
<xsd:element name="doc" nillable="true" type="xsd:base64Binary"/>
I am using
<from expression="bpws:getVariableData('ReadPriceFeed_Read_InputVariable','AmazonEnvelope')"/>
<to variable="InvokeAmazon_postDocument_InputVariable" part="doc" query="/ns3:doc"/>
this command to assin data.
but getting No reference found in element, incorrect attachment reference error.
Please help me.
Thanks,
Varun
[2006/09/14 19:10:33] "{http://schemas.oracle.com/bpel/extension}remoteFault" has been thrown. less
<remoteFault>
<part name="code" >
<code>Server</code>
</part>
<part name="summary" >
<summary>when invoking endpointAddress 'http://merchant-api-qa.amazon.com:80/gateway/merchant-interface-mime', No reference found in element, incorrect attachment reference</summary>
</part>
<part name="detail" >
<detail>AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode: faultString: No reference found in element, incorrect attachment reference faultActor: faultNode: faultDetail: {WASP_ExceptionNs}ExceptionTypeName:WASP_DeserializationException {WASP_ExceptionNs}ExceptionMessage:No reference found in element, incorrect attachment reference {WASP_ExceptionNs}ExceptionStackTrace: thrown in 'bool WASP_MessageAttachmentResolver::resolve(WASP_XMLTokenizer *, WASP_String *, WASP_String *&, WASP_String *&, WASP_String *&, WASP_String *&, WASP_DeserializationContext *, WASP_ExceptionEnv *)' at serialization/helpers/MessageAttachmentHelpers.cpp:119 caught in 'void WASP_DeserializationContextImpl::deserialize(void *, void (*)(void *, void *), WASP_XMLTokenizer *, WASP_String *, WASP_String *, WASP_String *, WASP_String *, bool, WASP_ExceptionEnv *)' at serialization/DeserializationContextImpl.cpp:573 rethrown in 'void WASP_DeserializationContextImpl::deserialize(void *, void (*)(void *, void *), WASP_XMLTokenizer *, WASP_String *, WASP_String *, WASP_String *, WASP_String *, bool, WASP_ExceptionEnv *)' at serialization/DeserializationContextImpl.cpp:573 caught in 'void MIME::_WASP_MerchantInterfaceInstanceMethods::postDocument(MIME::MerchantInterfaceImpl *, WASP_MessageAttachmentManager *, WASP_DeserializationContext *, WASP_SerializationContext *)' at /opt/brazil-pkg-cache/packages/MerchantGatewayServer/MerchantGatewayServer-1.1.14.8/X86_LINUX_GCC2_GLIBC22/src/waspcServer/merchantInterfaceMIMEImpl.cpp:1161 thrown in 'static void MIME::_WASP_MerchantInterfaceInstanceMethods::_WASP_postDocumentCallback(WASP_CallContext *, void *, WASP_Exception *, WASP_ExceptionEnv *)' at /opt/brazil-pkg-cache/packages/MerchantGatewayServer/MerchantGatewayServer-1.1.14.8/X86_LINUX_GCC2_GLIBC22/src/waspcServer/merchantInterfaceMIMEImpl.cpp:1179 caught in 'void WASP_CallContext::callResponseCallbacks(WASP_Exception *)' at runtime/CallContext.cpp:184 </detail>
</part>
</remoteFault>Hello,
have you found any solution for this problem?
Ich have the very same problem and i can't resolve it the last 3 days an i'am hopeless.
Many thx. -
Hello,
in my vi I have a chart with 5 Plots displaying measurement data.
The user should be able to save all the history data from the chart at anytime. (e.g. the user watches the chart and some event happens, then he presses a "save"-button)
I know, that I can read out the history data with a property node. That is not the problem. The problem is, how do I handle the data? The type of the history data is a 1-D array of cluster of 5 elements.
I have to convert that data somehow into a 2 D-array of numbers or strings, so that I can easily save it in a text-file.
How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers?
I use LabVIEW 7.1
Johannes
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
Solved!
Go to Solution.Gerd,
thank you for the quick response and the easy solution.
Look what I did in the meantime. I solved the problem too, but muuuch more complicate :-)
And I have converted the numbers to strings, so that I can easily write them into a spreasheet file.
Johannes
Message Edited by johanneshoer on 04-28-2009 10:39 AM
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
Attachments:
SaveChartHistory.JPG 57 KB
SaveChartHistory.JPG 57 KB -
Deleteing element by element in 2D array
Is there away to delete element by element in 2D array without changing the dimensions to 1D array. I want to select the first 20 element reading across the rows. For example, If I have 2D array with 6 element in each raw. I want to select the first three rows and 2 elements from the four raw.
Regards
HussainMaybe I completely misunderstand what the OP tried to say / do, but you can accomplish it without using clusters. Comments from others are correct, you cannot resize the 2D array by deleting elements within a given row.. However, maybe you want to achieve what is described below.
Do keep in mind that if you attempt this with a numeric array, you may want to use 0 or 'NaN' as your deleted value.
See code below which should be self-explanatory. There are probably better improvements of the example, but the purpose was simply to show how it can be done.
Array 1 shows the original 2D array and it's values.
Array 2 shows how you can "delete" or replace its element with a "deleted" value.
Array 3 shows how you can "delete" multiple elements (replace multiple elements with a "deleted" value).
Attachments:
deleting inside 2D array.png 32 KB
delInside2Darray.png 29 KB -
How to make 1D Array but with only one element filled in Real Time
Hi folks,
here I am with another question. I want to implement an prediction discrete state space observer which is going to run on a CRIO real time target. I am going to do it just like in the example which comes with LV.
I have some questions regarding the input and outputs which in the example those are "dummy".
My model is a SISO model, but the function "Construct SS model" returns parameters (A,B,C,D Matrices) as 2D arrays, so once you connect the cluster model into the Discrete Observer model, it takes y and u as 1D arrays despite of the fact that there is a SISO model.
I realized that the function I am using in the simulations, uses 1D arrays but with only one element filled:
Does anyone knows how to implement such 1D arrays in Real Time? I guess the way to do it is preallocating one array of zeros of size 1, and then recirculating it through some SR, and replacing the element with my real input and output, but at the dummy.vi, they are using a simple "build array"
function.Ok, I did it that way. But I am facing another problem right now...
At some point the Discrete Observer return a NAN array, you will see the code in the code snippet?
I get rid of that component by component, but the observer gets "stuck" in it. So my Control law is zero... but the state stimate is NAN.
Also I am attaching the VI.
I do not know why, since in the simulation program all runs well. any thoughts? Maybe the internal numeric precision of the State Space Model?
Attachments:
RT - Pole Placement + Complete Observer.vi 40 KB -
How can we reference to an element which is added dynamically on runtime?
Example code:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" applicationComplete="init(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function init(event:FlexEvent):void {
trace(button1.label);
var newbtn:Button = new Button();
newbtn.label = "New Button";
newbtn.id = "button3";
newbtn.name = "button3";
mygroup.addElement(newbtn);
trace(this["button3"].label);
]]>
</fx:Script>
<s:HGroup id="mygroup">
<s:Button id="button1" label="Button 1" />
<s:Button id="button2" label="Button 2" />
</s:HGroup>
</s:WindowedApplication>
When I try to run above code, it dispatch error
Error #1069: Property button3 not found on project1 and there is no default value.
So, how can I call to the newly added button?
Thank you.Yue_Hong wrote:
Tried. Not working.
It wouldn't . "button3" is a child of the group.
Try myGroup.getChildByName("button3"); -
Obtain a reference to the element at lead selection
I am trying to obtain a reference to the element at lead selection of a context node (Node name is Person) of component controller, i had a method initPerson() to initialize the values, so when i am writting
IPersonElement personEl = wdContext.nodePerson().currentPersonElement();
to obtain a reference , at IPersonElement it is giving me an error
IPersonElement can not be ressolved or is not a type !
can anyone help me on this
Thanks in advance.
Rashmi.
Edited by: Rashmi Gupta on Nov 6, 2008 11:40 AM
Edited by: Rashmi Gupta on Nov 6, 2008 11:41 AMHi
Usse
view/controllerName.IPersonElement
Just like given example below
IPublicAllInOne.IFlight_List_1Element ELE = wdContext.nodeFlight_List_1().createFlight_List_1Element(new Bapisfldat());
PS: Orgine the import files. by pressing control+Spece button at time
or
controlSpeceO
Thanks -
1D Array of Cluster of 2 Elements Write to Spreadshee​t
Hi all, first time using LabView in many years. I am trying to write a VI that will acquire data from our cDAQ (right now just trying to get it to work with a single thermocouple in a NI 9211, but eventually will be 8 X thermocouple, 4 X pressure transducer), display it in realtime on a plot, and then when the acquisition is stopped, output the data to a file for later use. I am currently using the Base LabView package.
My problem (as I remember it was 7 years ago when I last used this) is with the data types not working together. This is my thought process currently on building this VI. Everything is inside a While Loop with the Wait function at 1000ms.
- Acquire a point of data using the DAQ assistant
- Send that point of data into a bundle
- Send the iteration count into the same bundle (as a timestamp)
- Send the resulting cluster of 2 elements into a Build Array function
- Send the resulting 1D array to a shift register in the While Loop, as well as to an XY graph for realtime plotting
- Wire the incoming point on the shift register back into the Build Array function
In my mind, this allows the XY graph to plot the complete array every iteration, giving a realtime view of the signal. Everything works fine up to this point. My problems are:
When I stop and restart the program, the shift register is not cleared, so the existing data in the array remains on the graph. I know I need to initialize the shift register to clear it, but I cannot figure out what to wire to it that will be compatible with the data type (I just get broken wires with everything I tried).
Similarly, I cannot figure out how to output this data to a spreadsheet after I Stop the While Loop. I think I should wire the "Write to Spreadsheet File" VI to the outgoing shift register, but again, I can't get compatibility with data types (source is a 1D array of cluster of 2 elements).
I have attached my current program "Production" to this post.
I look forward to the help!
Brad
Attachments:
Production.vi 46 KBHi Brad,
I would suggest you change your architecture. First, to answer your questions:
1.
In order to ensure that your shift register is not reading the last
value from it's memory location, you just need to create a constant for
the shift register. To do this, right-click at the input of the
'left-placed' shift register and create a constant.
2. The Write
to Spreadsheet is expecting a 1-d or 2-d array while you are wiring a
Dynamic Data Type. Use the Convert from Dynamic Data Type to convert
the data into the appropriate waveform after which you can get the
waveform attributes which includes the values and the timestamp data. Or, you can use the Write to Measurement File to write to a .lvm file which can be opened in Excel as well.
Changes to your architecture:
Since
you are using a lot of channels, I would advise you use a
producer/consumer architecture. You can have a look at this
architecture by navigating to File -> New.. and searching for the
Producer/Consumer template. You will notice that this architecture uses
queues. The way you will design your VI is to use DAQ to acquire the
data into your producer loop, convert this data into a waveform and
then send this data to the consumer loop via queues. In your consumer
loop, you can write this data to a file. At this point, I would
encourage you to write to a binary file instead of a spreadsheet file. The write will happen faster and you will be using less space on your hard disk when compared to ASCII writes.
I know this can be real confusing for a beginner, so be sure to post back if you have any questions.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies -
Write an 1d-array of cluster with 3 elements
Hi,
I have to make a "Power spectral densities" analyse from my waveform data. The results from this VI is an array of cluuster with 3 elemments. Now I want to write this array of cluster with 3 elements to a file. And later it must be able to use this file with EXCEL!!
thanksHi
I found some outer Forum entries about this topic.
Look at this links:
http://forums.ni.com/ni/board/message?board.id=170&message.id=49553&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=170&message.id=51526&requireLogin=False
I hope this helps
Manuel -
Saving data from 1d array of cluster of 2 elements: HP 8752 driver
I'm using the following driver to communicate with my HP 8720C Network Analyzer
http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E9092659CE034080020E748...
...So far I've easily been able to use the "collect and display data" vi, except for saving data. All I want to be able to do is save the data from a single sweep in spreadsheet format. Displaying the data is no problem, which I can then print, however, the output data file is a mess. The VI is rather complicated, and I can't figure out how to save the data in a nice pair of columns of numerical values.
The VI's output data is in the format of a 1 dimensional array of clusters of 2 elements (ie the x-y values). I would've thought it would be trivial to do this, since this is the standard format for data for the classic X-Y graph. So far, I haven't been able to come up with anything. Any ideas?
Thanks,
SpenceFeed the array of clusters into a for loop with autoindexing enabled (the default). Inside the loop use the Unbundle primitive to extract X and Y for one point. Use Build Array to make a two-element array from X and Y. Wire this array out of the for loop and you will have a two dimensional array with two columns and as many rows as there are elements in the array of points.
Lynn -
How can I write a 1d array of cluster with 3 elements to a file?
Hi,
I have to make a "Power spectral densities" analyse from my waveform data. The results from this VI is an array of cluuster with 3 elemments. Now I want to write this array of cluster with 3 elements to a file. And later it must be able to use this file with EXCEL!!
thanksHello schloronzo,
make a for loop feeded with your array. Inside the for loop unbundle
the cluster, "format into string" the 3 values, adding the result to
the ones before and collect them in a shift register. Then save the
resulting string to a txt-file. If you make a good format string then
Excel is able to read your txt-file (use tab a separator and CR/LF
after each 3 values aka "csv format").
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
Write 1d array of cluster with 2 elements to file
HI!
I'm new at LabView so I hope the question is very simple to you:
I am using a waveform graph to display several measurements.
Now I want to save these Measuremens. The data are stored in 1d array of cluster with 2 elements.
What is the easiest way to do this??
ThanksIf you are already using waveforms you can simply wire right up to "Write Waveforms to File.vi" in the Waveform palette under Waveform File I/O.
Daniel L. Press
PrimeTest Corp.
www.primetest.com -
Connect 1 D array of cluster of 2 elements with dynamic data
Hello
The type of source is 1D array of cluster of 2 elements and the type of sink is dyanamic data. Can any one guide me how to connect these 2 elements together. Any response would be highly appreciated.
ThanksFirst, this question would more appropriately be posted to the LabVIEW Board. It is not a signal conditioning issue.
The dynamic data type (DDT), sometimes referred to as the "evil dynamic data type," completely obscures the internal data structure. The only way someone could help is if you tell us what the source is expecting the internal data structure to be. The only objects which want DDT inputs are Express VIs, which are also good at obscuring thier contents. Implementing the sampe funcitonality with standard VIs might be a better approach.
You also have not completely specified the source. What are the data types of the cluster elements?
Lynn
Maybe you are looking for
-
Screen sharing not working with eMac lab after 3.2 update
Screen sharing no longer functions after applying the 3.2 update in our eMac labs running 10.4.10 and PPC processors. However, it still functions in our iMac labs running 10.4.10 Intel processors. Before update, I was able to screen share with all th
-
How do you make the black area in an FLV playback white or transparent
Trying to make the FLV playback black area white or transparent, because there is a black flash that shows up when play the movie. I am trying to alleviate this by changing the black area to another color or alpha.
-
Question about updating SQL Server on failover cluster
Hi all, I would like to better understand the update process of SQL Server (2008 r2) in a failover cluster environment. In our cluster we have 4 instances of SQL running, where two of them I am able to at anytime stop the instance and update it. The
-
Why not this icons in pages?
I will love to this icons in pages , i used many times in my teaching texts, in the same page can write in two or more languages, correct grammar, use to change letters. why not in pages?
-
I wanted to buy QT 7 Pro and tried to download it. I didn't realise QT 7 was already on my Mac 10.6.6. I couldn't do it, and therefore deleted QT X, thinking that was the solution. Now I want QT X back, but I cannot find it on my installation disc, o