<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic time shift plotting data on absolute time graph in LabWindows/CVI</title>
    <link>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3113715#M69918</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm plotting some data on an absolute time graph and I find 2 hours of time shift between data shown by the debugger (on the left)&amp;nbsp; and data plotted on the graph (X - AUTO SCALE).&lt;/P&gt;
&lt;P&gt;The time registered in ptTime, has been acquired using the "time ()" function and the PC has Amsterdam, Berlin, Rome as time zone.&lt;/P&gt;
&lt;P&gt;Here below a screen shot that put together the code, the debugger and the result.&lt;/P&gt;
&lt;P&gt;By the way, the debugger is showing the correct time version!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone can suggest me how to treat data in order to have the same result on debugger window and on the graph?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks and regards&lt;/P&gt;
&lt;P&gt;Sergio&lt;/P&gt;</description>
    <pubDate>Thu, 02 Apr 2015 12:58:37 GMT</pubDate>
    <dc:creator>Laser</dc:creator>
    <dc:date>2015-04-02T12:58:37Z</dc:date>
    <item>
      <title>time shift plotting data on absolute time graph</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3113715#M69918</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm plotting some data on an absolute time graph and I find 2 hours of time shift between data shown by the debugger (on the left)&amp;nbsp; and data plotted on the graph (X - AUTO SCALE).&lt;/P&gt;
&lt;P&gt;The time registered in ptTime, has been acquired using the "time ()" function and the PC has Amsterdam, Berlin, Rome as time zone.&lt;/P&gt;
&lt;P&gt;Here below a screen shot that put together the code, the debugger and the result.&lt;/P&gt;
&lt;P&gt;By the way, the debugger is showing the correct time version!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone can suggest me how to treat data in order to have the same result on debugger window and on the graph?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks and regards&lt;/P&gt;
&lt;P&gt;Sergio&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2015 12:58:37 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3113715#M69918</guid>
      <dc:creator>Laser</dc:creator>
      <dc:date>2015-04-02T12:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: time shift plotting data on absolute time graph</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3113720#M69919</link>
      <description>&lt;P&gt;You forgot the screenshot &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://ni.lithium.com/i/smilies/16x16_smiley-wink.gif" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2015 13:05:00 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3113720#M69919</guid>
      <dc:creator>Wolfgang</dc:creator>
      <dc:date>2015-04-02T13:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: time shift plotting data on absolute time graph</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3113726#M69920</link>
      <description>&lt;P&gt;Sorry, I've used "Insert Image" but apparently I made a mistake.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well I'll try with an attachment now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sergio&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2015 13:19:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3113726#M69920</guid>
      <dc:creator>Laser</dc:creator>
      <dc:date>2015-04-02T13:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: time shift plotting data on absolute time graph</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3114282#M69939</link>
      <description>&lt;P&gt;1. Make sure that you don't have any offset specified for the graph's x-axis. Edit the graph in the UI Editor, and verify that the hour offset is zero:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/d1736ebfca3874d464de7ffb2c894876cca7696f/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31363533303669423043453033424630453946423544442f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="time.png" title="time.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. The screenshot you posted for the debugger shows the times formatted as if they were time_t times, not &lt;SPAN&gt;UIDateTime&amp;nbsp;&lt;/SPAN&gt;times. The graph expects &lt;SPAN&gt;UIDateTime&lt;/SPAN&gt;&amp;nbsp;times, so make sure that this is what you're passing to the plotting function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how the CVI debugger shows&amp;nbsp;UIDateTime times and time_t times, respectively:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/27674585d0df175dfecd77896b653f1ff9a9ed06/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31363533303769313343373442463138463431344344302f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="timeformat.png" title="timeformat.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2015 14:10:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3114282#M69939</guid>
      <dc:creator>LuisG</dc:creator>
      <dc:date>2015-04-03T14:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: time shift plotting data on absolute time graph</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3115336#M69972</link>
      <description>&lt;P&gt;Thank you for the suggestions, here below my considerations.&lt;/P&gt;
