LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control button in VI doesn't work

You have one VI that is called in every event structure.  SubLEDControl.vi.

I suspect that VI is not complete in one event before it is being called in another event.  That's why everything works properly when missing subVIs are deleted, as suggest by Wiebe.

Again as already stated, you only need one event structure if your program has a proper architecture. 

Your block diagram is too large.  Consider moving some of the repetitive code into subVIs.

The sequence structure is not needed.  Use the error lines to enforce a proper execution order.

Don't write to local variables in one sequence frame and the read from them in the very next sequence frame. 

 

aputman
0 Kudos
Message 11 of 18
(995 Views)

And of course.... Do some (free) courses... Pretty sure most things mentioned here are in there.

0 Kudos
Message 12 of 18
(974 Views)

Could you please send to me this event which works fine in your event configuration? I am confused on how to handle these multiple events in one event. 

0 Kudos
Message 13 of 18
(956 Views)

I think you would benefit from a state machine template.  I recommend JKI state machine.  This link is the developer's GitHub page where he has some usage videos posted.  Can be downloaded for free using VIPM (which is also developed by JKI).  This template will give you a good base platform for developing your application.  

 

Word of advice...don't put a bunch of long-running code into the event structure.  Use the event structure to tell the state machine what to do.  Your sequence structures can be broken down into different states.  Clicking probe 1 button could call a macro that queues up states 1, 2, & 3.  Probe 2 button would queue up states 4, 5, & 6. When the state queue is empty, the state machine will go back to IDLE and wait for other events to occur.  Simple yet very elegant.  

aputman
0 Kudos
Message 14 of 18
(943 Views)

@michaelsteffens wrote:

Could you please send to me this event which works fine in your event configuration? I am confused on how to handle these multiple events in one event. 


Have you read anything about the use of event structures? Take a look a the information here

0 Kudos
Message 15 of 18
(929 Views)

I already read it. Is there any short way to change multiple events into single event? 

0 Kudos
Message 16 of 18
(902 Views)

@michaelsteffens wrote:

I already read it. Is there any short way to change multiple events into single event? 


The events have to 'match'. You can't put a filter and a non-filtering event together (e.g. a mouse down? and a pane resize) in one case. Otherwise:

+ "Add Events Handled by This Case", then press "Add event".

+ Dynamically register the controls for the event(s).

 

Not sure what you've read, but this should be in there somewhere.

 

There's no way to merge your existing event cases with another event structure. You'll have to copy paste and then rewire manually.

0 Kudos
Message 17 of 18
(886 Views)

@michaelsteffens wrote:

I already read it. Is there any short way to change multiple events into single event? 


You're not putting multiple events into a single event. You're putting multiple events into a single event structure which weibe@CARYA has already described.

0 Kudos
Message 18 of 18
(874 Views)