LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Time Chart issue, not so "simple"

So i have a much more complex VI, that this is a part of.....and I cannot seem to pin-down what the issue is here.

 

I have a simple strip chart set-up to gather temperature data from a chamber probe.    All I'm wanting to do is have the x-axis display the time that the VI is started (start), and the system time of the last data point gathered (end).

 

However, as the VI is running, it appears to be "losing sync" (Lagging) with the system time.    I run the base program at 100ms, but only pull-in the Temperature data every 10s.   I put in a timer control (1s) to speed-up the testing process, but still cannot seem to put a finger on the issue here?

 

Any thoughts?   Probably something simple that I have just overlooked.

0 Kudos
Message 1 of 16
(3,803 Views)

hi

I assume you are asking graph is not displaying time values as you expect,

go to graph properties>>scales>>multiplier--set it to 10 (modify as you like) .

and it is not loosing sync ..it is updating as called.

bp
Message 2 of 16
(3,783 Views)

How are you learning LabVIEW?  Having pointed many "LabVIEW Newbies" to the Tutorials mentioned on the first page of the LabVIEW Forum, I just took a quick look at the first one to see where it mentioned the Fundamental Principle of Data Flow (as Implemented in LabVIEW) -- it is probably there, but I failed to find it quickly.  So here goes:

 

LabVIEW works using the Principle of Data Flow.  Functions and Structures can be connected by Data Paths ("wires").  The following rules apply:

  1. No Structure or Function will begin to operate until every one of its wired inputs has data on it.
  2. No Structure or Function will produce any output until it finishes execution.  Thus if any two Structure/Functions are connected by a wire (output from Structure/Function 1 to input to Structure/Function 2), the second one cannot begin until the first one finishes
  3. If there are no wires or data dependencies between two Structure/Functions, they will effectively execute in parallel.

Applying this to your Block Diagram,

  • The initialization of the Thermal Chamber Chart occurs in parallel with the While Loop.  You cannot assume that the Chart is initialized before it is used.  [Most LabVIEW functions have an Error line -- wiring the Error Line is the most common method of enforcing sequential, or serial, order].
  • You have two timers inside the While loop that operate in parallel.  One waits 0.1 second, the other 10 s (according to the label).  Since they run in parallel, the 0.1 sec timer will finish first, hence has no influence on the code. 
  • The Data Flow dependency between the 10s timer and the Chart update means that you write a point every 10 seconds.  This seems to be what happens.
  • LabVIEW, like most programming systems, will do what you tell it to do, and in this case, it is doing that.

What did you want the code to do?

 

Bob Schor

Message 3 of 16
(3,768 Views)

Hi Dear

Check this!

 

Thanks,

0 Kudos
Message 4 of 16
(3,753 Views)

Asif138, can you make that compatible for LV2014?   

0 Kudos
Message 5 of 16
(3,746 Views)

use this....

Message 6 of 16
(3,738 Views)

I "wanted" the code to:

1)  Write the system time to point 0 of the chart.

2)  Pull a temperature data point every 10 seconds, from my temperature meter.

3)  Display 10 hours of data (36000 data points), with the last data point having a time stamp that matches (or is very close to) the system time when the while loop is ended.

 

The current problem is that while it does #1 and #2 just fine, #3 "skews" or "lags" behind the system time, the longer the while loop runs.

 

I have no formal education in LabVIEW, just a hobbyist that is trying to apply what I have learned over time, from multiple sources (correct or incorrect, as they may be).    So I understand the general principles, that have been pointed-out....I just don't know "what question to ask" or "which Tutorial to look at", I can only describe what I'm trying to do....and what I want it to do.

 

Does that help scope the problem?  🙂

0 Kudos
Message 7 of 16
(3,729 Views)

Asif138, LAbVIEW says that, "For Loop: N is not wired, and there are no indexing inputs."   

 

Did you happen change the tunnel mode on one of the inputs?

0 Kudos
Message 8 of 16
(3,724 Views)

bharathp10,  Set the multiplier to 10, now I'm having the opposite problem.....  the logged data is leading my system time?   
Nevermind,  I forgot to reset my time control to match the multiplier.

 

All told, I'm beginning to understand what needs to happen.....not sure I'm going to like the answer.

 

As has rightly pointed-out, I have multiple functions working in series and parallel.   Even if I get something working here, I'm going to have to completely modify the remainder of my project, just to make this one simple function work properly.  

 

I'm not sure the end result of getting this to work, is worth That pain.......

 

So, it appears that this is working...    I still have a time gap, that I cannot explain....but the data is not leading, and is not lagging worse....   I'll have to do some more research to see if I can tweak this a little more.

Download All
0 Kudos
Message 9 of 16
(3,720 Views)

All, thanks for your help.    I was able to hone-in on the correct help files, and now everything is operating as expected (albeit with a small 3s delay).

 

Once I plug this into the other VI....I may add some tweaks to improve this, because I know it's going to have issues.  

0 Kudos
Message 10 of 16
(3,711 Views)