Help with Matlab Code (Maestro Servo Controller)

Hello,
I am a student at Lehigh University and am having trouble getting Matlab to control the maestro servo controller. Here is my progress so far:

-I’ve installed the software and drivers, and am able to move the servos using the Maestro Control Center.
-In the serial setting, I have it set in USB dual port mode.
-I have identified the command port of the controller as “COM3”.
-I found sample code in some of the other threads that include the function binvec2dec within the fwrite line of code. This is a problem for me, because I am running WIndows 64bit, and the DAQ toolbox is not supported on this platform. Would the bi2de be a possible replacement to the binvec2dec?
-The next code I tried was the MiniSSC-II code that looked like this:
fwrite(ser1, [255,Servo_No,Servo_Pos]);
When I run this code, the LED on the controller turns off for a split second, displaying that data is being received at least, but there is no response from the servo.

Any help with this would be greatly appreciated, I’m definitely starting to get frustrated at this point.
Thanks, David

Here is a full copy of the code that I’m running (the servo position is arbitrary within it’s range, i’m just trying it get it to move first. Also, I have my servo connected to the number 5.)
Servo_No=5;
Servo_Pos=1200;
port = ‘COM3’;
ser1 = serial(port);
set(ser1, ‘InputBufferSize’, 2048);
set(ser1, ‘BaudRate’, 9600);
set(ser1, ‘DataBits’, 8);
set(ser1, ‘Parity’, ‘none’);
set(ser1, ‘StopBits’, 1);
fopen(ser1);
fwrite(ser1, [255,Servo_No,Servo_Pos]);
fclose(ser1);
delete(ser1);

Hello.

It looks like you are using the Mini SSC Protocol. The last byte of the MiniSSC protcol should be a number between 0 and 255. You are trying to pass it 1200, which doesn’t fit in one byte. If you want to use a higher resolution target, you would use the Pololu/Compact Protocol. See section 5.c of the User’s guide for more details.

- Ryan

Ryan,
Thanks for the quick reply, that did the trick.

David