DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

AM/PM does not import with csv files

Hello All,

 

I am loading various csv files into DIAdem using the DataPlugin Wizard.  My files contain time channels in the format 03/21/2011 01:32:24 PM or AM.  When the data is imported the AM/PM is lost so my time skips backwards.  After 12:59 when the data jumps to 1:00 and there is no AM or PM or 13:00 so I end up with a large gap in my data and the end of the data becomes the beginning.  I have tried the various date format options in the wizard and even tried typing in "pp" after the time.  I have also tried importing the data as txt and ascii.  Am I missing something simple?  Thanks for any insight!

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

Hi SolarTech,

 

The PP syntax usually does the trick, though the rest of the time format has to match exactly then.  What version of DIAdem are you using?  If I remember correctly the PP syntax first shipped with DIAdem 10.1.  Would you submit a few example data files either here or through email (brad.turpin@ni.com) so that I can see what's happening?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

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

Hello Brad,

 

Thanks for the prompt reply.  I am using DIAdem 2011.  I am not sure which version that is?  You are correct, the PP does work and rest of the format does have to match exactly.  When I saw the word exactly it made me think that maybe I had missed something else in the format like my year was only YY or something and I had.  My incoming date is actually DD/MM/YYYY not MM/DD/YYYY.  Once I made that change everything worked fine.  Thanks for your help!

 

Karl

0 Kudos
Message 3 of 8
(4,173 Views)

So I am still having issues with my time channel.  I thought I had fixed the plug-in so that when my data file ran through the day the time channel went from an AM/PM time designation to 24H time as it was brought into DIAdem.  When I started running data through my processing routines and pulling individual time values from the time channel, it always converts the time to PM.  So even if my time channel shows 09:00:00 through 14:00:00 in DIAdem, if use a command such as RTT(ChDx(1,CNo("[1]/Time")),"#HH:nn:ss"), I will get a value of 21:00:00 instead of 09:00:00.  This command will correctly report what is in the time channel if I import the time channel such that the time channel has no idea what is really AM or PM.  I can't seem to get them to mesh.  Thanks for any insight.

 

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

Hi SolarTech,

 

I'm having a hard time believing what I'm understanding you to say.  Would you please post a sample data set, plus your DataPlugin and processing VBScript, so that I can get a clear picture of the problem you are encountering?  I believe I can help once I correctly understand what's happening.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 8
(4,125 Views)

Thanks for responding.  I think shutting down my system and restarting helped with the processing becasue the script seems to read correctly now but I am still not entirely sure that the time channels are being brought into DIAdem properly.  I am attaching one of my csv files.  I could not find the plugin's to send?  Could you tell me how to send the plugin?  Thanks. 

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

Hi SolarTech,

 

I went ahead and wrote a quick DataPlugin to read your posted CSV file which has no file extension.  You say that you're using DIAdem 2011, but actually at the moment only DIAdem 2010 is released, so I'm assuming this is what you actually have.  DIAdem 2010 is the first version that supports automatic association of "no-file-extension" with a DataPlugin, and this is how I've set up the DataPlugin I'm attaching.  That means that once you detach the ZIP file and unzip it and then double-click on the "SolarTech_CSV.uri" file to register the DataPlugin, that you'll be able to just drag your extensionless (CSV) data files from the NAVIGATOR to the Data Portal to load them.  This also means that the DataPlugin won't work on any DIAdem versions prior to 2010.

 

Your AM/PM info looks like it's importing correctly to me with the DataPlugin I wrote.  Note that by default DIAdem displays date/time values with 24 hour syntax, but you can configure date/times to display with AM/PM everywhere except on the axes of VIEW graphs.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

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

Hello Brad,

 

Thanks for your help!  That plugin works great.  You are correct, I do have 2010.  I did have 11.0.  I suppose I got a little confused.  It looks like everything is working good right now so thanks again for your help.

 

Karl

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