Re: Can MathLink write binary data to and read binary data from a
- To: mathgroup at smc.vnet.net
- Subject: [mg131558] Re: Can MathLink write binary data to and read binary data from a
- From: David Bailey <dave at removedbailey.co.uk>
- Date: Sat, 31 Aug 2013 08:09:34 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <kvmmjd$4k4$1@smc.vnet.net>
On 29/08/2013 06:35, sibir wrote: > I have a data acquisition system (which runs a UDP server on a point to point ethernet connection) which I want to control from Mathematica by sending it a bunch of bytes as commands and reading back binary data. > Is MathLink all I need or do I need some auxiliary code? > > Not my hometurf :-( > > Thanks for any advice! > Your best bet is to use J/Link and use the relevant classes from there. J/Link uses Mathlink internally, but it is much easier to use than MathLink. If you need more than a few lines of code, I'd write a Java class and compile it, rather than making lots of J/Link calls. Another option, since version 8, is to link directly to a DLL library written in C/C++. This is a direct call without a process switch, and doesn't use MathLink. David Bailey http://www.dbaileyconsultancy.co.uk