LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The function that can keep old value


pacific wrote:

Hence two arrays are required to replace the old point with a new point.


No, you can use "rotate array" and do things in place. 🙂

 

(Even easier, keep track of the current index and just read the oldest element before replacing it with the newest while leaving the other elements untouched.)

Message Edited by altenbach on 11-04-2008 10:11 AM
Message 11 of 21
(1,715 Views)

Thanks altenbach. I had not used the "rotate array" function before.

 

Do you see any advantage/disadvantage of using queues instead of arrays?

0 Kudos
Message 12 of 21
(1,702 Views)

pacific wrote:

Do you see any advantage/disadvantage of using queues instead of arrays?


It really depends how much flexibility you need. Queues certainly have more overhead.

 

In the simplest case of a fixed history lenght, you could get away with a single in-place array, and an in-place structure as follows.

(the subVI does not even need a loop ;))

 

Message Edited by altenbach on 11-04-2008 11:37 AM
0 Kudos
Message 13 of 21
(1,687 Views)

Hi Pacific,

 

Thank you for your help, I tried the FIFO example and it works very well. I'm also trying to make it with the array but it's more difficult than I thought.

 

Best regards,

 

Guangde

0 Kudos
Message 14 of 21
(1,655 Views)

guangdew1 wrote:

I'm also trying to make it with the array but it's more difficult than I thought.


That would be a good exercise and it should be very simple. What kind of problems are you having with this.

0 Kudos
Message 15 of 21
(1,654 Views)

Hi Rob,

 

Thank you for your help. I tried but couldn't meke it work. I'm weak on the waveform subject. I have never used it before. It will be appropriate if you can point me to some materials to learn about this subject.

 

Best regards,

 

Guangde

0 Kudos
Message 16 of 21
(1,652 Views)

Hi altenbach,

 

Thank you for your help. The graph you posted looks strange for me. Looks the function here you are using is Index Array, but I don't know how you can make it look that. Can you explain a little bit further?

 

Thank you and best regards,

 

Guangde

0 Kudos
Message 17 of 21
(1,650 Views)

What is your LabVIEW version?

 

If you have a newer version, you'll find this structure in the "Programming...application Control...memory control" palette.

 

Look for "In Place Element Structure". Check the online help for details.

 

If you don't have it, you need an "index array" and an "replace array subset" and a little bit more code. 🙂

 

 

Message Edited by altenbach on 11-05-2008 09:49 AM
0 Kudos
Message 18 of 21
(1,643 Views)

guangdew1 wrote:

Hi altenbach,

 

Thank you for your help. The graph you posted looks strange for me. Looks the function here you are using is Index Array, but I don't know how you can make it look that. Can you explain a little bit further?

 

Thank you and best regards,

 

Guangde


Are you using LabVIEW 8.6?  I think you are refering to the "In Place element" structure in Altenbach's picture.    If you have LV 8.6, go to Programming/Application Control/Memory control palette.

0 Kudos
Message 19 of 21
(1,640 Views)

I think my problem is to move the array. Like the attached image, no matter I have the index input rotate from 0 to 9 or a fixed number of 9, it will not give me the right result. Pacific mentioned about keeping two arrays, maybe that's the solution but I haven't figured it out yet.

 

Thanks,

 

Guangde

0 Kudos
Message 20 of 21
(1,624 Views)