LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

building array through user boolean input

I need to be able to use a linear encoder to take measurements for starting and stopping points in a system. Basically just a 2d array.

I need the current value of the encoder to be placed in the array by the user clicking a button (or preferrably hitting a key). Then depending on which button is clicked, it gets assigned an index of either 0 or 1.

Im having problems trying to get the array to update only when the button is pressed (or rather the instant its released).

Any suggestions?
0 Kudos
Message 1 of 5
(2,793 Views)
Since you want to detect which button was clicked, the best way is probably using an event structure with a mouse down (or up) event and using the replace array subset (or insert into array) in it. Your description is a bit vague, but I think this is the answer to your question. If this doesn't help, please write more details, and if possible, post your code.

___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(2,782 Views)
Part of the reason Im asking is because Ive never used arrays like this in labview (or event structures like you mentioned). I used it in college but Im a bit rusty right now.

I dont need anything fancy, in fact something as simple as having a constant value that is entered into an array whenever a button is pressed would suffice for an example.
0 Kudos
Message 3 of 5
(2,779 Views)

Here's an example. It's far from perfect, but it's the basic idea.
To learn more, I suggest you search the example finder for events.
In general, you should read the LabVIEW user manual. Also, try searching this site and google for LabVIEW tutorials. Here is one you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide.


___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(2,777 Views)
looks like that'll do the trick if I use two instances of that and create a start point array and an endpoint array.

Thanks for the help.
0 Kudos
Message 5 of 5
(2,769 Views)