LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

zeros in charts

Attached are two vi's. LakeShore samples the temperature at two locations and works.  Plot Temperature Data 3 is essentially the same but the plots oscillate between the temperature and zero. Suggestions? Thanks
Download All
0 Kudos
Message 1 of 41
(5,567 Views)

It is difficult to tell without having your hardware, but one possibility is a race condition. Since both loops talk to the same instrument you should maybe try to ensure that each request-reply pair is not interlaced with the communication from the other loop.

It does not make much sense the way you are setting the multiplier. The multiplier is a global setting for the axis and not variable on a point-by point basis. Maybe you should decide on a rate before the loop and aquire both in the same loop so you can force execution order e.g. via the error cluster.

0 Kudos
Message 2 of 41
(5,556 Views)
Thanks. The chart works. However, the concatenated string, output, updates every time it gets a new string, not when all the strings are new and the file is written to too many times.

Also, is that the best way to initialize output?

doug
0 Kudos
Message 3 of 41
(5,512 Views)
Did I attach the file?
0 Kudos
Message 4 of 41
(5,509 Views)


exo wrote:
Thanks. The chart works. However, the concatenated string, output, updates every time it gets a new string, not when all the strings are new and the file is written to too many times.

Also, is that the best way to initialize output?

I don't understand your question with respect to the VI you attached.
  • The file is only written once after the loop stops
  • You don't need to initialize the string indicator labeled "output", because it will bet updated as soon as the loop starts. It does not keep any history. And it is definitely useless to write to an indicator and a local variable of the same at the same time. Also if you concatednate 5 empty strings, it is still just an empty string. Too much song and dance!
  • To clear the history, just create a diagram constant. No need to do fancy composing.
  • Your two 1000ms waits are pretty useless, because they run in parallel.
  • There is no need for any sequence structures.
  • Keep the TCP train horizontally aligned.
  • Don't label the timer control in ms and then still divide by 1000.
  • You might want to stop the loop if there is an error.

Typically, duplicate code can go in a FOR loop

Here's a quick draft how you could do some of these things. Modify as needed. 🙂

It is a bad idea to grow arrays at the border on while loops with undetermined iterations. You can run out of memory. I would suggest to open the fine outside the loop and write each line as it is received using lowlevel file IO, then close the file after the loop has finished. (not shown in my example). It is much safer to have the data in a file instead of an autoindexing tunnel. If the program crashes or gets aborted, you would loose all data.

Message 5 of 41
(5,501 Views)
This will take me a little time to digest but I wanted to tell you the reason for the additional one second delays. Without them the program only works in the highlight operations mode. The delays made the program work. Maybe I can get by with one but I needed something.
0 Kudos
Message 6 of 41
(5,493 Views)
Was able to remove one of the delays. Here's the output file. You can see my problem
0 +289.99 +289.99
1 +289.99 +289.99
2 +290.00 +289.99
2 +290.00 +290.00
2 +289.99 +290.00
3 +289.99 +290.00
4 +290.00 +289.99
4 +289.99 +290.00
4 +290.00 +290.00
5 +289.99 +289.99
6 +290.00 +290.00
6 +290.00 +290.00
6 +289.99 +289.99
7 +289.99 +289.99
There should be only one output for each number.
0 Kudos
Message 7 of 41
(5,491 Views)
If I delete my initializing of output and just have an indicator in the while loop, it does not get updated.
0 Kudos
Message 8 of 41
(5,489 Views)
If I remove the sequence the vi stops working.
0 Kudos
Message 9 of 41
(5,486 Views)

If you need to delay things between TCP operations, add e.g. a 100ms delay inside each of the two FOR loops.

Is your network fully operational and correctly configured? How congested? Full or half duplex? How many hops? Packet loss? Duplex mismatch? ...


exo wrote:
If I delete my initializing of output and just have an indicator in the while loop, it does not get updated.

This does not make any sense at all! Check again!


Message Edited by altenbach on 01-11-2008 11:24 AM
Message 10 of 41
(5,485 Views)