05-02-2013 10:16 AM
Since you have a xy-graph, just eliminate the outside points. No NaN needed.
05-02-2013 02:04 PM
@altenbach wrote:
Since you have a xy-graph, just eliminate the outside points. No NaN needed.
Here's what I had in mind. Modify as needed (This assumes that the values are sorted in x) .
05-02-2013 04:58 PM
Hello altenbach, I've reviewed your VI but I have some confussion when trying to read mi data, actually I'm unable to do that.
I'm attaching my VI that plots force vs displacement and calculates the area under the curve at a specific X values given by two cursors, that specific delimited area is what I would like to shade
Also I'm attaching a text file that contains data aqcuired from our tensile machine
I've tried different ways to do that, and none of them work correctly, I think because the X data from my first array is the actual displacement data, and the X data coming from my cursor is the threshold index data, there is my problem I think.
Please let me know what you think
Thanks a lot !
05-02-2013 05:02 PM
Another thing is that in order to open the attached text file the VI should be selected on the .txt file type
Thanks again
05-02-2013 05:20 PM - edited 05-14-2013 04:08 PM
Sorry, I gave up trying to understand your code, but my code works just fine for all this. Try it.
Regarding your code:
First you are pounding the graph with empty arrays millions of times per second (yes, there is no loop delay!). Then, when "Retrieve file" is pressed, the file gets read, but a naosecond later the VI stops and you can no longer interact with the graph. Your cursors are locked to a plot, but by the time you are reading the position, there is actually no data yet. Writing to the terminal occurs after the case structure.
Why do you have all that duplicate code in the various cases? Shared code belongs outside the case structure.
05-02-2013 05:58 PM
Perfect that really works!
Sorry for my small spaghetti code, actually you are right on the array stuff I have no timing on the while loop.
The case structures were putted in order to select from .ccv or .txt format files since our machine only gives .ccv extension files but a previous machine provided only .txt extension files. I'm sure I can improve my code cleaning it up using alternate tools such as event structure, etc., but I'm not a kind of familiarized on those I need to start understanding and learning them
I really appreciate your help and advice
Every new knowledge is welcome!
05-14-2013 03:58 PM
Hey I seen your post on the XY graph and it is very nice. Do you know a way of alculating the area unde the curve you select.
05-14-2013 04:12 PM
@HughQuinn wrote:
Hey I seen your post on the XY graph and it is very nice. Do you know a way of alculating the area unde the curve you select.
Yes, try this, for example.