取消
显示结果 
搜索替代 
您的意思是: 

store data in array just when there is data.

已解决!
转到解答

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

0 项奖励
1 条消息(共 15 条)
4,097 次查看

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

0 项奖励
2 条消息(共 15 条)
4,086 次查看

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.

 

0 项奖励
3 条消息(共 15 条)
4,069 次查看
解答
已被主题作者 amkamyab 接受

@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:

 

AppendSome.png

0 项奖励
4 条消息(共 15 条)
4,061 次查看

... and if you don't need the array during the loop, built it at a conditional output tunnel.

 

AppendSome2.png

 

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!

 

AppendSome3.png

 

 

0 项奖励
5 条消息(共 15 条)
4,056 次查看

thank you @

can you show me what must be in false case?

0 项奖励
6 条消息(共 15 条)
4,050 次查看

@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!))

0 项奖励
7 条消息(共 15 条)
4,049 次查看

may i ask you run my program  and make delay 1000 millisecond and then some times push the button and see result in array?

0 项奖励
8 条消息(共 15 条)
4,043 次查看

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.

0 项奖励
9 条消息(共 15 条)
4,040 次查看

@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?

0 项奖励
10 条消息(共 15 条)
4,028 次查看