Results 41 to 50 of 65
-
04-18-2011, 10:19 AM #41
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Heheheh, you should see some of the scripts I have done in my free time. They are far more demanding than you may think. Here's one I wrote earlier this year:
Code:Var 7777, Link FSUIPC_IN, Offset $3AB0, Length 8, Numbers 0 // EGT2 { L0 = V7777 - 459.67 // FSUIPC Conversion Rankine -> Celcius L0 = L0 - 32 L0 = L0 * 5 L0 = L0 / 9 L0 = ABS L0 // L0 not signed L2 = L0 IF L0 <= 100 // First sector { L1 = L2 * 0.07 // (7 steps/100 values) = 0.07 } ELSE // Is a greater value { L2 = L0 - 100 // L2 only have values for next sector IF L0 <= 200 // Second sector { L1 = L2 * 1.37 // (137 steps / 100 values) = 1.37 L1 = L1 + 7 // Add steps of others sectors (+7) } ELSE { L2 = L0 - 200 // L2 only have values for next sector IF L0 <= 500 // 3. Sector { L1 = L2 * 1.463 // ( 439 / 300) = 1.463 L1 = L1 + 144 // Add steps of others sectors (7 + 137) } ELSE // Out of range { L2 = L0 - 500 // L2 only have values for next sector IF L0 <= 800 // 4. sector { L1 = L2 * 1.437 // (431 steps / 300 values) = 1.437 L1 = L1 + 583 // Add steps of others sectors (7 + 137 + 4 } ELSE { L1 = 1014 // Max. position } } } } &Servo1 = 0 + L1 // Add to minimum (0) }
I have simply asked how it can be factorised, that's all. Nothing else.
0 = 130
1 = 128
2 = 126
And so on... As you can see, linear, but I cannot personally factorise it.
Thank you, once again, for the explanation of Hex, it is helpful.
Jack
-
04-18-2011, 10:51 AM #42
- Join Date
- Jul 2013
- Posts
- 917
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Jack
Good luck then, I will be gentle and not answer your question
David
-
04-18-2011, 11:18 AM #43
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
What else should I expect from a SIOC question thread!
I don't see how your comment is appropriate to this thread, I'm sorry. From now on, I'd only like post related directly to the scaling of the HSI which is, interestingly, the title of this thread.
For those of you who can answer: Using Gery's method, how could I factorise 0 = 130, and 1 = 128? I can only see this method working if the pot is at 0 at 0 degrees.
-
04-18-2011, 12:09 PM #44
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
7B means 7 * 16 + 11 = 123 ...
I was only trying to help you to learn the difference between number notations (binary, decimal and hexadecimal for instance). You have to understand that if you are using FSUIPC offsets or lekseecon variables. Some of my Lekseecon variables are coded in hex (like the clocks 846 and 847, the COMM displays 852 and 853 , ...).
NicoLast edited by kiek; 04-18-2011 at 12:12 PM.
-
04-18-2011, 12:19 PM #45
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Last edited by kiek; 04-18-2011 at 12:44 PM.
-
04-18-2011, 01:17 PM #46
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Thank you Nico for the further explanation. It seems I have some mathematical work to do.
Anyway, back on topic. I've been working my brain tying to solve the Pot V Motor problem.
0 degrees = 130
1 degrees = 128
2 degrees = 126 (actually 127 because it decreases by 1.87 each time, not 2, but such a small difference).
And so on...
Does anyone know, using Gery's method, how the Pot values can be factorised? Am I wrong in thinking that his method only works if Pot 0 = Degrees 0?
Jack
-
04-18-2011, 04:04 PM #47
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Hi guys,
Just an idea... Although this method is labour intensive...
I could hand-assign each potentiometer value to its respective heading value, and tell SIOC to stop the motor if it is equal to the offset, ELSE move =ve/-ve.
EDIT: I have decided to go ahead with this method.
Please see above.
-
04-18-2011, 07:50 PM #48
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
HI everyone,
I'm having trouble with the method below.
I developed a test script. For 90% of the instrument, this script is inactive; it only works in the range heading 346-004.
Can anyone tell me why, whenever "P" changes value, it's subsequent brackets are completely ignored by SIOC and not executed? My motor just continously spins in a single direction, never changing according to P, like it should...
Code:Var 0004, name Motor4, Link USB_DCMOTOR, Output 4 Var 0005, name CRS, Link FSUIPC_IN, Offset $0C4E, Length 2 Var 2, name P { IF &P > &CRS { &Motor4 = 123 } ELSE { IF &P < &CRS { &Motor4 = 253 } ELSE { IF &P = &CRS { &Motor4 = 128 } } } } Var 1, name A4, Link USB_ANALOGIC, Input 4, PosL 0, PosC 127, PosR 250 { IF &A4 = 140 { &P = 346 } ELSE { IF &A4 = 139 { &P = 347 } ELSE { IF &A4 = 138 { &P = 349 } ELSE { IF &A4 = 137 { &P = 350 } ELSE { IF &A4 = 136 { &P = 352 } ELSE { IF &A4 = 135 { &P = 353 } ELSE { IF &A4 = 134 { &P = 354 } ELSE { IF &A4 = 133 { &P = 356 } ELSE { IF &A4 = 132 { &P = 357 } ELSE { IF &A4 = 131 { &P = 359 } ELSE { IF &A4 = 130 { &P = 000 } ELSE { IF &A4 = 129 { &P = 001 } ELSE { IF &A4 = 128 { &P = 002 } ELSE { IF &A4 = 127 { &P = 004 } } } } } } } } } } } } } } }
Jack
-
04-18-2011, 09:10 PM #49
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Hi everyone,
According to Hessel Oosten's guide, it says that "128" commands the motor to stop.
This is definitely not true; it causes my motors to go very fast instead.
I made a script that when CRS = 0, Motors = 128 (stop).
However, when the CRS hit 0, the motors shot up in speed, before going back down after surpassing 0.
Weird huh?
Jack
-
04-19-2011, 05:12 AM #50
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Hi Jack,
Computers are not like humans... Brackets are not ignored because SIOC does not like you, if they are not executed, then you may conclude that var P never changed value...
And how come P never changes value? Maybe because var A4 is outside the range 127 - 140? Please check.
Nico
Similar Threads
-
DC Motors Card - How to use in SIOC?
By Boeing 747 Flyer in forum OpenCockpits General DiscussionReplies: 4Last Post: 04-20-2017, 09:11 PM -
Expansion card buggy? Shows "ghost" inputs where there aren't...
By Michael737NG in forum OpenCockpits General DiscussionReplies: 0Last Post: 12-26-2010, 07:02 AM -
SIOC "IF" Question
By Boeing 747 Flyer in forum OpenCockpits General DiscussionReplies: 89Last Post: 08-29-2010, 05:34 PM -
FSX "This graphics card does not meet minimum ..." HELP !!!!
By ibennett in forum Computer Hardware SetupReplies: 5Last Post: 04-12-2010, 09:46 PM -
Looking for "Below GS" and "Spoilers armed" annunciator light offset
By PeterH in forum PM General Q & AReplies: 17Last Post: 03-05-2008, 12:39 PM
Candid connections: Platform for casual relationships Live Women Prime Сasual Dating
Super Сasual Dating - Genuine...