Page 1 of 1

Multiple controller 1063 on a pc

Posted: Wed May 23, 2012 8:35 am
by hierro
Hi all, actually im developing an application that has to manage 2 stepper motor, actually i just had a board 1063 (that handle only motor), im gonna buy another, is there a way to manage them separately ? i saw that stepper just open and get serial and get data, how can i choose to use one board or another ?

Thanks u all in advance

Re: Multiple controller 1063 on a pc

Posted: Wed May 23, 2012 10:14 am
by fraser
when you call open(), you can specify a serial number as an argument to choose which device you are opening.

so instead of the "-1" used in the sample program like:

CPhidget_open((CPhidgetHandle)stepper, -1);


replace the "-1" with the serial number of the specific stepper.
You will need to use two different stepper handles however, something like:

Code: Select all

CPhidgetStepperHandle stepper1 = 0;
CPhidgetStepperHandle stepper2 = 0;

CPhidgetStepper_create(&stepper1);
CPhidgetStepper_create(&stepper2);


//SETUP HANDLERS HERE


CPhidget_open((CPhidgetHandle)stepper1, serial1);
CPhidget_open((CPhidgetHandle)stepper2, serial2);




Where serial1 and serial2 are the serial numbers of the 2 steppers

Re: Multiple controller 1063 on a pc

Posted: Thu May 24, 2012 5:15 am
by hierro
Thank u a lot, is there anyway to list all the devices connecetd with relatives serials ?

Btw in my program (c#) i m just doing

Code: Select all

timer1.Tick += new EventHandler(timer1_Tick);

            stepper = new Stepper();

            stepper.Attach += new AttachEventHandler(stepper_Attach);
            stepper.Detach += new DetachEventHandler(stepper_Detach);
            stepper.Error += new ErrorEventHandler(stepper_Error);

            stepper.CurrentChange += new CurrentChangeEventHandler(stepper_CurrentChange);
            stepper.PositionChange += new StepperPositionChangeEventHandler(stepper_PositionChange);
            stepper.VelocityChange += new VelocityChangeEventHandler(stepper_VelocityChange);
            stepper.InputChange += new InputChangeEventHandler(stepper_InputChange);

            openCmdLine(stepper);


still didnt get really how CmdLine works and for what, guess for server handling.

i would like to have a way to list all devices connected and then manage them separately to move 2 motors finally, still really thank u

Re: Multiple controller 1063 on a pc

Posted: Thu May 24, 2012 8:41 am
by fraser
For getting a list of attached phidgets, there is a Manager class that you can create that keeps track of every phidget attached to the computer.

There is a C# example program showing how to use it. You can use attach/detach events that list device names, serial numbers, versions and status.

If you dont want events to track it, the manager stores an array of the attached phidgets where you can grab the same data as stated above.

Re: Multiple controller 1063 on a pc

Posted: Thu May 24, 2012 11:22 am
by hierro
Than u a lot, i didnt see it within Examples, works perfectly, aslo if still waiting second board :D thank you a lot indeed