Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

How to establish Xml-rpc interface to plecs from Octave instead of python?

0 votes
615 views
User manual describes the steps for python as scripting language. When using python, I am unable to use matrix values for initialization using optStruct. This is because of python datatype conversion.

Rather than using the initialization commands in Plecs, I want to use Octave as scripting language to establish xml-rpc interface and initialize the matrix values obtained from Octave script to Plecs. .
related to an answer for: How to link Octave script with Plecs?
asked Sep 29, 2020 by ramapriya.an (12 points)

1 Answer

+1 vote

I do not have any firsthand experience with this, but an initial search points to using the Apache XML-RPC libraries, similar to how XML-RPC is supported with Mathworks tools.  A few resources I found are this website and this website.

That being said, I'm not 100% confident this is the most straightforward path for you to achieving your goal of "initializing with matrix values".  You might be better off aligning your matrix with the convention used in the Python 3 script example below and attached case.

import xmlrpc.client
server = xmlrpc.client.ServerProxy("http://localhost:1080/RPC2")
opts = {'ModelVars':{'var':[[1,0],[0,1]]}}
server.plecs.simulate("matrix_xmlrpc",opts)
answered Sep 30, 2020 by Bryan Lieblick (1,819 points)
edited Sep 30, 2020 by Bryan Lieblick
...