Use API to call other programs

api

#1

Hello,

I am trying to use API to call FDTD from INTERCONNECT, but run into some problem. When I try to send a variable to workspace, I got an error. Can anybody help? Code and error are attached. I am using the latest version of Lumerical tools.

Thank you very much
Zeqin

s2=opensession(‘fdtd’);
x=2;
putremotedata(s2,‘x_device’,x);


Using Lumerical's API on Mac OS X
#2

Hi,

For the moment, we have workaround for this error. We can define the path of the Lumerical API in your user profile. But we will have to run FDTD or INTERCONNECT from a terminal window. Try the following:

  • Open a Terminal window and type this command:
    nano .bash_profile
  • Append the following commands:
    export PATH=/Applications/Lumerical/FDTD\ Solutions/FDTD\ Solutions.app/Contents/MacOS:$PATH
    export PATH=/Applications/Lumerical/MODE\ Solutions/MODE\ Solutions.app/Contents/MacOS:$PATH
    export PATH=/Applications/Lumerical/DEVICE/DEVICE.app/Contents/MacOS:$PATH
    export PATH=/Applications/Lumerical/INTERCONNECT/INTERCONNECT.app/Contents/MacOS:$PATH
  • Quit and save
  • Run the following:
    source .bash_profile
  • Test the path:
    printf "%s\n" $PATH
  • Open and launch INTERCONNECT by:
    interconnect
  • You should be able to open a session of FDTD from INTERCONNECT and vice-versa.

Using Lumerical's API on Mac OS X