Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Chris
Posts:
1
Registered:
12/4/12
|
|
Some hints or code snippets of the solution.
Posted:
Dec 4, 2012 6:24 AM
|
|
"Cody" wrote in message <jprg9e$184$1@newscl01ah.mathworks.com>... > Thanks for the suggestions! I was able to pass the pointer created in the mex functions by a lower-level C library back to the Matlab environment in an appropriately sized mxArray and then back into a different mex function as suggested. I was also able to declare a persistent memory location in the mex-file C-code so that sucessive invocations of the same mex function could access the pointer.
Hey Cody,
I'm facing exactly the same problem: I have a USB device to which I can transmit data via a provided driver. I call the driver's functions within a mex-File and want to open the device, transmit data and eventually close the device. The handle which I receive from the open-function (of the driver) is an unsigned long variable. However, I'm quite frustrated because I'm not able to pass this device handle back to Matlab so as to call another mex-function which internally calls the driver function to transmit data. So far, I've tried to create a persistent variable using mxCalloc and mxMakeMemoryPersistant but this approach does not result in the desired functionality.
I would really appreciate it if you give me a hint or some code snippets explaining your solution of this issue.
Chris
|
|
|
|