LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw by hand onto x/y-graph

Solved!
Go to solution

@NIquist wrote:

Shame that Draw Graph with Events.vi is no longer in the Example Finder.  


Yes, that was a nice one....

 

Another possibility would be to use the plot images property to design the graph with fewer points (here's an example to draw a line) and once completed map it to graph data. (using the right method)

0 Kudos
Message 11 of 28
(1,390 Views)
Solution
Accepted by Labphew

I like my program like this. I post my finished solution so that the next guy can use it. Since I am a labview newbie I expect you to find some problems with this. But it works, I like it and I've seen worse. Cheers!

Message 12 of 28
(1,365 Views)

@Labphew wrote:

 I expect you to find some problems with this.


  • Never, ever hide event structures inside case structures
  • Changing the tab control will do nothing at run time, because the terminal is read only once.
  • Using local variables instead of value property nodes is more efficient. However by using shift registers, you would not need any. Highly preferred. Try it. You can even eliminate the sequence by using proper dataflow.
  • Your code has the measles (look at all the coercion dots and type mismatches!)
  • Using an unlabeled LED as draw control does not seem right.
  • ...
0 Kudos
Message 13 of 28
(1,356 Views)

Well, it was a quick redo of what I was doing in a bigger program. The tab control was in fact supposed to be inside the while loop.  And I already fixed the data flow thing in my real program.

 

But I don't really see a problem in "hiding" the event structure in the case structure. Since everything that can trigger the event structure disappears for any user when the  tab is changed (at least that's what happening in my real program) I'd like to remirror that in the block diagram. If there is really a reason why I shouldn't do that, then I know, that I don't need the case structure. But it cleans up my block diagram and helps my successor to understand that this is only relevant for the respect tab case (so in my big program there are other tab cases where other stuff happens).  But please explain why I NEVER EVER should do that. 

 

Unlabeled LED: ... "press Enter to draw" --> you dont have to press the led you can use your Keyboard to press ENTER and I really like this. I think it's intuitive.

0 Kudos
Message 14 of 28
(1,350 Views)

Typically the tab terminal does not need to be connected to any code (or case structure), because the event structure can assume that the FP is on a certain tab from which control has been operated.

 

It is a very bad habit, for example if events are triggered for an event structure that is not in the dataflow (e.g. in a different case), they will accumulate forever in the event queue and the code has no way of ever servicing them. If the case ever switches, the oldest event will trigger which might be very stale and irrelevant.

0 Kudos
Message 15 of 28
(1,344 Views)

well my englisch seems to be to bad to understand you. Können wir Deutsch reden?

0 Kudos
Message 16 of 28
(1,350 Views)

Try Google Translate.

0 Kudos
Message 17 of 28
(1,347 Views)

Hi Labphew,

 

Können wir Deutsch reden?

this is an English forum so you should speak English too!

 

Wenn du unbedingt Deutsch reden willst, kann ich dir das deutschsprachige LabVIEWforum empfehlen. Es gibt schließlich Gründe, warum es hier bei NI.com u.a. französische, spanische, chinesische Unterforen gibt - aber eben nicht direkt auch ein deutschsprachiges:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 28
(1,339 Views)

@Labphew wrote:

well my englisch seems to be to bad to understand you. Können wir Deutsch reden?


I speak graphically, so here's a very quick draft to give you some ideas how to simplify things. Arguably less code. 😄

 

(Also be careful with mechanical actions of booleans. For example your "clear" button is "switch until released", creating two events, one for the press and one for the release. Latch action is more normal to use in almost all cases.)

 

 

 

 

0 Kudos
Message 19 of 28
(1,334 Views)

Can someone please send a LV 13 vi. Of this file

0 Kudos
Message 20 of 28
(1,050 Views)