How to read a part of a TDMS file?
Hi,
I'm having problems loading back a part of a TDMS file.
Im currently trying to use the offset and count input on TDMS read.
But the offset value doesn't seem to make any difference: If I set offset to 5 and count to 10 it still puts out 10 data points.
By the way:
Im using labview 8.5, and I multiply the offset and count with the sample rate (100000samples/s) so that offset and count settings input will correspond to seconds of measurement to load.
I would be very grateful for any help
Regards
Carl Zandén
Attachments:
Load part of TDMS file.jpg 165 KB
I am new to TDMS as well so take what I say with a grain (block) of salt. But as no one else has answered, I'll give it a shot. First of all, at 100000 S/s and an input for COUNT of 10 X 100000, you will always get 10 seconds worth of data. Your graph is not showing you 10 data points, it is showing you 10 seconds OF data. This is expected behavior. By varying the OFFSET input as you have it you will step through your data 5 seconds (5 X 100000 points) at a time. So, for IN offset =0 you will see data from 0 to 10 seconds, for IN offset =1 you will see data from 5 to 15 seconds, for IN offset =2 you will see data from 10 to 20 seconds, etc. You also will probably NOT see the X scale change accordingly as it has no way to know what the initial time of your data set is, unless you tell it. All it knows is that it has a set of 1M data points with a 1e-6 second delta t.
Hope this helps.
Roy
Similar Messages
-
How can I extract part of a PDF file and copy it to a new PDF file?
How can I extract part of a PDF file and copy it to another PDF file?
You will need Adobe Acrobat for this.
-
How to read the and Write the PDF file give me the solution
Hi all,
How to read the and Write the PDF file give me the solution
My coding is
import java.io.File;
import com.asprise.util.pdf.PDFImageWriter;
import com.asprise.util.pdf.PDFReader;
import java.io.*;
import java.io.FileOutputStream;
public class example {
// public example() {
public static void main(String a[])
try
PDFReader reader = new PDFReader(new File("C:\\AsprisePDF-DevGuide.pdf"));
reader.open(); // open the file.
int pages = reader.getNumberOfPages();
for(int i=0; i < pages; i++) {
String text = reader.extractTextFromPage(i);
System.out.println("Page " + i + ": " + text);
// perform other operations on pages.
PDFImageWriter writer = new PDFImageWriter(new FileOutputStream("c:\\new11.pdf"));
writer.open();
writer.addImage("C:\\sam.doc");
writer.close();
System.out.println("DONE.");
reader.close();
catch(Exception e){System.out.println("error:"+e);
e.printStackTrace();
I get the pdf content then it returns the string value but ther is no option to write the string to PDF, and we only add a image file to PDF,but i want to know how to wrote the string value to PDF file,
Please give response immtly
i am waiting for your reply.
thanks,
Suresh.GI have some question flow
How library to use this code.
I try runing but have not libary.
Please send me it'library
Thank you very much! -
How to read the content of a text file (by character)?
Guys,
Good day!
I'm back just need again your help. Is there anyone knows how to read the content of a text file not by line but by character.
Please help me. Thank you so much in advance.
Jojohttp://java.sun.com/javase/6/docs/api/index.html
package java.io
InputStream.read(): int
Reads the next byte of data from the input stream.
Implementation:
InputStreamReader
An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted. -
Help on how to read the content of an XML file from the payload
I have a receiver channel / mail adapter, that sends e-mails with a XML attachment.
Im trying to write a Bean, that should make it possible to rename the attached XML file dynamically.
In the Bean I want to read the content of the attached XML file, it could be the order number.
The filename should then be Order number.XML.
<u><i>Can anyone help me with how to read the content of the XML file from the payload.</i></u>
<i><b>Frank</b></i>hi,
check this: http://jakarta.apache.org/poi/ -
How to read the content of ms-word file use pure java???
how to read the content of ms-word file use pure java???
hi,
check this: http://jakarta.apache.org/poi/ -
How can read/write FORMSWEB.CFG & DEFAULT.ENV file entries programatically?
Environment: Forms 9i (Web)
As : Oracle 9i As
How can read/write FORMSWEB.CFG & DEFAULT.ENV file entries programatically?I guess you cannot. There is an enhancement request to get the name of the config-section as a GET_APPLICATION_PROPERTY.
What you could do is add extra parameter(s) to your form and pass the necessary formsweb.cfg parameters in this form parameter. See Get formsweb.cfg section name in Forms for more info and an example. -
How to read contents of more than 2 files.
hi all
help me.
How to read contents of more than 2 files.
For reading a file contents we uses normally FileInputStream
For reading two file contents we uses normally SequenceInputStream
But which class we have to use for reading contents of more than 2 files at a time
thanks in advance.SequenceInputStream can be used for reading any number of input streams (not at once, but one after the other).
This involves making an Enumeration that returns the input streams you want to read. Depending on what you want to do, it might be just as easy to read them one after another.
Or consider making a Vector of your input streams and using its elements() method. Like this:(untested)Vector<InputStream> inVec = new Vector<InputStream>();
inVec.add(new FileInputStream("foo.dat"));
inVec.add(new FileInputStream("bar.dat"));
inVec.add(new FileInputStream("baz.dat"));
// later...
SequenceInputStream in = new SequenceInputStream(inVec.elements()); -
How to read SYstemstate level 266 dump trace file?
Hi I have simple question regarding documentation availability.
How to read SYstemstate level 266 dump trace file?
I tried googling it but didnt find any good article?Hi,
It is supposed to graph frequency content vs time, and the display I get comes all black. Look at the attachments for the load state, the first one is the legacy SW and the second one is the modified one.
I put probes on them, and the legacy one gets the 250,000 from the Value embedded. The modified one it is supposed to get it from the sample rate path, please let me know if this is enough info, thanks.
LabVIEW Intermediate I level!
Attachments:
sample rate-load state legacy.JPG 174 KB
sample rate-load state modified.JPG 198 KB -
How to read iCal events from SQLite Cache file?
I need to figure out how to read event entries in the Cache file stored in /Library/Calenders/ as my actual events have been corrupted due to a file system problem. The example below shows the information I have for each entry, where the event in the entry was Bon Jovi Concert, however I am confused how I can read the date and time of the event, information I believe is stored as 218215639,219613081,219524400,219540600. Any help is greatly appreciated.
INSERT INTO "ZCALENDARITEM" VALUES(0,NULL,0,NULL,0,5,NULL,6,4039,NULL,0,0,0,0,0,0,2,23,0,0,0,0,6,0,21821563 9,219613081,219524400,219540600,NULL,NULL,NULL,NULL,NULL,'local_AFB8D342-2DAE-4F A1-A9A6-3FA9B28B5C7C','Bon Jovi Concert',NULL,NULL,NULL,'Europe/London',NULL,'0E17BBB6-0E76-4024-8DD7-60E43D38D 35B');OK, here we go ... I hope. I have tried it on my iCal, with about 2000 entries, and it worked. I cannot guarantee that it will work for you.
Make a new text file from sql as before, but using this modified command to get additional data for each event:
sqlite3 Desktop/Hope 'select ZSTARTDATE, ZCALENDARITEM.ZTITLE, ZENDDATE, ZNODE.ZTITLE, ZISALLDAY, ZRECURRENCERULE, ZISDETACHED from ZCALENDARITEM inner join ZNODE on ZCALENDARITEM.ZCALENDAR = ZNODE.Z_PK where ZSTARTDATE not null' >hope.txt
I suggest you make a new user account, then copy the text file hope.txt and the script to the Public/Drop Box folder for that account. Log on to the new account and copy the two files from the drop box to the Desktop. Start iCal and make new calendars to match those in your ordinary account. Double click the script to open it in Script Editor and CHANGE THE DATE RANGE in the "set ThePeriod" line. Stand well back and click the run button. Every 50 records processed it will pop up a progress box, which will pop down again after a second. Go for lunch.
When it is finished see if things look OK in iCal. If they do export each of the calendars, copy them to the drop box of your normal account and return to your normal account to import them.
If there is an error make a note of the error message and line number, find that line in the text file, and post it here with a couple of lines either side.
Note that for recurring items iCal normally only makes a single event, the first occurrence, then uses a recurrence rule to calculate if the event should be displayed in the current window. If there are any recurring events in the period you have selected where the first occurrence is before the period they will not be recreated. Where however you have changed a single occurrence of a recurring event iCal makes a new, detached, event. Any of these in the period will be detected. If their original event was also in the period they will now appear in the iCal display as duplicates. For easy spotting of these, I have prefixed "XX-" to the title of any detached events.
AK
<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">on run
set ThePeriod to {date ("jan 1 2008"), date ("dec 31 2008")} --CHANGE THIS BEFORE RUNNIN
set TheFile to open for access (path to desktop as text) & "temp.txt"
set TheContents to read TheFile --until return
close TheFile
set TheLines to paragraphs of TheContents
set OldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"|"}
set LCount to 0
set ACount to 0
set RCount to 0
set DCount to 0
set SCount to 0
set HowMany to (count of TheLines)
try
repeat with ThisLine in TheLines
if (count of ThisLine) is 0 then exit repeat
-- Start Date, Title, End Date, Calendar, All Day, Recurs, Detached
set LCount to LCount + 1
set Details to text items of ThisLine
set MyStartDate to FixMyDate(item 1 of Details)
set MyTitle to item 2 of Details
set MyEndDate to FixMyDate(item 3 of Details)
set MyCalendar to item 4 of Details
set MyAllDay to item 5 of Details
set MyRecurs to item 6 of Details
set MyDetached to item 7 of Details
if MyAllDay is "1" then set ACount to ACount + 1
if (count of MyRecurs) > 0 then set RCount to RCount + 1
if MyDetached is "1" then set MyTitle to "XX-" & MyTitle
if MyDetached is "1" then set DCount to DCount + 1
if (MyCalendar is not "Birthdays") and (MyStartDate ≥ item 1 of ThePeriod) and (MyStartDate ≤ item 2 of ThePeriod) then
tell application "iCal"
tell calendar MyCalendar
set ThisItem to make new event at end of events with properties {summary:MyTitle, start date:MyStartDate}
end tell
tell ThisItem
if MyAllDay is "1" then set allday event to true
if (count of MyRecurs) > 0 then set recurrence to MyRecurs
set end date to MyEndDate
end tell
end tell
else
set SCount to SCount + 1
end if
if (LCount mod 50) = 0 then
set the_message to "Processed " & (LCount as string) & " of " & (HowMany as string)
display dialog the_message buttons {"Cancel"} giving up after 1
end if
end repeat
on error TheError
display dialog "Error: " & TheError & " about line " & LCount
end try
set AppleScript's text item delimiters to OldDelim
display dialog (LCount as string) & " lines processed" & return & "All Day: " & (ACount as string) & return & "Recurs: " & (RCount as string) & return & "Detach: " & (DCount as string) & return & "Skipped: " & (SCount as string)
end run
on FixMyDate(MyDate)
date (do shell script "date -r " & MyDate & " -v+31y +%e'/'%m'/'%y' '%T")
end FixMyDate
</pre> -
How to write Date/Time property of tdms file
On the root page of the tdms file, there is a built-in property called "Date/Time" in the first row.
I would like to use it to save the time stamp when the tdms file is created. But in the help file,
I only find the following property constant. So, how can I write to the "Date/Time" property field?
Property
Constant
Data Type
Name
TDMS_FILE_NAME
String (char *)
Description
TDMS_FILE_DESCRIPTION
String (char *)
Title
TDMS_FILE_TITLE
String (char *)
Author
TDMS_FILE_AUTHOR
String (char *)
Thanks for any idea or suggestion.
Solved!
Go to Solution.Not sure if this is exactly what you want, but have you tried this?
CVIAbsoluteTime CVItime, *t = NULL;
TDMSFileHandle deH = 0;
// Create TDMS file and set some properties
errChk (TDMS_CreateFileEx (file, TDMS_Streaming2_0, TDMS_ByteOrderNative, 0,"example.tdm", "someText", "title", "author", &deH));
GetCurrentCVIAbsoluteTime (&CVItime);
errChk (TDMS_SetFileProperty (deH, "Date/Time", TDMS_Timestamp, CVItime));
// Save and close file
errChk (TDMS_SaveFile (deH));
TDMS_CloseFile (deH);
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
What VI can read raw data from a TDMS file with scaling information entered?
I would like to use scaling with my TDMS files so that the end user will
only see engineering unit values, however, within my Labview application, I
want to retrieve the raw data. Is there a way to read the raw data using
one of the Vi's in Labview?The scaling information in a TDMS file is stored as properties of the channel. One trick (that I haven't mastered yet) is you can change the properties of the TDMS file (set properties) and set all the scales to have a offset of 0 and a scale of 1. This will apply a scale that has the engineering units be the same as the raw values. Then you can read the data like normal and you'll get the raw values.
There are several issues to be aware of, the first is changing the scale and forgetting to change it back, or some how modifying the data to be incorrect units and not knowing it. For this reason I'd recommend making a copy of the TDMS file to a temporary location to make the modifications to the properties, read it, then delete the temporary TDMS file when you are done.
This is the only way I know of to get the raw readings from a scaled TDMS channel.
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously. -
How to read some records from a text file into java(not all records)
hello,
how to read text files into java. i need only few records from the text file not all records at a time.
If any one knows plz reply me
my id is [email protected]this snipet reads a text file line by line from line 1 to 3
try {
FileReader fr = new FileReader(directory);
BufferedReader br = new BufferedReader(fr);
int counter = 0;
while ((dbconn = br.readLine()) != null) {
switch(counter){
case 0:
status = dbconn;
break;
case 1:
userName = dbconn;
break;
case 2:
apword = dbconn;
break;
counter++;
br.close();
}catch(IOException e){
} -
How to compare signals from two different .tdms files?
i'm developing a lie detection system in labview.so inorder for that i need to compare the threshold physiological signals from the .tdms file with the signals i acquire continuelsy from the subject for each question asked.i use respiration monitor and heart beat monitor together with the sensorDAQ to acuire the physiological signals.so which are the function i should make use of?i have the following toolkits
1. advanced signal processing toolkit
2. adaptive filter toolkit
3. digital filter design toolkit
4. biomedical toolkit
please give me advise on this.
thank you.
Solved!
Go to Solution.Lie detector systems (polygraphs) generally work by looking at the physiological responses to the own subjects baseline, and do this in real-time. You could use a file that represents the stored "baseline" for the subject, but the overall environment, circumstances, general state of the subject, etc. may not be similar enough to easily see subtle changes.
From the stored file, you might determine a set of parameters or thresholds that indicate "normal, relaxed" for each signal. You could read the file into your LabVIEW program, process each channel, and save these parameters. Then when you have the new data, you can read the new data file in and process it in a similar way and then determine whether the parameters are outside the limits that you established for a "lie".
You may get more responses to this question if posted in the Biomedical User Group
Visit the NI Biomedical User Group at:
www.ni.com/biomedusers -
How to read every line from a text file???
How can i read every line from my text file ("eka.txt")
now it only reads the first line and prints it out.
What is wrong with this?
import java.io.*;
import java.util.*;
class Testi{
public static void main(String []args)throws IOException {
BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
File inputFile = new File ("eka.txt");
FileReader fis =new FileReader(inputFile);
BufferedReader bis = new BufferedReader(fis);
String test=bis.readLine();
String tmp= "";
while((bis.readLine().trim() != null)) {
int spacefound=0;
int l=test.indexOf(" ");
for(int i=0;i<test.length();i++){
char c=test.charAt(i);
if(c!=' ') tmp+=""+c;
if(c==' ' && (spacefound<1) && !(tmp.equals(""))){
tmp+=""+c;
spacefound++;
if(tmp.length()==l) {
System.out.println(tmp);
tmp="";
spacefound=0;
if(tmp.length()<l){
for(int i=0;i<=(l-tmp.length());i++)
tmp+=""+' ';
System.out.println(tmp);Try this code, Hope it servers your purpose.
import java.io.*;
import java.util.*;
class Testi {
public static void main(String []args)throws IOException {
BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
File inputFile = new File ("Eka.txt");
FileReader fis =new FileReader(inputFile);
BufferedReader bis = new BufferedReader(fis);
String test=bis.readLine();
while(test != null) {
StringTokenizer st = new StringTokenizer(test," ");
while(st.hasMoreTokens())
System.out.println(st.nextToken());
test = bis.readLine();
}Sudha
Maybe you are looking for
-
Unnecessary Acrobat 9 Warning in PDF Portfolio
When I open a PDF Portfolio using Acrobat 9 Professional, I get a screen advising "For the best experience, open this PDF portfolio in Acrobat 9 or Adobe Reader 9, or later." This is both unnecessary and confusing. Is this standard behavior, and if s
-
Issue creating WBS using BAPI_BUS2054_CREATE_MULTI
Hi All, I am trying to create WBS elements under existing project (CJ20N) using BAPI_BUS2054_CREATE_MULTI. I am I am getting ET_RETURN with message type S-W-I, even after commit no WBS created. Type S message says Individual check for creati
-
BACKGROUND INFO: I am working on a memorial program for my father. I googled free memorial template. Followed the program and ended up downloading iworks 30 day free trial, a program that have already on my computer. I went to FInder found the fre
-
Anyone else seeing iBooks 1.1 as flakey?
Loaded 68 PDFs into iTunes (Books) Devices iPad Books Sync Books - Selected Books {check} Books - All selected Sync with iPad No books, no PDF button at top of iBooks App iTunes/iPad shows 2.28GB of Books restart iBooks restart iPad Takes several Syn
-
Change beasvc.exe default stdout log rotation parameters in WLS10.0
Weblogic Server 10.0: I'm trying to change default log rotation parameters for weblogic server service as suggested here: http://edocs.bea.com/wls/docs100/server_start/winservice.html#wp1193277 my installsvc.cmd contains: set ROTATION_TYPE = TIME set