LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw by hand onto x/y-graph

Solved!
Go to solution

There is a board dedicated to version conversion:

https://forums.ni.com/t5/Version-Conversion/bd-p/VersionConversion

 

Post the VI or a link to this thread there and someone will convert for you...

LabVIEW 8.5.1 - 2018 Pro Dev
0 Kudos
Message 21 of 28
(174 Views)

Hi Mr altenbach.

 

 

What you are putting forth is very nice. I´m new to these event structures but I can understand them a little.

 

I´ve managed to get in the properties of the boolean when you say you need to press ENTER to start, how you did it (key navigation).

 

The one thing that I don´t get or can´t find out where you got it is the star looking controls that you need to press (up or right) to tell the Front Panel that it needs to start drawing.

 

The only thing I have been able to come up with is making a property node of the the cursor elements (all elements) and make them into a control.

 

 

I know this post is from two and a half years ago, but can you provide some insight into this. If I´m able to find the solution, I´ll answer my own post.

 

 

Thanks a lot for this vi.

0 Kudos
Message 22 of 28
(120 Views)

@mcrelectronica wrote:

The one thing that I don´t get or can´t find out where you got it is the star looking controls that you need to press (up or right) to tell the Front Panel that it needs to start drawing.


Are you talking about the diamond controls? These are part of the graph and become visible if you do a "right-click...visible items...cursor legend". You don't need to press any of these to start drawing, just move the cursor with the mouse directly (after pressing the green LED or <enter>).

 


@mcrelectronica wrote:

The only thing I have been able to come up with is making a property node of the the cursor elements (all elements) and make them into a control.


Maybe I don't understand what you mean by "the only thing", but you already did a couple of other things described above. Why would you need a property node for cursor elements? It is not part of my code and not needed here.

 


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 23 of 28
(107 Views)

Also note that my code is a quick modification of the relatively clumsy original code posted.

 

Depending on what you want to do, there are better ways (e.g. draw a straight line between mouse-down and mouse-up positions)


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 24 of 28
(105 Views)

@altenbach wrote:

Are you talking about the diamond controls? These are part of the graph and become visible if you do a "right-click...visible items...cursor legend". You don't need to press any of these to start drawing, just move the cursor with the mouse directly (after pressing the green LED or <enter>).

Thanks for your super fast reply.

 

I see now that the visible items menu was used to "make visible" that diamond shape menu. I first started using those diamond shaped icons to move the cursor, that´s why I asked.

 

One thing that I´m looking into is how you are able to change the behaviour of the cursor from selecting it to drawing. I think the drawing option is what you do in the true case, apparently it does this drawing by assigning the new position of the cursor in the XY Graph. In the false case, you don´t do this, so maybe that instance is what makes the cursor make the free hand drawing.

 

I know why you placed the cursor at the coordinates 1,1.  I modified it to 0,0 and the cursor looks like it´s not there (it is, but at the lower left corner and it gets lost visually).

 

 

 

 


@altenbach wrote:

Maybe I don't understand what you mean by "the only thing", but you already did a couple of other things described above. Why would you need a property node for cursor elements? It is not part of my code and not needed here.

 


There is a Cursor.Position outside of the while loop. I tought that was for writing the x,y positions of the mouse pointer.

 

 

 

0 Kudos
Message 25 of 28
(88 Views)

@altenbach wrote:

Also note that my code is a quick modification of the relatively clumsy original code posted.

 

Depending on what you want to do, there are better ways (e.g. draw a straight line between mouse-down and mouse-up positions)


This draw straight line would be nice, but it dissapears every time one does a line. I would like for the vi to keep the drawn line. Also, I would like to make free hand lines and symbols so, the other .vi will suffice.

 

 

No I´m going to modify the .vi so that when you clear the image, it returns the cursor to the 1,1 location.

 

 

I´m just starting the LabVIEW Core 1 course, after maybe 10 years or so of using on and off LabVIEW (more to the off side of things), and just found out about these event structures (which are great, by the way). I only used the flat sequence when trying to make LabVIEW make actions in a certain way. Then I found out about state machines.

 

What I´m trying to say is that it might be very simple to achieve this, but at the moment, it´s not that easy for me. Although, in my defence, I do try to do reasearch before posting a question (that´s how I came across this thread).

 

RTFM is kind of my mantra... it hurts a bit when it gets applied to me     Robot Very Happy

0 Kudos
Message 26 of 28
(84 Views)

I actually found the LLB that contains all the old Event Structure examples.  There is a VI in there called "Draw Graph with Events.vi" that should get you started.  the other ones are also good to introduce you to events.

 

EDIT: To give credit, I'm pretty sure this is where I found it. Smiley Happy

https://forums.ni.com/t5/LabVIEW/open-a-graph-in-a-new-page-by-clicking-on-it/m-p/2513080#M764600

LabVIEW 8.5.1 - 2018 Pro Dev
0 Kudos
Message 27 of 28
(51 Views)

Thank you very much. 

 

I´m half way into Core 1.   I saw that Core 2 introduces Events.

0 Kudos
Message 28 of 28
(26 Views)