08-13-2011 10:47 AM
@altenbach wrote:
I am still up 😉
I just woke up.(morning face)
08-13-2011 11:31 AM
Do you mean like this (see attached)?
But it doesn't work, because as I increment the index, the previous element which was replaced would switch back to its original value. eg.
Input array: 0 0 0 0 0 0
Index: 3
New element: 8
Output array: 0 0 0 8 0 0
if I go on to replace the next element, i.e:
Index: 4
New element: 99
Output array becomes 0 0 0 0 99 0
08-13-2011 11:39 AM
Can you explain what you mean by the VBAI program "feeds" data to a front panel indicator? How did you implement that? How does the LabVIEW program know when new data arrives? Is this called as a subVI?
By "feeds", I meant I have a control in LabVIEW front panel, say for example (for simplicity's sake), a numeric indicator my_indicator in front panel.
In my VBAI, I have a measurement value which is called my_data; and in this VBAI program I am using LabVIEW front panel interface. I will call the step "Update UI" in which I set the my_indicator to my_data.
LabVIEW would not know the exact timing of the arrival of the stream of data. For example, the first data arrives at 0s, the second 0.1s, but the third 0.5s.
08-13-2011 11:49 AM
@splee wrote:
Do you mean like this (see attached)?
But it doesn't work, because as I increment the index, the previous element which was replaced would switch back to its original value. eg.
How are you using this? This is a simple VI that does only one thing. Are you planning on using this as a subVI that is a part of a loop in a main VI? You don't have any terminals wired up on the connector pane.
If you are only trying to run this as a VI, you are getting exactly what it is programmed to do. Take an array from a control, replace and element, and show it on an indicator. You don't have any kind of loop and you don't have any mechanism for feeding the indicator results back into the control. Is that what you are expecting it to do?
08-13-2011 12:03 PM
@MoReese wrote:
@altenbach wrote:
You can eliminate that useless FOR loop by using a globally initialized feedback node instead of a shift register.
You also need a mechanism to reset the shift register contents.
Dear altenbach,
what is this icon (see attached)?
08-13-2011 12:45 PM
An empty DBL array diagram constant.
08-13-2011 12:51 PM
this one does not work..
all elements of the appended array are the same, i.e
if numeric control is 1, the array is 1 1 1 1 1 1 1 ..
if numeric control is now changed to 2, the array becomes 2 2 2 2 2 2 2 ...
maybe you need to use Build Array control (concatenate) with as many array input terminals?
@MoReese wrote:
@altenbach wrote:
You can eliminate that useless FOR loop by using a globally initialized feedback node instead of a shift register.
You also need a mechanism to reset the shift register contents.
What are you doing up at this hour? Don't you sleep? Per your advice. The OP will still need to code in an initial state for the array.
08-13-2011 12:53 PM
How are you running/calling this?
08-13-2011 04:30 PM
You must be running this in a loop. Yes, the array will fill quickly if this is the case. This was intended to execute upon a value change. In other words, you call it when there is a new value or when you want to store the next value. With every iteration, the value of the numeric control will be appended to the array. What are you needing exactly?
08-14-2011 11:20 AM
Thanks.. I figured it out...
though I have some problem with using the event structure to call the blocks, but that's a separate issue 🙂