Results 61 to 70 of 101
Thread: USBServos Software not working?
-
07-04-2010, 03:58 PM #61
Re: USBServos Software not working?
Okay lads, hows about this: (ServoT.ssi)
Code:// ***************************************************************************** // * Config_SIOC ver 3.7B1 - By Manolo Vélez - www.opencockpits.com // ***************************************************************************** // * FileName : ASIgauge.txt // * Date : 7/3/2010 Var 0000, Value 0, name Intialization // Set servo positions { &Servo4 = 367 } Var 9000, name Servo4, Link USB_SERVOS, Output 1, PosL 367, PosC 637, PosR 907, Type 2 // ASI gauge Var 9003, name IAS, Link FSUIPC_INOUT, Offset $02BC, Length 4 // IAS from SIm { L0 = &IAS / 1.5 &Servo4 = L0 + 213 IF L0 < 50 { &Servo4 = 367 } IF L0 > 350 { &Servo4 = 907 } }
Code:[SIOC] IOCP_port=8092 IOCP_timeout=4000 Minimized=Yes toggle_delay=20 CONFIG_FILE=ServoT.ssi [IOCARDS MODULE] IOCard_disable=No IOCard_LPT=No USBSERVOS=1,77 [FSUIPC MODULE] FSUipcdisable=No FSUipcRefresh=50 [IOCP CLIENTS MODULES] IOCPini_delay=3000 IOCPclient0_disable=Yes IOCPclient0_host=localhost IOCPclient0_port=8090 IOCPclient1_disable=Yes IOCPclient1_host=localhost IOCPclient1_port=8099 [SOUND MODULE] Sound_disable=Yes Volume=100
-
07-04-2010, 04:12 PM #62
-
07-04-2010, 05:44 PM #63
Re: USBServos Software not working?
Although semantically the same, this is better code:
Code:Var 9003, name IAS, Link FSUIPC_IN, Offset $02BC, Length 4 // IAS from SIm { L0 = &IAS / 1.5 &Servo4 = L0 + 213 IF L0 < 50 { &Servo4 = 367 } ELSE { IF L0 > 350 { &Servo4 = 907 } } }
IF L0 < 50 there is no need to test whether it is also > 350 (because it is not) so you better use an IF ELSE statement to save cpu time
Nico
-
07-04-2010, 10:54 PM #64
- Join Date
- Apr 2009
- Location
- Toronto
- Posts
- 125
Re: USBServos Software not working?
Code:Var 9003, name IAS, Link FSUIPC_IN, Offset $02BC, Length 4 // IAS from SIm { L0 = &IAS / 1.5 &Servo4 = L0 + 213 IF L0 < 50 { &Servo4 = 367 } ELSE { IF L0 > 350 { &Servo4 = 907 } } }
I don't have a servo card, so I may not be understanding this well; but, I assume that the intention is to produce a result such that: 366 < &Servo4 < 908.
The above code doesn't do that. Consider: &IAS=120; L0=80; &Servo4 = 293.
Maybe:
Code:Var 9003, name IAS, Link FSUIPC_IN, Offset $02BC, Length 4 // IAS from SIm { L0 = &IAS / 1.5 &Servo4 = L0 + 213 IF &Servo4 < 367 { &Servo4 = 367 } ELSE { IF &Servo4 > 907 { &Servo4 = 907 } } }
Code:Var 9003, name IAS, Link FSUIPC_IN, Offset $02BC, Length 4 // IAS from SIm { &Servo4 = &IAS / 1.5 &Servo4 = LIMIT 367,907,213 }
Code:Var 9000, name Servo4, Link USB_SERVOS, Output 1, PosL 367, PosC 637, PosR 907
Jim
-
07-05-2010, 03:09 AM #65
Re: USBServos Software not working?
Hi Jim,
I had no intention to write correct code for his application. I was only showing some SIOC constructs.
Note: Your example code (above) is not right i'm afraid, because you already write a too low value (293) to &servo4 before you test the limits in the next statement....
Nico
-
07-05-2010, 03:34 AM #66
Re: USBServos Software not working?
Okay, I'll remove the limits then as they seem to be causing some questions to be raised. Hows about this (limits removed):
Code:Var 0000, Value 0, name Intialization // Set servo positions { &Servo4 = 367 } Var 9000, name Servo4, Link USB_SERVOS, Output 1, PosL 367, PosC 637, PosR 907, Type 2 // ASI gauge Var 9003, name IAS, Link FSUIPC_INOUT, Offset $02BC, Length 4 // IAS from SIm { L0 = &IAS / 1.5 &Servo4 = L0 + 213
Code:[SIOC] IOCP_port=8092 IOCP_timeout=4000 Minimized=Yes toggle_delay=20 CONFIG_FILE=ServoT.ssi [IOCARDS MODULE] IOCard_disable=No IOCard_LPT=No USBSERVOS=1,77 [FSUIPC MODULE] FSUipcdisable=No FSUipcRefresh=50 [IOCP CLIENTS MODULES] IOCPini_delay=3000 IOCPclient0_disable=Yes IOCPclient0_host=localhost IOCPclient0_port=8090 IOCPclient1_disable=Yes IOCPclient1_host=localhost IOCPclient1_port=8099 [SOUND MODULE] Sound_disable=Yes Volume=100
Thank you very much,
Jack
-
07-05-2010, 05:19 AM #67
Re: USBServos Software not working?
Hi Jack,
Like I wrote earlier in this thread, the FSUIPC definition for offset 0x0B2C reads:
IAS: Indicated Air Speed, as knots * 128
I do not see your algorithm taking care of that.... Should you not divide by 128 get IAS in knots first?
And why do you divide by 1.5? What's the reasoning behind that?
Nico
-
07-05-2010, 05:44 AM #68
Re: USBServos Software not working?
Hi Nico,
Yes I understand dividing by 128, it makes perfect sense. Not really sure why it's /1.5 I will change it now. Anything else I need to take care of? Is the SIOC.ini okay?
Also, should I change 213 to 205 as that's my "0" value, although my phyiscal ASI only starts at 50Knots.
-
07-05-2010, 06:33 AM #69
- Join Date
- Jul 2013
- Posts
- 917
Re: USBServos Software not working?
Jack
The reason why it is 1.5 is that was the figure in the "sample" sioc text I gave you a while back. I also said in a previous post
" Yes, there is more code ammendment required - for example you will need to establish whether the multiplier 1.5 or indeed the + value of 213 is correct"
David
-
07-05-2010, 08:32 AM #70
Re: USBServos Software not working?
Thanks David, all is corrected. Interestingly, I actually noticed that the /1.5 was wrong after looking at the SDK manual, but forgot to correct!
So, before I finally boot up FSX and test, are there any errors in the following SIOC script:
Code:// ***************************************************************************** // * Config_SIOC ver 3.7B1 - By Manolo Vélez - www.opencockpits.com // ***************************************************************************** // * FileName : ASIgauge.txt // * Date : 7/3/2010 Var 0000, Value 0, name Intialization // Set servo positions { &Servo4 = 205 } Var 9000, name Servo4, Link USB_SERVOS, Output 1, PosL 205, PosC 468, PosR 730, Type 2 // ASI gauge Var 9003, name IAS, Link FSUIPC_INOUT, Offset $02BC, Length 4 // IAS from SIm { L0 = &IAS / 128 &Servo4 = L0 + 213 IF L0 < 50 { &Servo4 = 205 } IF L0 > 350 { &Servo4 = 730 } }
Code:[SIOC] IOCP_port=8092 IOCP_timeout=4000 Minimized=Yes toggle_delay=20 CONFIG_FILE=ServoT.ssi [IOCARDS MODULE] IOCard_disable=No IOCard_LPT=No USBSERVOS=1,77 [FSUIPC MODULE] FSUipcdisable=No FSUipcRefresh=50 [IOCP CLIENTS MODULES] IOCPini_delay=3000 IOCPclient0_disable=Yes IOCPclient0_host=localhost IOCPclient0_port=8090 IOCPclient1_disable=Yes IOCPclient1_host=localhost IOCPclient1_port=8099 [SOUND MODULE] Sound_disable=Yes Volume=100
Similar Threads
-
Working Music-Who do you listen to when working on your simulator?
By blueskydriver in forum Cockpit SoundsReplies: 11Last Post: 02-28-2011, 04:09 PM -
Real-World Aircraft Instruments interfaced to FSX via SIOC & USBServos
By Boeing 747 Flyer in forum My Cockpit UpdateReplies: 1Last Post: 08-07-2010, 08:58 AM -
USBSERVOS Card testing
By Tripacer in forum OpenCockpits General DiscussionReplies: 3Last Post: 01-14-2009, 12:25 AM -
USBServos Card Testing
By Tripacer in forum OpenCockpits General DiscussionReplies: 1Last Post: 12-07-2008, 12:37 AM -
What are you working on?
By Bob Reed in forum My Cockpit UpdateReplies: 21Last Post: 12-22-2006, 12:22 PM
This radio panel is advertised on Ebay. Does anybody know if I can use it with fs2004 Win7? It...
flightsim radio panel usbc....