LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data fill in consecutive array elements

Hello all , 

i have a small puzzle and mess up with a 1 program 

i have attached a VI. 

When the user enters a data for a first time in  "Data1 " and "data 2 " it needs to fill on the zeroth element of an array. When the user enters a data for the second time in  "Data1 " and "data 2 " it needs to fill on the first element of array .

 thanks in advance !!

0 Kudos
Message 1 of 6
(1,856 Views)

On the first page of the Forum, there is a section for Learning LabVIEW Basics.  One of the things they discuss is Arrays and how they work with For and While loops, something called an Indexing Tunnel.  This is very elementary LabVIEW -- learn it and you will know how to solve this (almost trivial) problem.

 

Bob Schor

0 Kudos
Message 2 of 6
(1,839 Views)

Hello bob , 

ya, i have to strengthen the base. . there is no doubt in that . i was begineer in this . 

Did you see the attached VI ?

the program have to go on.. until the user closes the VI 

0 Kudos
Message 3 of 6
(1,835 Views)

@Mrtechie wrote:

the program have to go on.. until the user closes the VI 


Very early in Beginning LabVIEW for Users with No Experience At All, you learn how to have LabVIEW code "go on" until the User "does something" (but not "closes the VI").  Hint -- it should be in one of the first three Lessons (I'm saying this without even looking, but if you write back and say "I spent 3 hours reading all of the Material in Learn LabVIEW and I still don't see how to do any of this", I will be simply amazed!

 

Bob "Put A Little Effort Into Learning!" Schor

0 Kudos
Message 4 of 6
(1,814 Views)

Hello Bob,

Basic indexing i know !  i think I confused everyone here.

I will tell the Application, which runs for few cycles... 

Data 1 is X value of the  Graph and data 2 is Y value of the Graph. After the plot occurs the user will grab the X & Y value ( cursor value ) every time. so I am designing in subvi as 2 values ( inputs )

During 1 st time the values want to fall on 0 th element of an array . after 2nd time user grabs a data means, values want to fall on the 1st element of the array . 

 

pls see the attached document 

 

0 Kudos
Message 5 of 6
(1,808 Views)

Hi bhuvanesh,

 

During 1 st time the values want to fall on 0 th element of an array . after 2nd time user grabs a data means, values want to fall on the 1st element of the array . 

Keep "the array" in a shift register.

Each time the user selects some "values" you just use BuildArray to append the "new value" to "the array"…

All you need is a loop with a shift register and a BuildArray node!

 

Please don't use proprietary file formats like obscure office documents (docx) for attachments. Use text or (real) images (PNG, JPG)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 6 of 6
(1,801 Views)