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
 Origin Forum
 Origin DDE

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
grahamc Posted - 02/03/1999 : 7:08:00 PM
I have an Origin script that, via DDE, queries the state of some variables in Labview. The purpose is to enable the automatic aquisition and processing of data through Labview, then the automatic plotting and printing in Origin. The script waits for a new script to become available, then loads and runs it. The scripts end with a "document -n" command to ensure Origin is in a known state for the next script.

Everything runs fine whilst the script is executing, but Origin seems to intermittently hang; the script stops executing, and attempts to exit Origin result in a Dr Watson message and dump.

I've included the server script below; is there an obvious error in it that could be leading to the deadlocks?


// Labview/Origin plotting server
// Waits for a signal from OriginDDE.vi indicating that
// data is ready to be plotted, then loads scripts/Autoplot.txt
// to plot it.

%Z=FALSE;
for (;1==1 {
idLabview=-1;
for (;idLabview==-1 {
dde -c labview|origin idLabview;
if (idLabview==-1) type -q Labview is not responding. Note that this script must be running on the same desktop as Labview!;
second -p 1;
};

type -q Labview responded;
dde -r idLabview DataReady;
if (%Z=="TRUE") {
type -q Data Ready;
run scripts/AutoPlot.txt;
dde -p idLabview DataReady FALSE;
};
else {
type -q Waiting for data;
};

dde -r idLabview Shutdown;
if (%Z=="TRUE") {
type -q Shutdown request. Remember- a goat is for life, not just for Christmas!;
second -p 5;
break 1;
};

dde -d idLabview;
second -p 1;
};

1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 02/04/1999 : 2:49:00 PM
I don't see any obvious errors (assuming the GIF images are misrepresentation of good code), but you mention using 'document -n' which I don't see anywhere in your code and I assume is in the script file you run. This would certainly be a problem because the document -n command would delete all user-defined variables which would invalidate your control structure.

Perhaps replacing document -n with code that cleans up only those windows and variables that are accumulating due to your script would solve the problem.



Origin Tip:

If you need to define a lot of variables for a Script, consider beginning their names with a common root, such as:


  • ddevar1
  • ddevar2
  • dderesult
  • ddetest

When you are done with these variables, you can delete them all with:

del -v dde*;

[This message has been edited by Greg (edited 02-24-99).]


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