08-02-2018 12:51 PM
Hello everyone
i have a program in follow that i want save data in array just when the Boolean is on. i don't want array recording data when the Boolean is off.
can any one help me please?
i use labview 2018
Solved! Go to Solution.
08-02-2018 01:10 PM
Rather than using "Insert into Array", you should be using Build Array. Build Array is easier to use if you know you are always putting the element at the beginning of the array like you are doing now (is that what you really want?), or at the end of the array.
When you want to selectively do something, you put that code in a case structure!
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
08-02-2018 01:56 PM
Thanks for answer
what i want is like this:
just when i press boolean button, store a record in array. but it is not working like that and even when i dont press botton, array continue recording.
please see the picture.
08-02-2018 02:09 PM
@amkamyab wrote:please see the picture.
Your problem is in the diagram, not the front panel, so why would you show a picture of the front panel??? We cannot troubleshoot that. We need to find the cause, not the effect!
Here's one simple possibility:
08-02-2018 02:17 PM
... and if you don't need the array during the loop, built it at a conditional output tunnel.
Of course it seems completely pointless to create a potentially large array where all elements are the same. How redundant! That array can be described by a single integer! Maybe you could just keep count and create that array at the end in one swoop!
08-02-2018 02:21 PM
thank you @altenbach
can you show me what must be in false case?
08-02-2018 02:22 PM
@amkamyab wrote:can you show me what must be in false case?
Can you take a wild guess???
(In the false case, nothing should happen to the array, so it would be just wired across unchanged, right? You really need to start with some basic tutorials before continuing!))
08-02-2018 02:27 PM
may i ask you run my program and make delay 1000 millisecond and then some times push the button and see result in array?
08-02-2018 02:32 PM
this helped me. thanks
may i ask you another question.
i want to record time of each data in array that i can see delay between pushing buttons.
08-02-2018 03:16 PM
@amkamyab wrote:may i ask you another question.
i want to record time of each data in array that i can see delay between pushing buttons.
Well, this thread is already marked as solved, so maybe you should start a new thread with a new question.
There is only one button, so why do you say "buttons"? (Do you also want to record the stop button?)
Your question is not clear at all. Do you want the "On-times", the "OFF-times", the time between OFF-ON (or ON-OFF) transitions, or the times between value changes of the boolean, ... or something else? What mechanical action do you want (switch, latch, switch until released, etc.)? How should the times be stored? What time resolution do you need?