From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-06-2011 11:54 AM
I have a date column in this format: 01/09/2011 00:00:00.0000. It is a date/time channel. In this data, the date is correct (dd/mm/yyyy), but the time is not.
I have a time column in this format: 01/01/0000 21:43:36.0000. It is a date/time channel. In this data, the time is correct, but the date is not.
I have a milliseconds column in this format: 500. It is a numeric channel. The miliseconds are correct, they are just not part of the time channel.
What is the easiest way to combine these so that I end up with a single channel of this format: 09/01/2011 21:43:36:500
Thanks,
Ed DeWitt
09-07-2011 01:16 AM
Hi AlphaTreo,
The easiest way is dividing the millisecond channel by 1000 and then adding all channels. You finish it by setting the display property to "Time". Please have a look at the attachment.
09-07-2011 07:47 AM
Hi Ed,
The simplest way to put those 3 columns together is in a DataPlugin. Where do they come from? ASCII file? Excel file? TDMS file? How are you importing that data into DIAdem? If we can use a DataPlugin to load the data, we should be able to combine those columns automatically during loading.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
09-08-2011 12:30 PM
I solved it this way...
'Convert DATE, TIME and MS columns into a single column which contains the date
' and time. Requires DATE, TIME, and MS channels to be text data types.
'Concatenate the various pieces of text together:
call Calculate("ch(""Temp1"")=Ch(""[1]/DATE"")+"" ""+Ch(""[1]/TIME"")+"":""+Ch(""[1]/MS"")",NULL,NULL,"")
'Remove the ".000" from the end
call Calculate("ch(""Temp2"")=left(Ch(""Temp1""),23)",NULL,NULL,"")
'Format into a time:
call Calculate("ch(""Date-Time"")=TTR(Ch(""Temp2""),""#MM/DD/YYYY hh:nn:ss:ffff"")",NULL,NULL,"")
'Remove temporary channels:
Call Data.Root.ChannelGroups(1).Channels.Remove("Temp1")
Call Data.Root.ChannelGroups(1).Channels.Remove("Temp2")
'Change into a time channel:
Data.Root.ChannelGroups(1).Channels("Date-Time").Properties("displaytype").Value = "Time"
Thanks for the help,
Ed DeWitt
02-02-2015 03:46 PM
@Brad_Turpin wrote:
Hi Ed,
The simplest way to put those 3 columns together is in a DataPlugin. Where do they come from? ASCII file? Excel file? TDMS file? How are you importing that data into DIAdem? If we can use a DataPlugin to load the data, we should be able to combine those columns automatically during loading.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
Reviving an old topic here. I have similar data:
"Date","Time","Millisecond"
"2015/01/03","21:28:06","190"
In the dataplugin wizard I've used date to combine for the first column and time to combine for the 2 others. I set the date time to "YYYY/MM/DD hh:mm:ss ffff" and a few other variations of the f's. 3 f's, 1 f, and nothing turns out correct. Date looks good. The time is good except it has just 0's for the fraction. Then the miliseconds column just shows a whole new time-formated value, 190 is interprested as 22:00:00 for some reason.
--Scott
02-04-2015 10:34 AM
I did resolve by stealing/modifying a dataplugin script. Would still love to know if this can be done via the wizard.
--Scott
02-04-2015 02:39 PM
Hi Scott,
As of DIAdem 2014, the ASCII DataPlugin Wizard supports putting a "Date" column and a "Time" column together into one "DateTime" column.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
02-04-2015 02:41 PM
@Brad_Turpin wrote:
Hi Scott,
As of DIAdem 2014, the ASCII DataPlugin Wizard supports putting a "Date" column and a "Time" column together into one "DateTime" column.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
Yea, I got that very clear Brad. But I need to combine 1 date, 2 time, the 3rd time is only the milliseconds counter. Seems that doesn't work, or I'm not doing it right.
02-05-2015 11:28 AM
Hi Scott,
In order to put 3 columns together, you will need to program your own DataPlugin and use a ProcessedChannel for the resulting combined DateTime channel.
If you email or post sample ASCII files, and if they're simple, I can do that for you real quick, but it's not covered by the Wizard.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
02-05-2015 01:11 PM
Thanks for the followup. As you saw from my other post, I did just that.
For others with the same question: http://forums.ni.com/t5/DIAdem/Why-is-my-Dataplugin-slower-than-the-wizard-dataplugin/td-p/3085185