LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I raed and write into an array simultaniously?

Solved!
Go to solution

Hello friends;

 

My application is such that I am continuously acquire data form an oscilloscope, process it and show it on graph. oscilloscope is continuously writing data into an array. This array data I have to use in a processing block. I am seeing that data is not passed from this array to the processing block. What I conclude that we can not simultaneously read and write into an array. If this the problem then how to fix this problem. I mean continuously acquiring and processing the data.  

Vipin
0 Kudos
Message 1 of 23
(4,217 Views)
If you have two parallel tasks running, one for reading the data and one for processing, I would recommend that you do not use the same array for both tasks. You should use a queue to pass the data from your acquisition task to the processing task. Using the same array will lead to race conditions unless you put code around it to protect against that. However the native queue already has that protection not to mention you will be working on two distinct sets of data.
Message Edited by Mark Yedinak on 12-15-2009 11:47 PM


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 23
(4,213 Views)

thanx for response but taht too is not helping. I am attaching VI. you can see that peak detector's output is fed to the processing block inside the for loop. When I am using this VI in signal express, "MCA data" array is not getting updated. I am able to see the data upto "Amplitude" array but not beyond that. Also in signal express MCA data is not being shown as an output node, while I have connected it to the connector pane.  

Plz help 

Vipin
Download All
0 Kudos
Message 3 of 23
(4,187 Views)
In labview also its not getting updated.
Vipin
0 Kudos
Message 4 of 23
(4,186 Views)

Hi number,

 

you missed the complete concept of dataflow... Please go through the free online courses on NI's website!

 

Ever heard about shift-registers? Race conditions? Using auto-indexing? As it doesn't seem so: RTFM!

 

Why do you use auto-indexing in the for-loop and wire the count input too? Why do you wire N+1 to the count input when your input array only has N elements?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 23
(4,178 Views)
changed VI just a little bit...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 23
(4,173 Views)
thanx for response. But the file you attached is of later version of Labview. I am using labview 8.6. Can u please attach the screenshot of the circuit. thanx 
Vipin
0 Kudos
Message 7 of 23
(4,168 Views)

vi.png

Here you go...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 23
(4,167 Views)
Solution
Accepted by Vipin_Saklani

Many many congrats to "Proven Enthusiastic "

 

finally got the problem solved.

 

I hope will get to learn from u in future too.

thanx 

Vipin
0 Kudos
Message 9 of 23
(4,152 Views)
And why do you mark your own answer as solution?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 23
(4,147 Views)