Re: Interfacing a Basic ASI Gauge
Jack,
This script does nothing ...
First you have to specify what you want to achieve and then you have to develop an algorithm doing that (using these Vars and maybe some others as well). You have to write SIOC code between curly braces attached to a Var otherwise nothing will happen at all ....
regards,
Nico
Re: Interfacing a Basic ASI Gauge
Hi Nico,
As I said the script is not finished, I have to scale it yet.
I noticed on the previous page David (on one of his scripts) posted the line "L0 = &LeftDuctPress / 1.5"
I understand that line, except for the definition of "L0". The line means that, whatever L0 is, is that it is equal to the value of LeftDuctPress Offset divided by 1.5.
The line after that, "&Servo4 = L0 + 364", I udnerstand as the scaling of the servo. It is basically telling the servo that Zero is "+364", so that the gauge and "real" servo are in-sync (if that makes sense, pretty much making sure that both of them are zero).
If all that is correct, that means I understand about 85% of that SIOC script, I just need to know what L0 is, and then I can start to develop my own.
I'm finding this fun, learning SIOC is a challenge but I see how it can be rewarding. Still, I don't understand how everyone can learn SIOC when one of the tutorials is a dead link, and the manual is 6 years out of date!:)
Thankfully, your site does provide relief to an extent, I learnt how to program push-buttons and basic outputs (like LEDs) from you site.
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
I just need to know what L0 is,
L0 is a internal integer/float variable, to be used in a script, see my HowTo page http://www.lekseecon.nl/howto.html#internalVars
Study the Help information in Config_sioc, it decribes each language feature of SIOC ...
Quote:
Originally Posted by
Boeing 747 Flyer
and then I can start to develop my own.
Again, in my opion, you are too optimistic. I'd recommend to practice with SIOC scripts for easier tasks first (encoders, leds, and so on). Programming Servo's is risky if you do not understand it fully. Servo's can be blown up easily ... ;-)
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
I don't understand how everyone can learn SIOC when one of the tutorials is a dead link, and the manual is 6 years out of date!:)
The SIOC language has not changed much since 2004 except for some minor additions. So one cannot say that the Manual is out of date....
A lot of programming languages have Manuals dating years back, but these languages are still being used today ;-)
Re: Interfacing a Basic ASI Gauge
Nico, I'm referring to the SIOC interface has changed. It looks much more different to 2004.
Furthermore, I'm extremely please because I *think* I understand the L0 now.
Is this correct:
For example:
"v7 = v3 / 7 + v9" = WRONG, because more than one operation is happening in one line/statement
"L0 = v3 / 7
v7 = L0 + v9" = CORRECT, because you are using L0 as a "subtitute" to v3 / 7
Is that correct?
Also, a more practical example:
"L0 = &LeftDuctPress / 1.5
&Servo4 = L0 + 364"
=
"&Servo4 = &LeftDuctPress / 1.5 + 364" -> BUT this cannot be written as it is more than one operation.
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
Nico, I'm referring to the SIOC interface has changed. It looks much more different to 2004.
With 'SIOC interface' I believe you mean the 'tools'. If I'm right you are referring to the -now obsolete- GUI tool for programming IOCards.
The other option, SIOC as a language for programming IOCards, has not changed and if you are using the Notepad editor the 'tooling' also has not changed ;-)
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
Is that correct?.
Yes it is.
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
kiek
Yes it is.
Woooooo!:o
also, you say I should try programming rotary encoders. I think I know how to do this already, the following small script is for a Speed Selector on the A/P Panel, which ranges from 0 to 999 knots:
Var 6 Link IOCARD_ENCODER Input 43 Aceleration 3 Type 2
{
L0 = v6 * +1
v7 = ROTATE 0 999 L0
Is that correct?
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
"var 6 Link IOCARD_ENCODER Input 43 Aceleration 3 Type2
{
L0 = v6 * +1
v7 = ROTATE 0 999 L0"
No, this script will not even compile, because it is syntactically not correct. Please try to compile your script first before posting questions here...
Let us end this discussion now. A Forum is not the right place to teach you programming...
Re: Interfacing a Basic ASI Gauge
Jack
(posted before I saw Nico`s reply, but the message is still sound)
Sorry but no!
Remove the quotes before var 6
Add a curly bracket at the end of the code
Where is the definition for Var7? ie where does the output go to?
Sorry, but you are a bit like a spinning top bouncing off the walls:)
Slow down, follow Nico`s advice and try working simple examples through. For example did you try to compile this script, if you had, then errors would have been flagged. Learn the simple steps first - please:)
David