LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data collision

Hi guys, i just started using labview 2009 one week ago and am trying to wirte a simple program which can read a .txt file in real time. The .txt file is writen in real time by another program. My program functions but from time to time the value jumps suddenly and produce a weird graph or the graph "black out". My best guess is that there is a collision of data when i try to read the file through labview, at the same time the file is being written by the other programm.

 

Any idea i can prevent this from happening? i did not find any helpful post though, would be glad if anyone has an idea or point me to a solution.

0 Kudos
Message 1 of 8
(3,377 Views)

Where did this other program come from?  In general, it is a really bad idea to pass data around via a file continuously.  Are you able to alter the other program to communicate over TCP instead?  Another option is to lock the file so that only one program can access it at a time.


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
Message 2 of 8
(3,363 Views)

Are you really using a real time Operating System?  On a PXI chassis?

It's not a good ideal to read and display data in real time.  That's usually a task for the host computer running Windows OS.

 

 

George Zou
Message 3 of 8
(3,356 Views)

Check data if they are valid before displaying them, otherwise read on the next iteration from the previous position. You can control file read position with Advanced file functions -> Set position and number of bytes to read.

 

For example, get file size and assume that the last chunk (point or number of points source writes at one time) of data is not valid and do not read it.

Message 4 of 8
(3,343 Views)

@crossrulz wrote:

Where did this other program come from?

Are you able to alter the other program to communicate over TCP instead?  


 

The other programm is something like one working with arduino projekt. Its saves data to the .txt file and i wanna interpret and display the data in graph. I am trying to get in touch with the person who wrote it. 

 

And no. Its not PXI Chassis, i am not sure what that is though.

 

0 Kudos
Message 5 of 8
(3,309 Views)

@Alexander_Sobolev wrote:

Check data if they are valid before displaying them, otherwise read on the next iteration from the previous position. You can control file read position with Advanced file functions -> Set position and number of bytes to read.

 

For example, get file size and assume that the last chunk (point or number of points source writes at one time) of data is not valid and do not read it.



i've tried both of the function. The same problem exist too. too bad.

0 Kudos
Message 6 of 8
(3,301 Views)

@WeiZhuang wrote:

And no. Its not PXI Chassis, i am not sure what that is though.


Who said anything about PXI?  I said TCP.  It is the bottom software layer of the internet.  But you can use TCP to have two programs on the same computer communicate with each other.

 

 


@WeiZhuang wrote:

The other programm is something like one working with arduino projekt. Its saves data to the .txt file and i wanna interpret and display the data in graph. I am trying to get in touch with the person who wrote it.


If you could get the command structure to the Arduino, you could just do it all on your own (recieve the data and plot it).


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
Message 7 of 8
(3,292 Views)

 

Who said anything about PXI?  I said TCP.  It is the bottom software layer of the internet.  But you can use TCP to have two programs on the same computer communicate with each other.


 

 

sorry, i mistaken urs with the other comment.

 


If you could get the command structure to the Arduino, you could just do it all on your own (recieve the data and plot it).



Yea. that is my plan b for now. But it will be much easier i think if i can just do it (plan a) in labview. Is there another better solution?

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