The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Segmentation fault when accessing function in a DLL
Replies: 5   Last Post: Apr 4, 2014 9:54 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Erik Benkler

Posts: 3
Registered: 4/16/09
Re: Segmentation fault when accessing function in a DLL
Posted: Apr 27, 2009 10:03 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi Phil,

many thanks for your help. You are right, the Version and Serial string sets are not important, so I simply avoid accessing them and it finally works. Great! Your advice really saved me a lot of trouble.

Best regards,

"Philip Borghesani" <philip_borghesani@mathworks.spam> wrote in message <gsskpa$mvp$>...
> Erik
> I think you are on the correct path with the second approach if the init function is retuning 0 for output then it worked and you
> can probably ignore the sets of return strings that may not properly be translated back into MATLAB. I would suggest using this
> code that does not use an extra libpointer object:
> if not(libisloaded('USMCDLL'))
> loadlibrary('USMCDLL','USMCDLL.h')
> end
> Devices_st=libstruct('USMC_Devices_st');
> Devices_st.NOD=0; %Initialize at least one member of the structure.
> retval=calllib('USMCDLL', 'USMC_Init', Devices_st);
> now just check the retval for 0 and NOD to see if it changed to a valid number
> Devices_st.NOD
> Accessing the sets of strings may not work.
> Now just go on usinge the device.
> Phil

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.