LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

g libraries for avoiding truncation of interleaved array?

I want to explain it that I cannot set fixed size of my array at even RT side because the elemets of array are formed by interpolating the spline position!

and each time the position varies the #of elemets vary and hence the size!

😞 so now,  do you think mark code will be helpful there?

 

0 Kudos
Message 11 of 16
(185 Views)

How are you sending the array down to the FPGA?  From what I'm hearing, it would have to be via a DMA.

 

What you could do is to check to make sure the two arrays are the same size.  If not, duplicate the last element of the smaller array until they are the same size.  Then you can interpolate and send the data down to the FPGA via the DMA.  Worst case, your FPGA repeats a position command.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 16
(175 Views)

Yes I am sending my data through DMA channel!

but I am using single DMA to send data for two motors

both motors have to move at different angles!

The position is then interpolated using spline generation , so with different angle each time we would be having different elemets of array!

If I can repeat how can I do this?

How would i be knowing where to repeat from??

Its not a constant size of array always because we shouold program it in a way that we can change angle for both motors  any time

Sara

0 Kudos
Message 13 of 16
(171 Views)

You repeat from the end.  That way the motors stay in their final position while the other one moves (assuming the array lengths are different).  Try this.

 

This is a snippet.  Save it to your desktop.  You can then drag the image into a VI and the code will automagically appear.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 16
(167 Views)

the case 1 will also be the default case.. right?

and what is in case 0?

Can I see the pic of that too just to make things work in similar way!

Thanks

0 Kudos
Message 15 of 16
(158 Views)

@SaraBaber wrote:

the case 1 will also be the default case.. right?

and what is in case 0?

Can I see the pic of that too just to make things work in similar way!

Thanks


Did you follow my directions of porting that picture into your code to be actual code?

 

There is no default case.  I used "..-1" which means array 2 is larger than array 1, "0" which means the arrays are the same length, and "1.." which means that array 1 is larger than array 2.  In case 0, I just passed the arrays through.  With the other two cases, I increased the length of the smaller array.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 16 of 16
(154 Views)