Results 31 to 40 of 70
Thread: Interfacing a Basic ASI Gauge
-
06-18-2010, 03:41 PM #31
Re: Interfacing a Basic ASI Gauge
Who is Jason?
Anyway, when you say run the IOTEST software, am I trying to find the mid/max/centre points of the GAUGE or the SERVO? Surely won't they just be the values of 0, 512, and 1024? Or is it different for each Servo? I know you have explained before but I'm a real novice on all this motorized know-how.
Also, I may have to contact Opencockpits regarding the script... Really not sure of what to do then. In 737NUT's examples the VSI line is only one line, and nothing else.
-
06-18-2010, 04:45 PM #32
- Join Date
- Jul 2013
- Posts
- 917
Re: Interfacing a Basic ASI Gauge
Jack/Jason
I edited out the mistake earlier, sorry for the mixup
Forget the left centre and right values for the time being, you have a bigger challenge ahead of you! The SIOC code to make the gauge work is not just the one line referencing the servo, it is a whole collection of commands to read the ASI values from a FSUIPC offset, convert the values into a suitable numeric and scale the result to suit the ratio of movement between the servo and gauge face, then make the servo move. The single line you quote only sets the parameters for the servo - nothing else. You need to understand how to code in SIOC and I suggest that you try this site http://www.lekseecon.nl/ as well as downloading and the SIOC manuals from the OC site.
Even if you were fortunate enough to find a script, you would still need to tailor it significantly to suit your needs, hence the need to fully understand how SIOC commands work. I will try to find and post a simple gauge script (not ASI) to give you a starting point
Good luck
David
-
06-18-2010, 04:56 PM #33
- Join Date
- Jul 2013
- Posts
- 917
Re: Interfacing a Basic ASI Gauge
Jack
Here is a very simple script
var 9004, name Servo4, Link USB_SERVOS, Output 4, PosL 1, PosC 511, PosR 1023, Type 2 // Servo Motor
Var 9005, name LeftDuctPress, Link FSUIPC_INOUT, Offset $5315, Length 2 // Duct Pressure * 10
{
L0 = &LeftDuctPress / 1.5
&Servo4 = L0 + 364
}
This script defines the servo and the offset to get the gauge data
It then scales the data to suit the gauge range and then adds a value to position the needle at the beginning of the gauge
Please now follow my advice and links to understand how SIOC works before proceeding further
Regards
David
-
06-19-2010, 01:08 PM #34
Re: Interfacing a Basic ASI Gauge
Hi David,
Yes I've trawled through Nicos site in the past and found it very informative, unfortunately no SIOC Servo examples (I already know how to program in SIOC for things like push-buttons)
I've taken a look at your SIOC example.
First question - Why are there two variables if it is for one continous gauge?
Secondly, What are the lines "L0 = &LeftDuctPress / 1.5
&Servo4 = L0 + 364" For, are these the scaling lines which define the gauge?
Apart from that, I can understand the rest of it. I think it is just trying to physically find the scaling and writing it in SIOC.
-
06-19-2010, 02:24 PM #35
- Join Date
- Jul 2013
- Posts
- 917
Re: Interfacing a Basic ASI Gauge
Jack
Servo4 is the variable attached to the servo motor, so when that variable changes value the servo motor will move
Leftductpress is the variable collecting the actual value you need from flight sim
By way of further explanation
L0 = &LeftDuctPress / 1.5 is scaling the data to suit the needle range
&Servo4 = L0 + 364 - as the gauge needle travel does not match the servo, adding this number makes sure that when the data is zero, the needle is also at zero
David
-
06-19-2010, 02:49 PM #36
Re: Interfacing a Basic ASI Gauge
Right then, this is starting to make sense.
As you said, could I use the SIOC example you posted and tailor it to my specifications?
Is there something such as a "SIOC dictionary" that I could look up certain terms such as "l0" and "Length2"?
When you say scaling the data to suit the needle range, is that the 1.5 value which suceeds the forward slash?
I definitely understand the + 364 part though, as you say this is to match both gauges to zero (this means that the "real" gauge is +364 from the zero positon).
Thanks,
Jack
Thanks,
Jack
-
06-19-2010, 03:04 PM #37
- Join Date
- Jul 2013
- Posts
- 917
Re: Interfacing a Basic ASI Gauge
Jack
yes
yes - download the sioc manuals from OC. By the way IO is actually ten in my example (the fsuipc offset provides the data times ten)
yes
yes
David
-
06-19-2010, 03:09 PM #38
Re: Interfacing a Basic ASI Gauge
Okay, I will download the manuals.
Does 1.5 mean that the movement is 1.5 times the sim movement or soemthing?
-
06-19-2010, 04:28 PM #39
Re: Interfacing a Basic ASI Gauge
Right. I am ready to modify the script into my needs, and I would appreciate if yo ucould evaluate it.
First of all, I need to know:
- How you get the "var" number
- How you get the "Length" number
- How to know what number to divide (in this case) LeftDuctPress by?
Thankfully though, I understand the following lines!
L0 = &LeftDuctPress / 1.5
&Servo4 = L0 + 364
The top line is defining what "L0" is, in this case LeftDuctPress/1.5 - The bottom line is defining what the value of Servo4 is, which is the formula of the top line + 364, which matches the "real" servo position of "0".
Correct?
-
06-19-2010, 06:56 PM #40
- Join Date
- Jul 2013
- Posts
- 917
Re: Interfacing a Basic ASI Gauge
Jack
Sorry, but we cannot go fwd together on a "drip feed" basis. You need to demonstrate some effort into understanding SIOC - then I am happy to help. I am not an alternative to the manual. Trust that you will understand
David
Similar Threads
-
Interfacing an Exhaust Gas Temperature Gauge
By Mike.Powell in forum Interfacing Real Aviation PartsReplies: 8Last Post: 11-30-2011, 07:07 AM -
Looking for some basic help??
By Robert Byrne in forum General Builder Questions All Aircraft TypesReplies: 4Last Post: 12-22-2010, 05:48 AM -
FSBUS Dll and Visual Basic
By Anderson/SBSP in forum I/O Interfacing and HardwareReplies: 10Last Post: 02-20-2010, 11:37 PM -
USB basic help
By Redbirdman in forum Computer Hardware SetupReplies: 6Last Post: 03-18-2009, 05:44 PM -
737 OHD Systems basic IRS logic
By eudoniga in forum PMSystemsReplies: 5Last Post: 06-09-2008, 03:42 AM