07-10-2012 07:23 AM
Hallo everyone,
I need help regarding NI example programs: niScope Fetch Forever, Write TDMS & Read TDMS.
When I try to fetch continuously and save the data in TDMS file, its working fine, but when I try to read the data back to Labview (or convert them to .txt or .csv),
I'm having memory problem when I have too big TDMS data to read at once.
Is there any trick to split them first then read them?
The problem is, Read TDMS.vi doesnt know automatically how big the data being stored in .tdms file which being read.
I think I need to use FOR loop and offset and count as control in TDMS read block, then convert them into csv. or .txt using index number for the created files.
Example of what I'm trying to achieve; I'm having 20,5millions datas in an array in example.tdms, then I would like to have 6 files with 3 millions datas, and 1 file with 2,5 millions datas, which means I need to split them.
The other problem is, I'm trying here to get total points fetched2 to be O when I start the program, then increase when I hold the save button. In this program, I dont get it back to O when I keep my SAVE button TRUE all the time.
Please, any help would be really appreciated.
regards,
Yan.
Solved! Go to Solution.
07-10-2012 09:10 AM
I would use a while loop, read n samples every time.
If the number of read samples is smaller than n, then I quit the while loop.
Here's a small example:
Ton
07-10-2012 09:10 PM
You can use "NI_ChannelLength" to get the number of values in a channel.
07-11-2012 04:26 AM
@TCPlomp
thanks ton, thats a simple but nice idea from you. Do you think I can create .txt or .csv file at the same time without having memory problem?
It would seem that creating multiple files at once wouldn't be problematic? (*haven't tried myself)
@deppSu
thanks for replying, but can you more spesific directing me, I don't know where to find "NI_ChannelLength".
regards,
Yan.
07-11-2012 07:06 AM
@TCPlomp
hi ton, seems your method somehow doesn't work on me. It keeps saying: "End of File found".
Seems like I couldn't split the data being read using your method on me.
regards,
Yan.
07-11-2012 08:48 AM - edited 07-11-2012 08:48 AM
hi everyone,
I've just found something useful while browsing example codes in this forum.
I've found this example and I think it's pretty much like what I need (https://decibel.ni.com/content/docs/DOC-8985).
But still, using this example still gives me the same error code "EOF found".
I don't know where is my problem, maybe the way I'm writing data into my TDMS file in Fetch Forever.vi?
Or maybe the TDMS file which I build here is not ok to read?
regards,
Yan.
07-11-2012 08:56 AM
OMG nevermind,
I just forgot to put the same name that I used in write TDMS.vi (Groupname&Channelname) into my read TDMS.vi.
So, I think the solution is that example code (https://decibel.ni.com/content/docs/DOC-8985) combined with a little more careful analysis.
Thank you very much,
regards,
Yan.