ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rt get time string pb

I face a pb concerning the time in cFP2100 ( or FP ).

I display the time ( and it's correct even for daylight ). But when I convert the time to string ( to write it in a file)
the value is not the same.

The PAC works with no PC (so without time server ) : I've configured it with UTC+1 ( Paris = GMT+1) and daylight is enabled.

Please take a look at my vi : if you can give me a way to get the time. Thank you

0 Kudos
Message 1 of 7
(4,851 Views)
Just a comment : I need to get the local time (not the UTC time) into a string.
"Format Date/time string" return the UTC time.

Is it possible ?

Thank you
0 Kudos
Message 2 of 7
(4,843 Views)
For me it works correctly. Format Date/Time String" returns either the UTC time or the local time depending on the flag. Thus I see the UTC time in one string indicator and my local time (UTC + 2, equal to the OS time) in the other.
Did you set up the time zone in windows?

EDIT: Sorry, you're not using windows. Looks like LabVIEW doesn't notice the time setting in the FP device.


Message Edited by dan_u on 03-27-2007 04:01 PM

0 Kudos
Message 3 of 7
(4,842 Views)
yes but with the dayllight it doesn't work for me.
0 Kudos
Message 4 of 7
(4,832 Views)
Please try the following test:

* configure the FP module : UTC+1 (Paris/madrid) (= Norway UTC+1)
* check the daylight box

* use the VI in the first message for making test (RT Set Date and Time)

TEST 1)
=======
set date to 01/27/2007
set Local Time to 16:00:00

you will get
Get Date Time in seconds
1) directly displayed :                                                             15:00:00
2) displayed after "Format Date/time" with UTC flag=T :     15:00:00
3) displayed after "Format Date/time" with UTC flag=F :     16:00:00

It's correct because items 1 and 3 are same

TEST 2)
=======
set date to 03/27/2007
set Local Time to 16:00:00

you will get
Get Date Time in seconds
1) directly displayed :                                                             17:00:00
2) displayed after "Format Date/time" with UTC flag=T :     15:00:00
3) displayed after "Format Date/time" with UTC flag=F :     16:00:00

It's not correct because I expected that item 3 was equal to item 1.

What is wrong in my configuration ?.
What is the good way to get the actual time into a string ?.

Thank you for your help
 
0 Kudos
Message 5 of 7
(4,814 Views)
the following VI works fine on PC but not on cFP.
Why ?

For example : I get :

"Temps actuel" 14:00
chaine date heure= 14:00               (Format Date/Time string with UTC flag=FALSE) = local time
chaine date heure 2 = 12:00         (Format Date/Time string with UTC flag=FALSE)




0 Kudos
Message 6 of 7
(4,782 Views)
I don't have FieldPoint devices, so I can't test. But anyway the easiest solution would probably be to store all data in UTC time. This will also prevent a time overlap/jump when daylight savings start/stop.
In the header of the data file you can write that times are in UTC and then they can be adjusted for displaying in local time.

0 Kudos
Message 7 of 7
(4,774 Views)