Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

DDE in python 1

Status
Not open for further replies.

MosesTebatso

Computer
Joined
Apr 20, 2021
Messages
5
Location
ZA
Hi All,

Any tips on how turn the following matlab code into python code?
The main goal is to implement DDE in python as implemented in matlab on the example below.


% This file shows how EES and MATLAB can be coupled through file transfer

%% First start a DDE conversation between MATLAB and EES

chan = ddeinit('EES','DDE');

% Now let EES load the EES file

rc = ddeexec(chan,'[Open EES_MATLab.ees]'); % Alternative rc = ddeexec(chan,'Play EES_MATLab.emf');

% Create a File in MATLAB such that it can be read by EES with the $Import directive

var1 = 1;

var2 = 2;

var3 = 3;

var4 = 4;

var5 = 5;

t = 0;

for i = 1:10

t = t + 1

save MatLabInput.txt var1 var2 var3 var4 var5 t -ascii

% Ask EES solve the previously loaded program

rc = ddeexec(chan,'[Solve]');

% Read a file created by EES through the $EXPORT command into MATLAB

erg = csvread('EESOutput.csv')

end



% Terminate the DDE conversation between MATLAB and EES

ddeterm(chan);

________________



Thanks
 
Thanks @IRstuff (Aerospace) , i have posted the Python forum yesterday. Hoping to see their thoughts on this soon too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top