LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Uneven numeric integration

Hi guys.

 

I have a small problem. I need to read data from two excel files into LabVIEW and than perform uneven numeric integration. Data from Field.lvm represents T and data from Signal.lvm represents X in Uneven Numeric Integration.vi. After the integration I need to show the result in XY graph, with field values on x axis and integrated data on y axis. The graph should form closed loop (hysteresis loop). I tried to use Read from spreadsheet file.vi but haven't succeeded.

Do you have some ideas?

 

Thank you for your time,

HrvojeM

Download All
0 Kudos
Message 1 of 16
(4,392 Views)

Can you post what you've tried so far? You want to show the integration after each point on the graph?

0 Kudos
Message 2 of 16
(4,360 Views)

Your XLS is not a spreadsheet file - it needs to be only table of values with separator (tab by default). Open file in notepad and you will see a big header. You can either use low level "read text from file" functions, search and cut the header and then convert data into array. Or resave file into dat, csv format.

0 Kudos
Message 3 of 16
(4,344 Views)

Hello,

 

If you have problems with reading the file with Read from Spreadsheet file.vi, just convert the file to CSV format. Open it in excel and save as CSV file.

After the mentioned VI will successfully read the file.

 

If you have problems in integrating the data with uneven X axis, you can try using the following toolkit available in LabVIEW Tools Network.

 

http://sine.ni.com/nips/cds/view/p/lang/en/nid/212974

 

Teh toolkit contains VIs to perform advanced calculations on curves (XY graph data), where the X axis data can be non-monotonic (non-functional curves, closed curves).

 

Thanks,

Arev

 

CTO | RAFA Solutions

 

Certified-LabVIEW-Embedded-Systems-Developer_rgb.jpgCertified-LabVIEW-Architect_rgb.jpg

0 Kudos
Message 4 of 16
(4,334 Views)

@arevh wrote:

 

If you have problems in integrating the data with uneven X axis, you can try using the following toolkit available in LabVIEW Tools Network.

 

http://sine.ni.com/nips/cds/view/p/lang/en/nid/212974

 


Nice plug  Smiley Very Happy

0 Kudos
Message 5 of 16
(4,325 Views)

Hi gregoryj,

 

here is my work so far. I've converted excel files to CSV files but still it's not working. Here is how my field and signal should look like.

 

Thank you for your time,

HrvojeM

 

signal.JPG

field.JPG

0 Kudos
Message 6 of 16
(4,250 Views)

Hello, HrvojeM,

 

I could not run your VI because I do not have the files. Generally, it is best to avoid the express VIs, especially when you want to manipulate the data afterward.

 

Your main issue is that you are trying to use the "Uneven Numeric Integration" to give you an array of values, the integration up to each point, or a rolling integration. Since that is not what the function does, you will have to call it in a loop to perform the integration as many times as you have points in your arrays. See below.

 

Rolling Integration.png

Message 7 of 16
(4,213 Views)

Hi gregoryj,

 

thank you for the idea. I' ve implemented it in my code but for now I'm not getting good results (I've attached my VI). Also I removed writing data to excel (I've tried using excel because my NI BNC 2090 device is not working correctly, it mixes data from two channels (see picture) when both channels are connected simultaneously). Also, excel is convenient for integration because I have to keep adding integrated values when T goes from 0 to max value, then keep subtracting integrated values when T goes from max to min value and finally keep adding integrated values when T goes from min value to zero (that is one cycle of T, and I should get hysteresis loop in that way. Before integration I've averaged 100 consecutive cycles of T and X to minimize error). I have to consult my mentor on further steps. I would appreciate any suggestion.

 

mixed signals.JPG

 

Thank you for your time,

HrvojeM.

0 Kudos
Message 8 of 16
(4,171 Views)

In the help for "Uneven Numeric Integration" it says "the VI reorders T in ascending order and reorders X to correspond to T." So I don't think you will get the hysteresis loop you are looking for. Just looking at your graph, it looks like some kind of a signal from an oscilloscope, in which case you don't need the uneven integration because it should be spaced evenly in time.

 

Perhaps instead of Uneven Integration you can just take the sum of the array elements for the signal (don't do anything to the field).

 

 

0 Kudos
Message 9 of 16
(4,142 Views)

Hi gregoryj,

 

 I've replaced the Select signal.vi for the field with the Simulate signal.vi (to avoid data mixing) and added Write to spreedsheet.vi to get integrated data in excell for further analysis. On Integration graph I've got preety good picture so I  tried to show hysteresis loop in excel (Hysteresis loop (original) - integration with labview) but it looks very different when compared with hysteresis loop I got without integration with labview (Hysteresis loop (manipulated) - integration with excel). Do you know why it looks so different?

 

integration and hysteresis.JPG

 

Thank you for your time,

HrvojeM.

 

 

0 Kudos
Message 10 of 16
(4,117 Views)