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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 fast import of ASCII data in worksheet

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
spock42 Posted - 10/09/2003 : 10:01:32 AM

Hello,

I´m 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
1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 10/09/2003 : 5:17:51 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000