03-22-2022 01:06 PM
I route my started signal from generator via RTSI to digitizer. I use that one to start acquisition. Unfortunately my fetch VI always fetches the same data from digitizer.
Solved! Go to Solution.
03-22-2022 01:53 PM - edited 03-22-2022 01:55 PM
Sorry, I can't look at your VI (No LabVIEW 2021 here), but the following just seems to be quite silly by just looking at the picture:
I am sure there are slightly better ways to create an empty 1D array from an arbitrarily sized 1D array than what you are doing on the left.
How many elements are in the array coming from the read? If there is only one element, the entire shift register construct could be replaced by a concatenating tunnel at the right boundary. If there is more than one element, you are creating a scrambled mess when inserting at [i].
Which part does the "Fetching"?
03-22-2022 04:19 PM - edited 03-22-2022 04:20 PM
I am sure there are slightly better ways to create an empty 1D array from an arbitrarily sized 1D array than what you are doing on the left.
Since I don't dig into the compiled output I can assume that this operation sets basically the array's size and capacity to 1.
How many elements are in the array coming from the read? If there is only one element, the entire shift register construct could be replaced by a concatenating tunnel at the right boundary. If there is more than one element, you are creating a scrambled mess when inserting at [i].
There is only one element. I didn't think of a concetenating tunnel, so thank you for suggesting it, but this doesn't solve my problem.
Which part does the "Fetching"?
The NI-Scope fetch VI should do the fetching. (The one with the 1D Cluster option under it)
Sorry, I can't look at your VI (No LabVIEW 2021 here), but the following just seems to be quite silly by just looking at the picture:
It seems to be quite silly to me, that I maybe should reconfigure a digitizer for every time I want to have a triggered acquisition? But this is not clear to me, since the documentation is not clear about that.
03-22-2022 07:35 PM
@Quiztus2 wrote:
I am sure there are slightly better ways to create an empty 1D array from an arbitrarily sized 1D array than what you are doing on the left.
Since I don't dig into the compiled output I can assume that this operation sets basically the array's size and capacity to 1
Not, it empties the array (i.e. size=0). Arrays don't have any defined "capacity" (whatever that means). The maximum number of elements is limited by the range of I32.
03-23-2022 01:05 AM - edited 03-23-2022 01:07 AM
Not, it empties the array (i.e. size=0). Arrays don't have any defined "capacity" (whatever that means). The maximum number of elements is limited by the range of I32.
The maximum number of elements is limited by the range of I32.
Sure 0. Size in the manner of elements size and capacity in the manner of number of elements allocated for that array. So actually it will only set capacity to 0, it won't touch element size.
03-23-2022 06:58 AM
By switching from exporting started event to start trigger and adding initiate acqusition as in the screenshot the problem is solved
03-23-2022 10:26 AM
@Quiztus2 wrote:
Sure 0. Size in the manner of elements size and capacity in the manner of number of elements allocated for that array. So actually it will only set capacity to 0, it won't touch element size.
You probably mean element type. Clusters never have variable size. (Equivalent (but simpler) code would be a resize with length=0, for example. or just use a diagram constant of that empty array. :D)
Glad you solved your primary problem. At this point you probably can delete all that pink garbage on the left that's not even used. As a matter of caution, you typically want to put references in shift registers across FOR loops. If you don't, they have the potential to become invalid if N ever happens to be zero due to some unusual situation.
03-23-2022 05:41 PM
@altenbach wrote:
@Quiztus2 wrote:
Sure 0. Size in the manner of elements size and capacity in the manner of number of elements allocated for that array. So actually it will only set capacity to 0, it won't touch element size.
You probably mean element type. Clusters never have variable size. (Equivalent (but simpler) code would be a resize with length=0, for example. or just use a diagram constant of that empty array. :D)
Glad you solved your primary problem. At this point you probably can delete all that pink garbage on the left that's not even used. As a matter of caution, you typically want to put references in shift registers across FOR loops. If you don't, they have the potential to become invalid if N ever happens to be zero due to some unusual situation.
Actually this advice can be applied to any value that you care to propagate across a FOR loop if it ever encounters an empty array.
03-24-2022 04:47 AM
You probably mean element type. Clusters never have variable size.
So the array holds actually only pointers to the clusters?
At this point you probably can delete all that pink garbage on the left that's not even used. As a matter of caution, you typically want to put references in shift registers across FOR loops. If you don't, they have the potential to become invalid if N ever happens to be zero due to some unusual situation.
I clicked through tons of beatiful context menus of nearly everything, but I cant find a way to create a reference from an array in the block diagram to pass it into a for loop.
03-24-2022
10:22 AM
- last edited on
05-05-2025
12:39 PM
by
Content Cleaner
@Quiztus2 wrote:
I clicked through tons of beatiful context menus of nearly everything, but I cant find a way to create a reference from an array in the block diagram to pass it into a for loop.
What do you even mean by that? If it is an array on the block diagram, it is a diagram constant. Why would you need a reference and why would you need to pass it into a FOR loop???
What does your picture have to do with the question?
@Quiztus2 wrote:
You probably mean element type. Clusters never have variable size.So the array holds actually only pointers to the clusters?
Please don't dissect semantics. Maybe start with some easy reading. 😄