LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining data from line on graph - Is this possible?

I didn't mean to send you down a rabbit hole. This solution may in fact not be the best one for you. I have used it before to turn XY data where the X values are not evenly spaced into a waveform so I could use some waveform-only functions/VI's.

 

Not knowing what your data set looks like it is kind of hard to say what would be best. If your data is evenly spaced and you have the same number of samples every time you could do it much more simply. Even if you don't have the same number of points every time you should still be able to do it simply. What might make it less simple is if you need to interpolate between points that don't actually exist in your data. That is what the solution I posted does essentially.

 

I do want to point out though, the image I posted in my last post is a "VI Snippet". If you paste that image (or maybe drag?) into a block diagram it will translate it back into code.


Corey Rotunno

0 Kudos
Message 11 of 26
(896 Views)

Hello Corey.

 

The data is just creating the points. I want to create the data between the points. The file you sent is a PNG image. Maybe it was converted by the LabView site.

 

I also may be leading myself in the wrong direction. As ever.

 

This is what I'm trying to do.

 

I have a camera slider and it works well when I control it with a LabView Knob. Like this:

 

screenshot_2017.jpg 

screenshot_2015.jpg

 

The data is the Dial/Knob creating a string to an Arrey (As above) The data from this goes to the Slew (SL) of the stepper motor and it ramps up, moves and ramps down.

 

I want to replace this with a better system, more accurate.

 

I want to replace the Knob with an ajustible slider systen with Ramp Up - Move and Ramp Down.

 

Like this.

 

screenshot_2016.jpg

 

I want the operator to be able to move the four points and the system output data that controls the stepper motor like the Knob.

 

This is why I'm trying to create the data between the dots.

 

The dots are the operators control, the data would control the stepper motor.

 

Or am I just crazy ;o)

 

 

screenshot_2023.jpg

0 Kudos
Message 12 of 26
(889 Views)

Still working on this, will not give up. I can't find all the items just yet.

 

The Snippet tries to load in Windows LabView but it is a 2015 file, I'm on 2014 LabView.

 

All fun and games!

0 Kudos
Message 13 of 26
(871 Views)

The "Limit Specification" is in the Signal Processing>Wfm Measure>Wfm Monitoring palette. 

 

However, now that I know more about your application this solution might not be so good for you. I see you are using a chart control which you are feeding a single value per iteration, leveraging the chart's internal memory. So, everything I have talked about so far isn't going to work as I described. Sorry for sending you on a loop.

 

NOTE: The below "solution" is still more complicated than I think your application needs to be. I just am including it FYI.

 

There are ways to do what you want of course. One thing I have done to get specific Y values for a given X value is use cursors. Unfortunately they are only available on graphs, so you would need to keep a history buffer manually as the graph has no internal history. That being said... if you go that route of keeping your own rolling buffer and leveraging a graph, then the waveform tools could come back into play as you could keep your rolling buffer as a waveform.

 

I do this on a large scale right now in my application. I keep a 60,000 data point history per channel on 36 channels as a 2D array of DBL. Then I convert each channel into a waveform 10 times per second. That way I can leverage all of the waveform tools. To display them I chart whatever channels I want to see on a graph. Every refresh of the graph is a completely new waveform, managed by a circular buffer I had to build. 

 


Corey Rotunno

0 Kudos
Message 14 of 26
(862 Views)

A lot of investigation and I'm now on a new path.

 

I found a ramp up current over time.VI on this wonderful Forum!

 

I started to use parts and thighs have started to work.

 

I think this is a much better result and option!

 

I re-made the Front Panel:

 

Wait Time

Ramp Up Time

How Fast - Amplitude

How long to Play before Ramp Down

Ramp Down

 

screenshot_2036.jpg

 

Not all is well on the Dark Side:

 

screenshot_2037.jpg

 

The timer has stopped working, I think this is due to my lack of skills adding the Loop Condition - Saying Loop if True

 

I still need to work out how I get it to play for X'seconds before Ramping Down for X'seconds to Zero and stop.

 

 

0 Kudos
Message 15 of 26
(852 Views)

Re: Wait ms Multiple

 

That is a misleading function and can do odd things if you do not fully understand how it works.  A better name could be "wait an arbitrary amount of time but at least ..." whatever value you pass it.

 

A simple "wait" will be more stable. A timed loop will work even better and if you have a hardware timing source for the timed loop... it just does not get any better in a Windows environment.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 16 of 26
(848 Views)

Hi Ben,

 

It is wonderful when you guys help!

 

I am very new to this LabView World and sometimes I'm more confused than my previous confusion when I receive help. ;o)

 

What bit are you talking about then I can pretend I'm doing something right to the right bit ;o)

 

Thanks for getting back!

0 Kudos
Message 17 of 26
(844 Views)

Looks crazy, but I'm trying to do this and send the info to the Slew of a Stepper Motor.

 

screenshot_2039.jpg

0 Kudos
Message 18 of 26
(841 Views)

Like this!

 

I see what you are saying now.

 

screenshot_2040.jpg

0 Kudos
Message 19 of 26
(838 Views)

Two recommendations...

 

On the string palette >>> Number/string conversion

 

You can find functions to covert numbers to strings. That will let you get rid of the format as spreadsheet... construct and wire directly to the slew sub-VI.

 

Has anyone told you about State Diagrams yet?

 

 

See here.

 

You can find the tutorial for the State Diagram Editor here.

 

I bring that up because when you start to move beyond "doing something repeatedly in a loop" and start introducing conditions and other complexities, the SDE will let us work at a high-level to work out what we want to do and under what conditions and THEN we can go back and add the code and logic that we need to do what each state should be doing.

 

Have fun!

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 20 of 26
(835 Views)