LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph average temperature from a field point device

Hi,:manhappy:

 

 

This is first ever post. I'm an absolute biginner in LV and engineering student in University of Houston.

 

I'm simply tring to read a cFP-TC-120 device and avarage first 100 values of each of 8 thermocouple values and draw graphs for each channel.

 

I have attached my vi.

 

My question is , is there a better way to do this?

Download All
0 Kudos
Message 1 of 7
(2,901 Views)

Hi IDW,

 

You can utilize a for loop and auto-index each element.  Please see the following article describing autoindexing:

http://www.ni.com/gettingstarted/labviewbasics/datastructures.htm

 

Since you're performing the same operation over and over, you can use a for loop to replace repeatedly execute the same base code.

Since you want to perform the operation inside the loop for each element of the array, you can use auto-indexing.

 

I've attached an example.  Given an array, it will add 1 to each element, and output an array of the same size.

 

A good idea would be to familiarize yourself with the LabVIEW environment and common programming conventions.  There is a useful tutorial here:

http://www.ni.com/gettingstarted/labviewbasics/

 

 

Regards

Che T.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(2,873 Views)

Thank you so much Che T.

 

Please see the attached diagram. How I can do the auto indexing now?

If I wire the array directly to the For loop (auto index) then how can I calculate the avarage for each separate channel. 

 

This is what I need to do.....

I need to avarage each channel (100 samples each) and save them columnwise in a text file. Something like below.

 

 

TimestampChannel 1Channel 2Channel 2Channel 3Channel 4Channel 5Channel 6Channel 7Channel 8CJ
.... .... .... .... .... .... .... .... .... .... ....
.... .... .... .... .... .... .... .... .... .... ....
.... .... .... .... .... .... .... .... .... .... ....
.... .... .... .... .... .... .... .... .... .... ....

 

 

 

 

 

0 Kudos
Message 3 of 7
(2,864 Views)

Hi IDW,

 

To perform autoindexing, you must input an array into the for loop.  Since your current code is converting the array to a cluster, it cannot be autoindexed.  If you remove the "Array To Cluster" function and the unbundle, then you can input that array into the for loop.  However, this solution alone will not perform all that you need to do.  But, it will help you move in the right direction.  Please keep us updated if you get stuck.

 

 

Regards,

Che T.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 7
(2,841 Views)

Hi,

 

Thanks 

Attach is what I have done. I was able to make a 2D array with 9 columns.

 

1) How do I stop after loading 100 rows into the array ---> 2) calculate avarage of each column ---> 3) Empty the array ---> 4) Reload it with new 100 rows ---> Back to (2)

 

 

0 Kudos
Message 5 of 7
(2,813 Views)

Sorry wrong diagram....

 

I attached the correct one this time

 

 

Thanks

0 Kudos
Message 6 of 7
(2,804 Views)

Hi IDW,

 

What you're trying to accomplish can be done by using comparison operators (less than, greater than, equal) and a case structure.

 

I refreshed myself on this post, and noticed that you indicated that you're new to LabVIEW.  Please review the following material

http://www.ni.com/gettingstarted/labviewbasics/

 

I highly recommend reviewing the page above to gain more context into what I mean.  Additionally, it may be useful to look into our formal training.  LabVIEW Core 1 should be sufficient to get you up to speed with how to use LabVIEW.

http://sine.ni.com/tacs/app/fp/p/ap/ov/lang/en/ol/en/oc/us/pg/1/sn/n8:28/

 

 

Regards,

 

Che T.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 7
(2,787 Views)