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

OlegLgn

Germany
6 Posts

Posted - 02/07/2002 :  09:38:44 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Can I import data directly (without writing LabTalk scripts) to the Origin 6.1 (not Origin Pro) worksheets from, for instance, LabView or other software, using DDE ?

I can do it with Excel, but it fails to work with Origin.

Mike Buess

USA
3037 Posts

Posted - 02/07/2002 :  10:05:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
OriginPro comes with a DDE demo and some VB and C++ source files. Look for them in the ATI subfolder. Hope that helps.

Mike Buess
Origin WebRing Member
Go to Top of Page

OlegLgn

Germany
6 Posts

Posted - 02/07/2002 :  10:12:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:

OriginPro comes with a DDE demo and some VB and C++ source files. Look for them in the ATI subfolder. Hope that helps.

Mike Buess
Origin WebRing Member



I'm sure that can help. But not in my case. Unfortunately I have only Origin, not Origin Pro. How to be in this case ? And can I use NetDDE with Origin ?
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/07/2002 :  3:44:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I doubt if you can get by without using a little LabTalk script. I have a very simple DDE communication between LabView and Origin. LabView saves its data to a file and then issues a DDE command to Origin telling it to run a macro and suppling the file name/path as an argument. It works quite smoothly, but the macro contains instructions for opening the file and handling the data afterwards. If you are interested I can elaborate.

Mike Buess
Origin WebRing Member
Go to Top of Page

greg

USA
1378 Posts

Posted - 02/19/2002 :  11:01:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The OriginPro samples demonstrate using Origin as a DDE Server. Using Origin as a DDE Client does require some LabTalk programming except in a specific case.

Here is an example that retrieves data from Excel in blocks of 5 rows by 5 columns. Set up an Excel worksheet with 100 rows of 5 columns of data. The first column should be your increasing X values. Now run this script in Origin:

for(ready=0,attempts=0;ready==0&&attempts<10;attempts++) {
dde -c Excel|System idSys;
sec -p 1;
if(idSys>=0) ready=1;
}
if(attempts>=10) {
type -a Request timed out. Terminating...;
break1;
} else {
type -a Connected, retrieving info.;
}
dde -r idSys Topics;
dde -d idSys;
ii=1;
getn (Select a Topic:) ii:Z (Excel System Topics);
dde -c Excel|%[%Z,#ii] idXL;
wo -a 2;
set %H -e 100;
wo -s 0 0 0 0;
wo -p 201 scatter;
x2=100;y2=10;
currentrow=1;
blocksize=5;
reps=20;
delay=1;
repeat reps {
dde -rc idXL R$(currentrow)C1:R$(currentrow+blocksize-1)C26 Data1!R$(currentrow)C1:R$(currentrow+blocksize-1)C26;
currentrow+=blocksize;
sec -p delay;
};
dde -d idXL;
type Finished.;

The script first establishes that Excel is running, then offers the user a choice of DDE 'Topics' - select the worksheet you already setup. The data is brought into Origin in rows of 5 and plotted at one second intervals.

Here is an example that doesn't involve LabTalk scripting:

  1. Open an Excel workbook or worksheet file.
  2. Select a region in a sheet.
  3. Select Edit : Copy
  4. Go to Origin and click in the home cell of a worksheet (Row 1, Column 1).
  5. Select Edit : Paste Link

That's it. There is now a DDE link between the Excel region and the Origin worksheet (one-way, from Excel to Origin). If you make a change in the Excel worksheet, that change is sent to Origin via DDE.

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