LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

insert 1d array into 2d array step by step by clicking a button

Hello. I work on a project, whicht helps me to analyse graphs. I want to export values to only one spreadsheet  For each measurement the values will be exported to an 1D array. The analysis of the graph works by moving cursor lines. Now what I want to do is to add 1D array of each measurement to an 2D array step by step by pressing a button, so that I’m able to get a table of values of the whole graph. With every button click, a new row (n+1) with the new values of the measurement schould be created  in the 2d array. The first row schould have index 0.  If there is no measurement anymore, the content of trhe 2D array should be stored to a text file.

 

Please help me out!!!

 

Thx.
0 Kudos
Message 1 of 8
(3,104 Views)
Well, just get the cursor position and then slice out the desired 1D array and built it into a new array.
 
Attached is a simple example (LabVIEW 7.0).
0 Kudos
Message 2 of 8
(3,101 Views)

hello. thank you. it work's.

 

0 Kudos
Message 3 of 8
(3,080 Views)
hello. of course, this vi works very well, but it seems to be very difficult for my case to implement this vi because I have already implemented this vi and now the analysis doesn't work. there is a problem with the event structure. you should know that the values of the 1D array will be calculated by some calculations on the graph between two cursor lines (-> a kind of "REGION OF INTEREST"). the vi stops working without displaying an error.
 
is there any other way (without event structure) to solve this problem?
 
please help me!!!!
 
thx.
0 Kudos
Message 4 of 8
(3,070 Views)


@0123 wrote:
is there any other way (without event structure) to solve this problem?


Of course there is! 🙂 Early versions of LabVIEW did not even have an events tructure and we were still able to do anything we wanted. 😉

Could you attach your code? There are many possibilities, and it really depends on the rest of the program to decide what's best.

0 Kudos
Message 5 of 8
(3,065 Views)
hello. well, I'm not able to send you the vi because it is a secret project. that's the decision of my boss. please send me some possible examples you know. It's very important for me to complete the project as soon as possible. If you need the vi necessarily, I will try to send you a comparable simplified vi of the project.
 
thank your for your help and please send me some possible examples.
 
best regards!!!!!!
0 Kudos
Message 6 of 8
(3,053 Views)

Most likely, your modification is stuck at the event structure. Try to add an empty timeout event so the event structure does not block the rest of the code.

To get e.g. the subarray between two cursors, you could do something like in the attached modification (of course it is a bit inefficient, because it does it over and over again while the loop is running, even if the cursors do not change).

What is your LabVIEW version? LabVIEW 8.0 has events that are triggered by movements of the graph cursors. Quite useful!

0 Kudos
Message 7 of 8
(3,044 Views)

hello. thank you. of course, I've already picked out the values between the 2 cursor lines. these valures are important for me because calculations are operated on them. The results of the calculations should be combined to an 1D array and the added to an 2D array step by step (by clicking a button). So, I hope you understand my problem. The event structure does't work. I don't know why but the vi always stops working without signaling an error. I work with LabVIEW 7.1 but the final vi should be implemented on a system with LabVIEW 6.0. Please send me some other examples without using event structures but with the same functionality. It's really important for me to finish this project. Please help me!

Thank you!

0 Kudos
Message 8 of 8
(3,036 Views)