meiyan wrote:
如题,我可以按顺序显示文件中的数据,当读完最后一个数字,怎样可以让程序返回数据第一个接着重新读数据。
What kind of data file you are reading? Why do you need to keep on reading the file?
So, you have a tab-delimited values file, and you want to read and display them one value at a time? till the last value. Then, repeat the same? Does the values change? If so, when does it changes?
How about reading the file once, convert the tab-delimited values to array, passing the array to a for-loop, auto-index the array to display the elements (values) one at a time. And, repeat.
As of how to convert tab-delimited data to array, please read this thread.
If not, please kindly describe in detail about what exactly you want to do with the file and its data. ya.
i have a tab-delimited values file, and i want to read and display them one value at a time till the last value. Then, repeat the same.
Do you think there will be a way to let it like ,after reading all values ,it wait for a while,when there is no new values come inside the file ,it repeat the same file value,if there is new value come inside the file ,it continue updating the new value?
Hi Meiyan,
The attached reference code is coded in consideration of the tab-delimited file cannot left opened during displaying of data since your (data) producer might be updating the file. Hence, Read Characters From File is used.
Please also take precautions at when the code is reading the data file as your (data) producer might be updating the file at the same time frame.
I am not going to explain what the code does here, please take a look at the block diagram (and remarks).
PS: This code is a very rough one and it is for reference purposes. Hope you may modify to suit your needs 😉 You may try enter new data and save them during display's runtime...
关键是判断“读完最后一个数字”。我记得LabVIEW读取函数一般有个“EOF”输出(像TDMS Read和读取
测量文件Express就有“EOF”的输出),如果读完了最后一个数据,EOF就会返回逻辑值1,否则返回0。你
可以利用while循环或事件结构来查询“EOF”的输出逻辑值,从而实现“让程序返回数据第一个接着重新读数
据”的目的。