Results 61 to 65 of 65
-
04-20-2011, 05:42 AM #61
- Join Date
- Jul 2013
- Posts
- 917
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Jack
You are in danger of compounding error on error. The logic is flawed in at least one place, as per your last para above. Please take Nico`s advice - stop coding and rethink.
David
-
04-20-2011, 08:14 AM #62
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
No the subroutine has no effect at all (no output), that must be caused by something else.
Yes I said that you should put the logic for motor control in the subroutine. Of course I meant the right logic, not yours.
And now I really stop with this thread, I've had enough of it
-
04-20-2011, 05:43 PM #63
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Okay, how's this?
Code:Var 0, Value 0 { &Motor4 = 201 } Var 0004, name Motor4, Link USB_DCMOTOR, Output 4 Var 49, name P, Link SUBRUTINE, { C0 = &CRS = 0 C1 = &CRS = 360 IF C0 OR C1 { IF &A42 = 130 { &Motor4 = 129 } ELSE { &Motor4 = 201 } } } Var 0005, name CRS, Link FSUIPC_IN, Offset $0C4E, Length 2 { CALL &P } Var 58, name A42, Link USB_ANALOGIC, Input 4, PosL 0, PosC 127, PosR 250 { CALL &P }
Jack
-
04-21-2011, 06:17 AM #64
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
YEEEEAAAAHHAAAAA!
I finally got it working with TWO degrees now.
The CRS pointer now stops at 355 and 360 degrees. And, although laborious, I am starting the process of doing all 359 degrees.
Woo!
This was my final script.
The 360 degree script:
Code:Var 0, Value 0 { &Motor4 = 201 &control = 0 &control = TIMER 1 0 5 } Var 158 name control Link SUBRUTINE { CALL &P2 } Var 0004, name Motor4, Link USB_DCMOTOR, Output 4 Var 49, name P, Link SUBRUTINE, { IF &Motor4 = 129 { C0 = &CRS < 360 C1 = &CRS > 0 IF C0 AND C1 { IF &A42 = 130 { &Motor4 = 201 } } } } Var 0005, name CRS, Link FSUIPC_IN, Offset $0C4E, Length 2 { CALL &P } Var 58, name A42, Link USB_ANALOGIC, Input 4, PosL 0, PosC 127, PosR 250 { C0 = &CRS = 0 C1 = &CRS = 360 IF C0 OR C1 { IF &A42 = 130 { &Motor4 = 129 } ELSE { &Motor4 = 201 } } }
Code:Var 49, name P1, Link SUBRUTINE { IF &Motor4 = 129 { C0 = &CRS1 < 355 C1 = &CRS1 > 355 IF C0 OR C1 { IF &A42 = 134 { &Motor4 = 201 } } } } Var 0005, name CRS1, Link FSUIPC_IN, Offset $0C4E, Length 2 { CALL &P1 } Var 50, name P2, Link SUBRUTINE, { IF &CRS = 355 { IF &A42 = 134 { &Motor4 = 129 } ELSE { &Motor4 = 201 } } }
So yes, everything is working! For now...
-
04-21-2011, 10:59 AM #65
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
YES, this is what I meant, but you should update the body of Subroutine P with the right logic.
Regarding your second post with as well a subroutine P1 as a subroutine P2: NO THAT'S NOT RIGHT! Now again you have created more places where you control the motor, don't do that.! Do not write 360 scripts (which is not very efficient, to say the least ..............) , but write ONE control script in subroutine P.
I could write it in an hour, but I'll leave it to you as an exercise.
NicoLast edited by kiek; 04-21-2011 at 11:53 AM.
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...