LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Absolute and relative time

Dear People

 

I have build a .vi which measures temperature and pressure inside a gasifier. In my final file where all the data are being stored I need to have one column with the relative time and one with the absolute time (e.g.. For 10Hz rate relative time 0 0.1 0.2 0.3 .... e.t.c absolute time without the date 9:58:00 , 9:58:00 ..... After one real second 9:58:01) very logical. While also I need to put a header with what each column is ( e.g. Relative Time, Temp1, Temp2, Pressure 1, Pressure 2, Absolute time)

 

I have tried to do this with the set attributes module and passing everything to a write to measurement file module without any success. The file will get only the time(relative) without the headers or if I include the headers the time(relative) is set to 0 all along.

 

Thus I am trying to acquire the relative and absolute time with separates modules and then include them in my final array of data that will pass to the write to measurement file.

 

Regarding the absolute time I was able to get a string with the Hour Minutes Second number in a string b y using Get time/date module and format date time module to get only the H/M/S without the date. But I can not make this number to become dynamic data to pass them to the write to measurement file. Does anybody has any idea how to make a string a dynamic data?

 

While also I don't have any idea how I will get the relative time separately from the measurements I am doing for temperature and pressure. This has to be related offcourse with the rate I choose in the beginning.

 

Thank you for your help

Alex

0 Kudos
Message 1 of 8
(4,519 Views)

I have included the .vi I have build maybe you can see what I want more easily

 

 

0 Kudos
Message 2 of 8
(4,501 Views)

Hi Nikolian,

 

I am not sure I understand what the problem is. Could attach a file with the format you are wanting to see and the current format you are getting?

 

Regards,

Arham H.

Rohama K.
0 Kudos
Message 3 of 8
(4,467 Views)

Some tips for your VI.

 

1.  With the Index Array function, you don't need to wire up all of those index constants.  Without them, the Index array will automatically give you from index 0 to index whatever sequentially.

2.  It looks like all of those formula nodes contain the same formulas.  Turn that into a subVI.  It will greatly reduce your block diagram space.

 

For absolute time, it sounds like your pretty much just need to make another column of data that is calculated from your T0 time plus the relative time.  However, to format that into a text file, you will probably need to turn it into a string.  The Write to Measurement file gives you a quick way to wire stuff up as a beginner, but doesn't give you much flexibility if you start doing things that the Express VI wasn't designed to do.  You might need to use some lower level file functions to format your data the way you want to.

0 Kudos
Message 4 of 8
(4,461 Views)

I am sorry for this. If you want I can try to explain again.

 

I will like to see at the end a file with tab delimiter which I can put it in excell. The numbers included are there just for the example is nothing important. The important is the relative time and the absolute time.

 

Thank you for your interest and help

 

The final file should look something like this:

 

Relative Time T1 T2  T3  T4 T5 T6 T7 T8 P1 P2 P3 P4 N/A N/A N/A N/A Absolute time
0 29 30 31 32 33 34 35 36 5 6 7 8 0 0 0 0 9:58:00
0,1 29 30 31 32 33 34 35 36 5 6 7 8 0 0 0 0 9:58:00
…. 29 30 31 32 33 34 35 36 5 6 7 8 0 0 0 0 9:58:00
1 29 30 31 32 33 34 35 36 5 6 7 8 0 0 0 0 9:58:01
      1.1 29 30 31 32 33 34 35 36 5 6 7 8 0 0 0 0 9:58:01
0 Kudos
Message 5 of 8
(4,445 Views)

I am quite new to LabView and I have a deadline that I have to met. Somebody also told me that there is more things to change to make the .vi smaller but at this moment this is not my concern. My concern is to make the final file to look like as the people that will use my .vi told me.

 

After when I have a finish the final product (.vi) I will change all this to something more appropriate.

Regarding the absolute time Iwasabletotake it asastringfromgettimeanddatemodule (onlythetimewithoutthedatebyusing %I%M%S) butthenIhavetoturnthisintodynamicdatatobeabletoincludedintheWritetoMeasurementmodule. AndIcannotfindawaytodothis. IcouldturnthisstringinanumberbutstillLabViewdoesn'twanttoincludedinthefinalfinalasitisnotdynamicdata.

 

Thank you for your help

0 Kudos
Message 6 of 8
(4,444 Views)

I am sorry for the bad post I don't know why it took out all my spaces lol

 

I am quite new to LabView and I have a deadline that I have to met. Somebody also told me that there is more things to change to make the .vi smaller but at this moment this is not my concern. My concern is to make the final file to look like as the people that will use my .vi told me.

 

"After when I have a finish the final product (.vi) I will change all this to something more appropriate.

Regarding the absolute time was able to take it as string from get time and date module (only the time without the date by using %I%M%Sbut then have to turn this in to dynamic data to be able to included in the WritetoMeasurement moduleAnd can not find a   way to do thisIcould turn this string in number but stil lLabView doesn't want to included in the final file because is not dynamic data."

0 Kudos
Message 7 of 8
(4,440 Views)

As already mentioned, if you are going to use the Write to Measurement File, you have to accept the format of the file that it creates. If you want a different format, then you will have to use something like the Write to Spreadsheet File or even the Write to Text File. You have a waveform data type and all of the information is in there in order to get both the relative times and absolute times (i.e. Get Waveform Time Array). There is no need at all to convert to dynamic data.

0 Kudos
Message 8 of 8
(4,414 Views)