06-19-2014 05:08 AM
Hi There,
I have a channel that contains a range of dates and times.
I would like to split that channel into two channels - one with date and one with time.
Any suggestions?
06-19-2014 06:44 AM
Hi,
if both channels (date and time) have the same lentgh, try something like this:
'_________________________________________________________________
dim length
length = Data.Root.ChannelGroups(1).Channels("Channel").Properties("length").Value
Call Data.Root.ChannelGroups(1).Channels.Add("Channel1",DataTypeFloat64,2)
Call Data.Root.ChannelGroups(1).Channels.Add("Channel2",DataTypeFloat64,3)
Call DataBlCopy("[1]/Channel",1,length/2,"[1]/Channel1",1)
Call DataBlCopy("[1]/Channel",length/2+1,length/2,"[1]/Channel2",1)
'_________________________________________________________________
Channel is the channel with both signals, Channel1 contains first half of "Channel", Channel2 contains second half of "Channel".
Hope this helps!
Simyfren
06-20-2014 12:03 PM
Hi officespace,
WHY? DIAdem works MUCH better with a DateTime channel than with separate Date and Time channels. If you just want to format the display of Date or Time only, just leave the DateTime channel the way it is and change the format string to what you want for tabular or graph axis formatting changes.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
01-22-2015 08:35 AM
Brad:
I'm not quite sure what Officespace is trying to do.. But I have a need for the same function.
I have a recorder ( Thermotron ) that gives you a Time Channel and a Date Channel ( it is a .csv format) . When you try to plot them you can use either or.
I would like to strip the Time data from the "Date" channel and concantenate it with the Date data from the "Time" channel. This would then becon one channel with Data and Time. I attached the raw data that I am talking about...The Concantenation part is where I'm humg up on.
If you could help, That would be great...
Thanks
Spidey
01-22-2015 08:38 AM - edited 01-22-2015 08:40 AM
Sorry: Here is the attachment......
and Sample of the data
Comment: | |||||||
Date | Time | AIR TEMP | AIR TEMP SP | TAC PTC | Load Temp | Channel 4 | UUT Front TC |
1/20/2015 | 12:30:05 | 80.3 | 79.3 | 59.4 | 0 | 0 | 62.9 |
1/20/2015 | 12:30:11 | 80.1 | 79.3 | 59.5 | 0 | 0 | 63 |
1/20/2015 | 12:30:17 | 80 | 79.3 | 59.6 | 0 | 0 | 63 |
1/20/2015 | 12:30:23 | 79.9 | 79.3 | 59.7 | 0 | 0 | 63.1 |
1/20/2015 | 12:30:29 | 79.7 | 79.3 | 59.7 | 0 | 0 | 63.2 |
1/20/2015 | 12:30:35 | 79.7 | 79.3 | 59.8 | 0 | 0 | 63.4 |
1/20/2015 | 12:30:41 | 79.6 | 79.3 | 59.9 | 0 | 0 | 63.4 |
1/20/2015 | 12:30:47 | 79.6 | 79.3 | 60 | 0 | 0 | 63.5 |
1/20/2015 | 12:30:53 | 79.5 | 79.3 | 60 | 0 | 0 | 63.5 |
1/20/2015 | 12:30:59 | 79.5 | 79.3 | 60.2 | 0 | 0 | 63.6 |
1/20/2015 | 12:31:05 | 79.6 | 79.3 | 60.3 | 0 | 0 | 63.7 |
1/20/2015 | 12:31:11 | 79.6 | 79.3 | 60.3 | 0 | 0 | 63.7 |
1/20/2015 | 12:31:17 | 79.6 | 79.3 | 60.5 | 0 | 0 | 63.8 |
1/20/2015 | 12:31:23 | 79.7 | 79.3 | 60.6 | 0 | 0 | 63.9 |
1/20/2015 | 12:31:29 | 79.7 | 79.3 | 60.7 | 0 | 0 | 64 |
1/20/2015 | 12:31:35 | 79.8 | 79.3 | 60.8 | 0 | 0 | 64.1 |
1/20/2015 | 12:31:41 | 79.8 | 79.3 | 60.9 | 0 | 0 | 64.3 |
1/20/2015 | 12:31:47 | 79.8 | 79.3 | 61 | 0 | 0 | 64.4 |
1/20/2015 | 12:31:53 | 79.7 | 79.3 | 61.1 | 0 | 0 | 64.4 |
1/20/2015 | 12:31:59 | 79.7 | 79.3 | 61.2 | 0 | 0 | 64.5 |
1/20/2015 | 12:32:05 | 79.7 | 79.3 | 61.3 | 0 | 0 | 64.6 |
1/20/2015 | 12:32:11 | 79.6 | 79.3 | 61.4 | 0 | 0 | 64.7 |
1/20/2015 | 12:32:17 | 79.6 | 79.3 | 61.5 | 0 | 0 | 64.8 |
1/20/2015 | 12:32:23 | 79.6 | 79.3 | 61.6 | 0 | 0 | 64.8 |
1/20/2015 | 12:32:29 | 79.5 | 79.3 | 61.6 | 0 | 0 | 64.8 |
1/20/2015 | 12:32:35 | 79.5 | 79.3 | 61.7 | 0 | 0 | 64.8 |
1/20/2015 | 12:32:41 | 79.5 | 79.3 | 61.8 | 0 | 0 | 64.9 |
01-24-2015 07:46 PM - edited 01-24-2015 07:52 PM
Hi Spidy,
This is more common. What DataPlugin are you using to load these **.csv data files into DIAdem? Typically you would do the merging of the date and time channel inside the DataPlugin that loads the data file. The worst case scenario is that we write a new DataPlugin from scratch-- you file looks pretty simple. It would help if you would post an example file as an attachment.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
01-25-2015 05:48 AM
Hi Brad:
Thanks for your response. I created the Plugin (that might be the problem).
The file is from a Thermotron ( environmental chamber) . I couldn't find a way to combine the two channels into one Time and Date Channel.
Attached is the file sample.
Thanks as always for your help !!
01-25-2015 03:22 PM
Hi Spidy,
I happen to already have a Thermotron_CSV DataPlugin that I created a long time ago. It seems to work very well on your submitted data file. You have to use a "ProcessedChannel" to create a DateTime channel out of the 2 existing Date and Time channels, if you go poking through the DataPlugin code to see what works the magic. It's only about 50 lines of code from top to bottom.
Brad Turpin
DIAdem Product Support Engineer
01-25-2015 07:55 PM
Thanks So Much Brad.....You even work on Sunday's!!
This forum is always so helpful !
Spidey