PDA

View Full Version : How to? Asign Axes


Uneek
05-05-2005, 11:42 AM
I'v been lurking the forum for what I'm after but still don't recognise what I'm reading.

I want to asign 2 buttons to an axes,1 to increase & 1 to decrease.

Regarsd Uneek

Bob Church
05-05-2005, 12:47 PM
Hi Uneek,

You'd need to add the CMS Controls to the map. Then do a little script something like this (using JS1 Buttons 2 and 3):

script

// Increments or decrements the count by one each
// time the clock ticks
//
if( CLOCKTICK ) then

// Increment CMS.A1 by one on each
// clock tick if JS1.B2 is pressed.
//
sequence
while( js1.b2 AND [ cms.a1 < 255 ] );
cms.a1 = cms.a1 + 1;
endSequence

// Decrement CMS.A1 by one on each
// clock tick is JS1.B3 is pressed
//
sequence
while( js1.b3 AND [ cms.a1 > 0 ] );
cms.a1 = cms.a1 - 1;
endSequence

endIf

endScript

Then up in the GUI you'd need to assign CMS Controls Axis 1 to do what you wanted, it would track the buttons. It would cover the full range of 0 to 255 in about 12 seconds with the default Character Rate of 50 (on the Program Settings tab). You could drop the rate if you need it faster or maybe increment by two or three at a time depending on how much resolution you need. For slower moves, you'd probably be better off prescaling things, e.g. only pass through the increment/decrement loops every other CLOCKTICK or every third CLOCKTICK or whatever. You'd just need to try it and see how it worked out.

Hope this helps!

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

Uneek
05-05-2005, 01:12 PM
Thanks Bob,

Looks like something I was trying to work on myself,but it's faster to ask someome like yourself.

Josh

Would You have any other sugestions for reading material for scripting.

Bob Church
05-05-2005, 01:34 PM
Hi Josh,

>> Thanks Bob <<

You're welcome!

>> Would You have any other sugestions for reading material for scripting. <<

Nothing really specific to the Control Manager, but it's really just programming. Any text on introductory programming would probably be relevant. The sort of things that you end up doing with the CM are much closer to what they do with programmable logic controllers too, so texts in that area might be a little more helpful than something on C++ or the other high-level languages.

It's mostly just a matter of learning what functions are available and then using them enough to get a feel for which ones are useful for what operations. If you do it for awhile you'll just get a feel for what's likely to work and what isn't for a particular problem and things do get easier.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

Uneek
06-05-2005, 08:18 AM
Bob,

I asigned my trim functions (kp7 DN and kp1 up) in FS2002 from the script you gave me but it wont always give me full deflection in the sim.

It does seem to have a finner addjustment when triming for straight and level
flight.I might be having myself on about this, but if I'm not could you help me with
a fix.

greatfully Josh

Bob Church
07-05-2005, 12:53 AM
Hi Uneek,

>> I asigned my trim functions (kp7 DN and kp1 up) in FS2002 from the script you gave me but it wont always give me full deflection in the sim.

It does seem to have a finner addjustment when triming for straight and level
flight.I might be having myself on about this, but if I'm not could you help me with
a fix. <<

Okay. Well, load the map up and put it into Mapped Mode so the map is active. Then open the Test/Calibration screen and pick the Control Manager Device (probably Control Manager Device 1) that the CMS axis is assigned to. Work the buttons and watch the Raw Data Display. The axis should move from 0 to 255, if it does that then the CM is doing what it should.

The next most likely problem is that FS didn't have a default for the axis and so set the Sensitivity down, maybe even to 0. Go into Flight Sim and find the Sensitivity and Null Zone screen, look at the axis there. It can be a little confusing if the axis is out past the Z axis, FS only shows the first 3 axes. There are scroll bars that will get you to the 4th, 5th, and 6th axes, but they aren't obvious. Anyway, find the axis there and make sure that the Sensitivity is fully right and the Null Zone is fully left.

Beyond that, I don't know. If you're passing it through FSUIPC, there may be some adjustment necessary there, too, but beyond that I'm not sure what might keep it from going through the full range.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com