Create a XOP from DLL

Hi guys !

I have a question, do you know any way to turn a DLL into an XOP ?

I have a particular piece of hardware that I command via ethernet, to send the command I used XOP-Sockit which is great, but the hardware uses custom functions that are stored in a DLL ( made for C/C++ ). Is it possible to turn this DLL into an XOP in order to use it in Igor ?

Thanks
In order to write an Igor XOP, you'll need to purchase the Igor XOP Toolkit. If the author of the .dll provides information on the custom functions available in the .dll, you should be able to write code that uses the XOP Toolkit so that you can make an XOP that provides external operations or functions that make those .dll calls. Note that you need to know C/C++ to be able to write code for the XOP toolkit.

First, however, you might post a question on the Igor Pro user mailing list. Right now it has more eyes than the forums here, and there's always the chance that someone else has already written an XOP for what you want and you can maybe get it from them.
Hey,

It looks like I have the same problem as Neogin.
I would like to control translation stages with an XPS controller from Newport. The communication between the PC and the controller is carried out via TCP/IP communication.
I can easily communicate with the XPS using Igor Pro thanks to the Sockit XOP. But when I send commands in Tool Command Language (TCL), nothing happens. It looks like Igor does not send the character strings as it should do to be understood by the controller.
Newport supplies dll and *.h files (see attached files. You need to change the extensions of the files into dll.dll and h.h). I guess I have to convert these files into an XOP. Can anyone tell me if this is going to be complicated. How to do it? Or perhaps someone has already done that before?

Thanks for your help.
Cheers.
Restedumonde.
dll.txt h.txt
Based on the header file you posted, my guess would be that creating an XOP to use the Newport dll shouldn't be all that difficult, but because there are so many different functions to implement it will be tedious. The good thing is that the Newport dll calls use basic parameter types (mostly int, double, and char*) and almost all return ints. This means that your XOP wouldn't require a lot of code to translate between Igor types and the types used by the .dll.

My advice above applies to your question as well. If you don't have any experience with C/C++, it might be somewhat challenging to write such an XOP. But if you've done similar stuff before, it shouldn't be too bad. I'd start by buying the XOP toolkit if you don't have it already, and then going through some of the very simple XOPs included, such as the XFUNC1 XOP.
restedumonde wrote:

I would like to control translation stages with an XPS controller from Newport.


I believe there are some Igor users using Newport motion controllers. I second Adam's suggestion that you send a note to the Igor mailing list.

restedumonde wrote:

I can easily communicate with the XPS using Igor Pro thanks to the Sockit XOP. But when I send commands in Tool Command Language (TCL), nothing happens. It looks like Igor does not send the character strings as it should do to be understood by the controller.


I would investigate that further. If you know exactly what the controller expects, including any terminators (CR, LF, or CRLF) or other syntactical characters, then it should be possible to figure out why the Sockit approach is not working.

restedumonde wrote:
Hey,
I can easily communicate with the XPS using Igor Pro thanks to the Sockit XOP. But when I send commands in Tool Command Language (TCL), nothing happens. It looks like Igor does not send the character strings as it should do to be understood by the controller.
Restedumonde.


I'm the author of the SOCKIT XOP and I may be able to help you with what you need to do. I know at least one person that can sucessfully control XPS controllers using SOCKIT.

SOCKIT sends and receives binary data. It doesn't add or remove characters to the string you construct, so it should be able to do pretty much anything if you know command sequences, etc.

I am assuming that what you're trying to do is control the XPS box from a TCL command shell, using some sort of package? If you can, then you can't just use TCL script from SOCKIT. To do the same thing from SOCKIT you would have to know what the TCL engine sends to the XPS box when you type that command, then send that from SOCKIT.
To andyfaff,

Could you please give me the contact information of the person who can successfully control the XPS with Igor Pro?

Thanks.
Hi guys,

So I have this dll file. I have included this dll into a C/C++ program. Now, how do I turn this C/C++ program into an XOP file (Igor extension)?

Thnaks.