PDA

View Full Version : Interface cards and programing languages



585VB
09-21-2011, 08:19 PM
Hi,
I'm extremely new to this and still in a research phase. I know that this is a rather open ended question and there is some personal preference involved.
But I am trying to decide what interface cards and languages would allow me to interface real gauges with Xplane. Would I be able to use SIOC or Python with other cards other than IOCards from OC? If the card drivers are installed, I probably could but I have never done this before. What I am considering is using either IOcards, Leo's BU0836X, or Phidgets. which language is the best to use with real aircraft gauges, python, SIOC, or another? It seems like the more research I do the more I don't know where to start. forgive me if I asked too open a question.

Dozer
06-21-2012, 07:58 AM
I realise this thread is 9 months old, but in case the OP has email notifications turned on, and for the benefit of anyone arriving here from a search engine...

The Teensy USB boards made by pjrc (www.pjrc.com/teensy) are very very very good for interfacing stuff to X-Plane. These boards are Arduino-compatible, but with a better (more integrated) USB datalink, and are programmed in C++. They now come with libraries for connecting to X-Plane, so reading and writing data to the sim is very easy. Here's a demo program for the Teensy which just stops your transponder from being set to 7500, the hijack code, which gets you automatically kicked from VATSIM:

FlightSimInteger transponderCode;

void setup() {
transponderCode = XPlaneRef("sim/cockpit2/gauges/actuators/transponder_code");
//the string starting sim/ is an X-Plane dataref, as used to animate all the stuff in the 3d and 2d cockpits
}

void loop() {
FlightSim.update();

if (transponderCode == 7500) { //this reads the transponder code from X-Plane
transponderCode = 7501; //this sets the transponder code to 7501
}
}

A useful program would also read and write to hardware (using standard Arduino libraries and techniques), but there's lots of articles on how to do that and this is just to demonstrate how easy it is to interact the hardware's microprocessor with X-Plane's data. You can call X-Plane commands too. (Sorry MSFS users, MSFS's classic architecture is harder to interface with.)

I'm using a Teensy to connect a real transponder control unit to X-Plane as an input device, and if you search for "Curd Zechmeister L-1011" you'll find some excellent blog posts on interfacing radio frequency selectors. For output, annunciators and lights could be operated using relays or possibly Darlington pairs if 5v is inadequate. For moving instruments, you'd probably need to alter the mechanism to be driven by an RC servo or a stepper motor but Teensy can drive either without difficulty.

I made a prototype instrument last week, using a stepper motor to drive the needle and a Hall switch and magnet for positional feedback. It worked well, but I had to pack it away as I'm halfway through moving house.