01-10-2008 02:12 PM
01-10-2008 02:33 PM
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.
01-11-2008 11:38 AM
01-11-2008 11:52 AM
01-11-2008 01:02 PM
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?
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.
01-11-2008 01:06 PM
01-11-2008 01:09 PM
01-11-2008 01:14 PM
01-11-2008 01:21 PM
01-11-2008 01:23 PM - edited 01-11-2008 01:24 PM
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? ...
This does not make any sense at all! Check again!
exo wrote:
If I delete my initializing of output and just have an indicator in the while loop, it does not get updated.