06-22-2007 12:24 PM
06-25-2007 04:49 AM
Hey Rainer,
The almost easiest way would be to use the shared variables and their provided timestamp. By right-clicking on the variable within the host VI you should be able to choose "show timestamp" from the shortcut menu. Shared variables store the timestamp of each piece of data they receive, so you can read the the data in the host VI and add the correct timestamp of the actual data beeing written.
Hope this helps!
06-25-2007 10:59 AM
Hey Christian,
thank you for your advice. I didn't know the option "show timestamp" of the shared variable before. But still the timelogging is not working. You wrote: "...so you can read the the data in the host VI and add the correct timestamp of the actual data beeing written."
What do you mean by "correct timestamp of the actual data"? Do you mean the timestamp of the host or another timestamp of the rt engine? And how can I add timestamps? Do I have to transform the format or is there another possibility to add timestamps? Do I have to do the logging of the timestamps in a seperat timed loop?
I implemented your advice, but the time of the timestamp ist still not right. As I am not able to read the first timestamp channel, I transformed the second into an string, so I can write it with "Write to Text File". But how can I log the timestampt of each piece of data?
I would be really grateful, to get another hint.
Sorry for my simple questions, I am quite new to Labview..
I attached the new vi of the host and the old rt-engine vi.
Best wishes!
Rainer
06-26-2007 03:12 AM
Hey Rainer,
The timestamp the variable provides of the actual element you read out in the host VI, is the timestamp of this element as it has been writtn to the variable in the target VI! So when you write date into the variable it automatically stors the timestamp of this date beeing written. Then you can read this timestamp within the host VI.
Like in your case, if your are using shared variables configured as RT FIFOs automatically generate an invisible communication loop on the target VI. So a variable configured in this manner transfers data from the time critical loop to the communication loop using an RT FIFO and then transfers the data from the communication loop to the host using the PSP (publisher subscriber protocol). This means you don't need an additional loop for the variables.
If you want to store the timestamp of each sample you acquire, you will have to use the waveform datatyp (WDT) instead of DBL. The WDT stores the first timestamp and then the dt between the samples. You can write this directly into the variable (must be configured as WDT) and separates the values of the WDT in the host VI to do the logging!
After looking over your programming, I would recommend you visit the realtime course which discuss building realtime applications from the scratch on!
Regards, Christian