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
 Origin Forum
 Origin DDE
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

grahamc

Lancaster, England
22 Posts

Posted - 02/03/1999 :  7:08:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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;
};

greg

USA
1378 Posts

Posted - 02/04/1999 :  2:49:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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).]

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