Welcome to %s forums

BrainModular Users Forum

Login Register

Access violation when i use a usb library in a module

Create your own modules in C++
Post Reply
anbd
New member
Posts: 5
Location: Lyon
Contact:

Unread post by anbd » 23 Mar 2010, 15:43

Hello

I'm trying to develop a module that can control a stepper motor.
(Ref of Command card: http://www.electrobee.com/usb-stepper/)
For this I use the c static library "libstepper" which itself contains the c static library "libusb-win32".
The module generates the following error:
[4] Error:pgUser CallBack Access violation at address 00905A4D in module 'UsineMain.exe'. Write of address 00000000
[5] Error:Internal in pgUser CallBack
It seems that the use of methods of "libusb-win32", which generates errors, and I do not know how to solve the problem.

Thank you for your help

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 24 Mar 2010, 12:53

First , welcome !
I 'm not a specialist about this , so gone to try to find you martignasse . .
but always glad to see new projects . ..
can you tell us more about it . ? hardware sequencer . ?

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 25 Mar 2010, 09:58

Hi anbd,

Welcome aboard, interesting module you want to make here :)

From what i saw on the electrobee page :
about the c static lib you want to use, seems like it require the MinGW/MSYS compiler.
Like mentioned one the LibUsbWin32 sourceforge page, seems like not compatible with the VC++ compiler we use for now... :(

Maybe a solution could be to use the SDK and compile your module with code::blocks, who use MinGW/MSYS as compiler....
But it's not a trivial task, as it need to make a code::blocks version of the SDK (and maintain it !)...

Anyway, from the error message you pasted, it seems that you can compile the module and error are at execution time inside Usine, right ?

Did you try in debug mode ? (more info here, under Breakpoints from VC++ section) with some breakpoints to isolate the line who produce the error ?

Hope it help.
Martin FLEURENT - Usine Developer - SDK maintainer

La Tenaille
Member
Posts: 547
Location: Saint Etienne (France)
Contact:

Unread post by La Tenaille » 25 Mar 2010, 12:16

nay-seven wrote:can you tell us more about it . ? hardware sequencer . ?
Hi,
I've initiated this project with my brother and Anbd. The goal is to control my sliding didjeridoo from Usine.
My brother is building the hardware and Anbd (don't think you know music a lot ?) programs the interface to control the didj from Usine.
The didjeridoo is set on a stand, the mechanical structure (with a stepper motor) is supposed to slide the didj.

The artistic goal is to be able to slide the didjeridoo (to change key) with any MIDI controler (switch, pedal, my Roland D-beam...) without using hands, because I play cittern (a kind of guitar) kick and hi-hat at the same time.
... and my ultimate goal : my cittern is equipped with a divided pickup to remote MIDI. I've imagined "auto-sliding" the didj according to what I play ;)
I'm sure a lot of other applications will be possible, but first the stepper motor needs to be controlled from Usine.

PS : For those who read french and are interested in interactive installations, here is an interesting commercial link (no personal interest):
http://www.interface-z.com/index.htm Usine is present in their compatibility list

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 25 Mar 2010, 12:24

woa that sounds a crazy project, very cool, would love to see that in action!!

i didn't knew it was possible to change the key of a didg without changing it's lengh?, is that what you are speaking about by "sliding" is it a telescopic didgeridoo?omg

La Tenaille
Member
Posts: 547
Location: Saint Etienne (France)
Contact:

Unread post by La Tenaille » 25 Mar 2010, 13:58

yep, sliding didgeridoo is built with two tubes.
You'll find a lot of stuff on google if you're curious.
Off course I'll be proud to post a video once it's working :)

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 25 Mar 2010, 14:00

woa great, gonna check that, good luck in your project!

anbd
New member
Posts: 5
Location: Lyon
Contact:

Unread post by anbd » 25 Mar 2010, 15:36

Thank you for your reply, Martignasse, I will try to move the code on code::blocks

anbd
New member
Posts: 5
Location: Lyon
Contact:

Unread post by anbd » 26 Mar 2010, 15:00

Ok,
I recompiled everything with MinGW/MSYS compiler(SDK + module) using Code:Blocks and it works,
The dll fits perfectly with my Usine module and dialogue with the control motor card via USB library "libusb-win32.

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 26 Mar 2010, 15:07

whaoo !
fast and great news !
do you think to made this module public...or ?

anyway , this will open new doors again...

anbd
New member
Posts: 5
Location: Lyon
Contact:

Unread post by anbd » 26 Mar 2010, 16:13

When I'm cleaning the code, i could make available the SDK with the module template package for "code::blocks".
Then, for the motor control module, I must first finalize it, and I see with project team if we makes it available.

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 26 Mar 2010, 18:35

anbd wrote:Ok,
I recompiled everything with MinGW/MSYS compiler(SDK + module) using Code:Blocks and it works,
The dll fits perfectly with my Usine module and dialogue with the control motor card via USB library "libusb-win32.
wow, so you made a code::block project and it compile 'as is' :cool:

It's a great great news, good job :)

and i'm happy that you can continue your very interesting project.

of course, i'm interested in the code::block package ;) and i'll include it in the next version of the SDK if you are ok.

thanks a lot for your work.
Martin FLEURENT - Usine Developer - SDK maintainer

Post Reply

Who is online

Users browsing this forum: No registered users and 127 guests