Hi, Anssi.
Let’s make sure that I understand the goal:
- You have two (or more) schematic components (let’s call them X1 and X2).
- Each component calls a different DLL (let’s call them X1.dlll and X2.dll).
- You need to exchange data directly between the two DLLs during the simulation.
If so, that much is possible. But it probably won’t do what I imagine that you want…
You could, for example, create a third DLL. Let’s call that DLL “IPC.dll.” This DLL would expose functions to be called by the existing DLLs to set some value and to fetch that value. That value would be stored in IPC.dll as a global variable.
Each of the existing DLLs would need to dynamically load IPC.dll and resolve the set/fetch function addresses and call them as needed.
That much isn’t really too complicated. Now here’s the catch: QSpice calls the component evaluation functions in X1.dll and X2.dll in an undefined order. Further, QSpice calls them serially – that is, the X1.dll evaluation function call must return before the X2.dll evaluation function gets called (or vice-versa since we cannot guarantee which gets called first).
So, if you want the two DLLs to “chat back and forth” within a single evaluation function call to one of the DLLs, well, I think it could be done but might be far more complicated…
Anyway, I’m just guessing about your goals. Maybe you could describe what you’re trying to do in greater detail and I could think it through a bit more helpfully.
–robert