PDA

View Full Version : USBSERVOS Card testing



Tripacer
12-17-2008, 12:30 AM
I have completed a USBSERVOS card and want to test the servo movement before working on other things. The IOCServos.exe program reports that the card is operational and connected. After I verify that the card is operational I will work on the connectivity to FSX using FSUIPC. A couple of questions.
1. Where does the IOCServos.ini file go?
I put it in ... ProgramFiles/IOCARDS/SIOC.

2. I wrote this script to move the servo. Servo is operational because I tested it using Phidgets hardware/software.

// USB SERVO TEST 6 USING LOGICAL VARS (C0, C1, OR C2)9:49 PM 12/16/2008
// USBSERVOS port 0 corresponds to 0-5 = 1-6 servos
VAR 0077 , VALUE 25 // SET VALUE OF V0077
{
C0 = V0077 > 20 // SET CONDITIONAL VARIABLE
IF C0 // TEST CONDITIONAL
{
V0078 = 400 // SET VALUE OF V78 TO GO TO SERVO - MOVE SERVO
// ALTERNATIVE VALUE SET WITH DELAY
// V0078 = DELAY 700 100 // DELAY 10 SECONDS THEN SEND A VALUE
}
}
VAR 0078, LINK USB_SERVOS, OUTPUT 1 , POSL 1, POSC 512, POSR 1023

(Sorry for all the comments, I am a retired Computer Science Professor and commenting is in my blood!)

3. In the sioc.ini file, I disabled IOCPClient #0 and #1 because I have no connected networked computers at this time. Is this correct? acceptable?

Thanks for any help.
Tripacer

kiek
12-17-2008, 09:08 AM
Hi,
Just some feedback to help you writing more readable SIOC scripts, so you do not need that many comments... ;-)
Note that in SIOC upper or lower case does not matter, comma's and leading zeroes are redundant, and that you can give a variable a logical name.

Your program could also been written as:

Var 77 name SetValue Value 25
{
IF &Setvalue > 20
{
&Servo = 400
}
}

Var 78 name Servo Link USB_SERVOS Output 1 PosL 1 PosC 512 PosR 1023

It is now more easier to understand (at least to me) what it does, so it will be easier to comment upon.
My Comment: the code of Var 77 (between curly braces) will be excuted only once (at start up), you'll need other SIOC code as well to give SetValue new value's.

best regards,
Nico

Tripacer
12-17-2008, 07:26 PM
Thanks Nico, I will make my code more readable if and when I actually get it to do something with the hardware. So far, the servo has not moved at all.

William

Tripacer
01-14-2009, 12:25 AM
I finally figured out the USB Servos problem. The pinouts on the servo were incompatible with the pinouts on the USB Servos card. When I re-wired the servo all worked fine. Only one complaint, most servos made use a ground, positive 5v, signal pinout sequence. If the USB Servos card follwed that convention, instead of signal in the middle, servos would be plug compatible. Straight up estension wiring would then be in effect.
Thanks for all of the help. Probably more problems soon. I am busy interfacing the flight controls.
Tripacer