LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fill just a portion of a XY graph

Since you have a xy-graph, just eliminate the outside points. No NaN needed.

0 Kudos
Message 11 of 18
(1,602 Views)

@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) .

 

 

0 Kudos
Message 12 of 18
(1,585 Views)

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 !

0 Kudos
Message 13 of 18
(1,574 Views)

Another thing is that in order to open the attached text file the VI should be selected on the .txt file type

 

Thanks again

0 Kudos
Message 14 of 18
(1,571 Views)

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.

Download All
Message 15 of 18
(1,566 Views)

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!

0 Kudos
Message 16 of 18
(1,556 Views)

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.

0 Kudos
Message 17 of 18
(1,526 Views)

@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.

0 Kudos
Message 18 of 18
(1,522 Views)