LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

element to array

 H Jack,

  Thanks for the idea. My main VI already crowded with lot of sub-VIS, shift registers. Could any possiblity of getting consecutive values of the parameter without using multiple shift register? Could we use 'for loop' in my main vi so each iteration gets the corresponding value of the parameter?  Please suggest if you have any other ideas.

 

Regards,

Senthil

0 Kudos
Message 11 of 20
(1,478 Views)

I'm pretty sure you could do it with one shift register, and it might not be a bad idea to clean-up the main VI some.

 

There are other ways to store the data.  You could try a function global variable

 

http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DB4956A4E034080020E74861&p_...

or better yet, and action engine

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=240328#M240328

 

This stores data in the shift register of a subvi, which you can call later and retrieve it.

0 Kudos
Message 12 of 20
(1,475 Views)

Hi Jack,

 I added a shift register to main vi and used 'array subset' for extracting data values for 1 min duration from it. Now it works fine.  Kudos to your idea.

 

ThanksSmiley Happy

 

Senthil

0 Kudos
Message 13 of 20
(1,457 Views)

Hi Jack,

 

Why do you have a single iteration of the For Loop?  Do you actually need the loop?  I didn't re-read all the posts to understand what is going on.

Also, I noticed that the shift register is unitialized.  Were you trying to implement some sort of Action Engine?  If so, that is not how it is done.  The wayit is implemented in the image below will result in unpredictable behavior.

 

Some additional comments:

 

What is the difference between array2 & array?  If it is just to pass values through a sub-vi, then a naming convention such as array in / array out might be more appropriate. Otherwise someone using the subvi might think they are 2 different arrays 😉

 

Change Update Interval (ms) to Double to avoid coersion.

 

I didn't spend much time looking at the math.  I do see something that can be simplified.  😉

 

 

 

 

Message Edited by Ray.R on 11-02-2009 08:34 AM
Message 14 of 20
(1,449 Views)

Hi Jack,

  One more clarification! In my attached VI (on previous post), I am integrating the data values from the 'array2'. Actually the values of this array corresponds to a measured parameter 'rate of heat flow'. I wish to integrate it to get the values for 'cumulative heat production'. All the values of 'array2' are equally spaced (10 secs interval).

Sampling rate of my main VI  is 10 secs. I wish to integrate '6 samples' from 'array2' for each iteration i.e. interested to find cumulative heat value for every 1min duration.

My doubt is:

 

(1) Which integration VI I can use for this type of problem, integral x(t).vi (or) numerical integration.vi?

 

(2) What is the value for the increment dx (or) dt for my problem?

 

Thanks

 

Senthil

 

0 Kudos
Message 15 of 20
(1,417 Views)

Hi,

  Could anyone clarify my doubt?

 

Thanks

 

SenthilSmiley Happy

0 Kudos
Message 16 of 20
(1,403 Views)

851624047 wrote:

 

Sampling rate of my main VI  is 10 secs. ..... What is the value for the increment dx (or) dt for my problem?


What else could dt be?? 😄

 

How much data do you have? Do you want to keep a running integral of the latest 6 data?

 


851624047 wrote:

(1) Which integration VI I can use for this type of problem, integral x(t).vi (or) numerical integration.vi?


You should be able to decide this by looking at the help: integral x(t) given you a scalar number while numeric integration gives you an array output. most likely, you want integral x(t).

0 Kudos
Message 17 of 20
(1,373 Views)

Hi altenbach,

  Yes, I want to keep a running integral of latest 6 data. I meant 'dx' for 'integral x(t) .vi' and 'dt' for  'numerical integration'.

 

I tried using 'numerical integration' and it is also giving scalar output. But I am in confusion whether to use dt=10 (or) dt=1/10 as increment value.

 

Thanks

 

Senthil

0 Kudos
Message 18 of 20
(1,367 Views)

851624047 wrote:

But I am in confusion whether to use dt=10 (or) dt=1/10 as increment value.


It's just a scaling factor, not some fancy math. It simply determines what units you get in the result.

 

This is trivial and you could find out by trial and error since you only have two choices. You have a 50% change to get it right at the first try and a 100% chance to get it right after two trys. 😄

 

Most likely you want dt=10. 😉

Message 19 of 20
(1,363 Views)

Hi altenbach,

  Thanks for your hint. Let me try integrating the values in Matlab and compare the results with the

two methods.

 

Senthil

0 Kudos
Message 20 of 20
(1,350 Views)