The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 fast import of ASCII data in worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

spock42

Germany
1 Posts

Posted - 10/09/2003 :  10:01:32 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic

Hello,

Im writing a script for ad hoc data analysis of a production process control system. To synchronize the data analysis with the control system I use the timer loop as the control system produces ASCII data e.g. every 3 seconds. The data are numbered in ascending order (data1.dat, data2.dat, ...). Every loop the script opens a new worksheet with several colums and imports the current ASCII data into this worksheet. Then the script performs calculations with the data in the worksheet, gets a result which it writes in another worksheet and displayes the result in a graph window and at least deletes the opened worksheet.
The script looks like this:

...
ii = 1;
def TimerProc {
ii = ii+1;
window -t newdata.otw;
open -w c:\temp\data$(ii).dat;
...
};
timer 3;

The problem is that the loop takes very long. One time consuming step is that every time the script opens a new worksheet this worksheet pops up. For my purpose it would be sufficient to import the data in minimized oder hidden worksheets.

Any suggestions how to do this or other ways to reduce the time needed for every cycle?

than-x for your answers

Harald

Mike Buess

USA
3037 Posts

Posted - 10/09/2003 :  5:17:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Harald,

I would reuse the newdata worksheet instead of deleting and recreating it each time. You can avoid restoring its window during each import by using win -o %W { script commands }, which activates %W only for the purpose of running the bracketed script (i.e., the window is not restored)...

window -t Data newdata; // open template
%W=%H; // save window name
win -i; // minimize
ii = 1;
def TimerProc {
ii = ii+1;
win -o %W {
open -w c:\temp\data$(ii).dat; // import to the minimized worksheet
};
...
};
timer 3;

If the rest of your TimerProc commands assume the newdata wks (%W) is active you might have to include those commands in the win -o brackets. You can usually avoid that by referring to its columns explicity... %W_A, %W_B instead of col(A), col(B).

That's a start. There's nothing else I can suggest without knowing the rest of your script.

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000