&lt;P&gt;1. The x-axis offset is zero&lt;/P&gt;
&lt;P&gt;2. Yes I'm using a time_t array as X axis data, infact I declare VAL_UNSIGNED_INTEGER as X data type in the PlotXY() function, so this could be the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let me ask few questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a. in the CVI debugger you show, the time_t variable appears as a double, while its definition in "time.h" is "typedef unsigned int time_t;" so I'm a little bit confused&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; b. I was not able to find UIDateTime type in the CVI help, is it the value returned by GetCurrentDateTime(double *)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c. Is there any function to convert time_t values into UIDateTime values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the help&lt;/P&gt;
&lt;P&gt;Sergio&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 06:52:39 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3115336#M69972</guid>
      <dc:creator>Laser</dc:creator>
      <dc:date>2015-04-07T06:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: time shift plotting data on absolute time graph</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3115719#M69979</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt; in the CVI debugger you show, the time_t variable appears as a double, while its definition in "time.h" is "typedef unsigned int time_t;" so I'm a little bit confused.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Answer:&lt;/STRONG&gt;&amp;nbsp;I did something non-sensical in that screenshot: I took a variable of type double (it happened to be a UIDateTime, actually) and configured the debugger to&amp;nbsp;format it as if it were a time_t variable. The formatted values&amp;nbsp;that the debugger&amp;nbsp;shows me, as a result, are&amp;nbsp;invalid, of course. But I just wanted to show you the time_t formatting, because&amp;nbsp;it matches what you have in your screenshot, and I was already suspicious that you were using time_t variables to pass to the graph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, If you're not familiar with how&amp;nbsp;you can change the formatting in the debugger, this is how you do it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/ccd3931180ba20714357d013b38eed900fcca535/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31363534313569434530433136313932323434343031412f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="format.png" title="format.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usually,&amp;nbsp;the debugger&amp;nbsp;can automatically pick the best format to use, based on the data type of the variable (for example, with time_t variables). But in this case, what the debugger calls a "Date Time" variable is simply a double. The debugger can't assume that you want to view all of your double variables as a "Date Time", and&amp;nbsp;so&amp;nbsp;you have to&amp;nbsp;override it yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; &lt;STRONG&gt;Question:&amp;nbsp;&lt;/STRONG&gt;I was not able to find UIDateTime type in the CVI help, is it the value returned by GetCurrentDateTime(double *)?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Answer:&amp;nbsp;&lt;/STRONG&gt;There's really no such thing as a "UIDateTime" data type. I was a bit careless with my terminology. Unfortunately,&amp;nbsp;when you're dealing with dates and times, there are many possible representations of these quantities in the C world, and it's important that you&amp;nbsp;use the correct variant for the purpose that you're using it for. In this case, graph controls&amp;nbsp;expect that you pass it&amp;nbsp;the&amp;nbsp;time&amp;nbsp;format that is used by the UI library, i.e., the one that is returned by the GetCurrentDateTime or MakeDateTime functions.&amp;nbsp;The underlying C data type&amp;nbsp;for this time representation is simply &lt;FONT face="courier new,courier"&gt;double&lt;/FONT&gt;, and so there isn't a good name to use to refer to it. That's why I used UIDateTime, but I should have been more clear than that.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Question:&amp;nbsp;&lt;/STRONG&gt;Is there any function to convert time_t values into UIDateTime values&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Answer: &lt;/STRONG&gt;Yes.&amp;nbsp;you can use the following two Programmer's Toolbox functions, in exactly this&amp;nbsp;sequence:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; CVIAbsoluteTimeFromCVIANSITime(time_t ansiTime, CVIAbsoluteTime *absTime);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; CVIAbsoluteTimeToCVIUILTime(CVIAbsoluteTime absTime, double *uilTime);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:09:31 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3115719#M69979</guid>
      <dc:creator>LuisG</dc:creator>
      <dc:date>2015-04-07T17:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: time shift plotting data on absolute time graph</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3116062#M69982</link>
      <description>&lt;P&gt;Thank you very much, you have been clear and completly satisfying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sergio&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 09:17:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/time-shift-plotting-data-on-absolute-time-graph/m-p/3116062#M69982</guid>
      <dc:creator>Laser</dc:creator>
      <dc:date>2015-04-08T09:17:07Z</dc:date>
    </item>
  </channel>
</rss>

