LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI fetches always same data from digitizer

Solved!
Go to solution

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.

 

 

Actor Framework
Download All
0 Kudos
Message 1 of 13
(2,215 Views)

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:

 

altenbach_0-1647974837663.png

 

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"?

0 Kudos
Message 2 of 13
(2,199 Views)

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.

Actor Framework
0 Kudos
Message 3 of 13
(2,173 Views)

@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.

0 Kudos
Message 4 of 13
(2,162 Views)


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.

Actor Framework
0 Kudos
Message 5 of 13
(2,141 Views)
Solution
Accepted by topic author Quiztus2

By switching from exporting started event to start trigger and adding initiate acqusition as in the screenshot the problem is solved

Actor Framework
0 Kudos
Message 6 of 13
(2,131 Views)

@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.

0 Kudos
Message 7 of 13
(2,108 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 13
(2,090 Views)

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.
 

Actor Framework
0 Kudos
Message 9 of 13
(2,064 Views)

@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. 😄

 

 

0 Kudos
Message 10 of 13
(2,047 Views)