LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

new user looking for ways to reset controllers within a cluster with buttons

hi

im a new user and im completing an assignment where we have to have a cluster which contains 2 arrays, each array is technically linked but not really. the string array will correspond with the numerical array. then outside the cluster we need to display all the names that have been input in the controller within the array while the program is running, same with the numerical values. there is also a counter to count how many strings have been input, and how many numbers have been input. i put in an average for the numerical inputs for fun.

 

to put it simple
{numerical controller array, string controller array} -->  [numerical array] [string array] (average number) (number of strings within string array) with a stop button to stop the loop sequence

technically this assignment is complete as that is all we had to accomplish. but i want to add a reset button so i can reset the arrays while the program is running before i hit stop, kind of like a "clear form" kind of thing. my tutor has suggested i use an event structure but I'm struggling to understand how that would work as event structures have been showcased on a single slide so far in lectures.

this is purely for my own improvement, it will give me no extra marks, i just want to learn how to do it

0 Kudos
Message 1 of 4
(231 Views)

@LFwitch_hunter wrote:

hi
my tutor has suggested i use an event structure but I'm struggling to understand how that would work as event structures have been showcased on a single slide so far in lectures.

this is purely for my own improvement, it will give me no extra marks, i just want to learn how to do it


I suggest you to look into LabVIEW Examples which will make you understand how event works in a State Machine Machine Architecture.

Got to LabVIEW Help-> Find Examples->Fundamentals->State Machine Fundamentals.

 

Also it is always better to share the LabVIEW Code you tried so that it will be useful for others to suggest the right method.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 4
(213 Views)

Hi hunter,

 


@LFwitch_hunter wrote:

i want to add a reset button so i can reset the arrays while the program is running before i hit stop, kind of like a "clear form" kind of thing. 


You just need a boolean button on your UI (with default "latched…" behaviour), linked to a case structure in your loop.

Inside the case you either wire the cluster through (FALSE case) or write empty arrays into the cluster elements (TRUE case).

 

The cluster should be stored in a shift register tied to your loop. Is it?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(193 Views)

@LFwitch_hunter wrote:

but i want to add a reset button so i can reset the arrays while the program is running before i hit stop, kind of like a "clear form" kind of thing. my tutor has suggested i use an event structure but I'm struggling to understand how that would work as event structures have been showcased on a single slide so far in lectures.


Pressing "reset" right before stopping seems pointless, you might as well combine it with the stop button and just reset your controls after the toplevel loop. Of course more reasonable would be to reset the controls to a known default state as  first step when the program is run. (To undo any random changes made in edit mode!)

 

Another task would be to be able to reset to a defined state while running, but I really doubt you would need an event structure for that.

 

What is the current program architecture? That will determine the best solution. Programmatic modifying control values is typically done by writing to local variables.

0 Kudos
Message 4 of 4
(163 Views)