LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing into global variable in RT

Hi,

 

Trying to write an array of 1,000,000 guys into a 1D array global variable and call the variable in the host to save the data into a file, the data is not being transferred safely. The attached figures show the method that I am using. I probed the data stream and it shows the correct values as shown in the left side of the figure 1, but when I call the variable in host and write it into a text file, it does not show the data. Does anyone have any solution for this problem?

 

Thanks,

Masoud

Download All
0 Kudos
Message 1 of 5
(2,970 Views)

since noone answered you yet, i venture a guess:

 

i suppose, that you hit a buffer limit of your shared variable,

and or that you try to read faster than it takes to update the variable.

 

but i really don't think you should use network shared variables this way.

did you try the stability with very much smaller data?

when does it start to break?

 

you may read up on your alternatives here

https://www.ni.com/docs/en-US/bundle/labview/page/data-communication-methods-in-labview.html

 

perhaps someone with actual experience and knowledge of the interna chimes in


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 2 of 5
(2,917 Views)

Network Published Shared Variables are truly evil!  Your biggest problem is you are using the wrong transfer mechanism.  You want a Stream interface (fast, continuous data) and you used a Tag (single value, updates irregularly).  Use a Network Stream to send your data.  And the writing to the stream should be done inside of you loop.

 

On the read side, you will want to avoid the Write Delimited File.  Instead, open the file before the loop and close it after the loop.  Inside the loop, read part of you data stream, format the data with Array To Spreadsheet String, and write the file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(2,906 Views)

jwscs,

You are right about the buffer limits on Network Published Shared Variables. It transfers up to 16300 numbers of data safely. I am looking into Network Stream to see if I can solve the issue.

Thanks,

Masoud

0 Kudos
Message 4 of 5
(2,870 Views)

KNIGHT OF NI,

Thank you. I am looking into Network Stream to see if I can solve the issue.

 

Thanks,

Masoud

0 Kudos
Message 5 of 5
(2,869 Views)