01-22-2016 07:05 AM
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
01-22-2016 09:25 AM
Can you post what you've tried so far? You want to show the integration after each point on the graph?
01-22-2016 10:30 AM
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.
01-22-2016
11:03 AM
- last edited on
04-04-2025
04:55 PM
by
Content Cleaner
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.
https://www.ni.com/en-us/shop/product/advanced-calculations-on-curves-toolkit.html
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
01-22-2016
11:13 AM
- last edited on
04-04-2025
04:55 PM
by
Content Cleaner
@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.
https://www.ni.com/en-us/shop/product/advanced-calculations-on-curves-toolkit.html
Nice plug
01-25-2016 04:39 AM
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
01-25-2016 10:23 AM
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.
01-26-2016 07:22 AM
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.
Thank you for your time,
HrvojeM.
01-26-2016 09:31 AM
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).
01-27-2016 06:48 AM
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?
Thank you for your time,
HrvojeM.