tiburon
05-15-2011, 09:18 AM
A total newbie at SIOC, I'm trying to get my USBkeyscard to send a simple 0/1 command to FSUIPC offset x0BC8 to release and apply the parking brakes in the PMDG 737. I know I can use IOCkeys to define a keystroke but I already have the ATC module rotary working through SIOC thanks to a script by a member of this forum and I would like to get my head around it fot future interfacing.
So I connected the card, opened sioc and read the device id : 44. I then opened SIOC.ini and changed it to read USBkeys=0,44
here's my sioc.ini :
[************** SIOC ***************]
[ IOCP port ]
IOCP_port=8090
[ IOCP Timeout ]
IOCP_timeout=4000
[ Start minimized in tray ]
Minimized=No
[ Deley needed for var. toggles (Project Magenta) ]
toggle_delay=20
[ Configuration File ]
CONFIG_FILE=.\SCRIPTS\SIOC ATC PMDG.txt
[************** IOCARDS MODULE ***************]
[ Disable IOCards module ]
IOCard_disable=No
[ Use LPT port in IOCards ]
IOCard_LPT=No
[------------- CARDS CONFIG -------------]
[ IOCard Master ]
[...............]
[ English : ]
[ MASTER=(Device index),(Type),(Number of cards),(Device number) ]
[ Device index : Index used in SIOC variable like device, this is the card used for SIOC sentence ]
[ Use 0 for only one card, for this value you not need specify Device number. If you not use DEVICE parameter in a definition in SIOC script, the default index used is 0]
[ type = 0 : Master Card Emulator ]
[ type = 1 : Master Card connected directly to parallel port ]
[ type = 2 : Master Card connected throught compatibility cable to parallel port ]
[ type = 3 : Expansion Card connected throught parallel port ]
[ type = 4 : USBExpansion Card used ]
[ type = 5 : Opencockpits MCP module ]
[ type = 6 : USBOutputs Card used ]
[ type = 7 : Opencockpits EFIS module ]
[ type = 8 : Opencockpits Radio COM module ]
[ type = 9 : Opencockpits Radio NAV module ]
[ type = 10 : Opencockpits Radio ADF module ]
[ type = 11 : Opencockpits Radio ATC module ]
[ Number of Cards = Master cards connecteds, 1 to 4 for expansion cards, 1 for a Master card directly connected or Emulator ]
[ Number of device = 0 for Emulator or first USB card detected, parallel port address, device number for specifies USBexpansion card ]
[ For example, a Master Card connected directly to parallel port : ]
[ MASTER=0,1,1,$0378 ]
[ For example, two USBExpansion cards connected with 3 and 2 Master cards used ]
[ MASTER=0,4,3,22 ]
[ MASTER=1,4,2,24 ]
[ For example, use of Master card emulator ]
[ MASTER=0,0,1,0 ]
[ Use the first USBExpansion card connected with only one Master Card attached ]
[ Esta definición es para usar la primera tarjeta USBExpansion que se encuentre instalada que además llevará conectada una placa Master ]
[MASTER=3,6,1,252]
[MASTER=0,4,1,0]
[MASTER=0,4,1,0]
MASTER=0,4,2,0
MASTER=0,11,2,0
[ Name_of_card=(Device index),(Device number) ]
[ Device index : Index used in SIOC variable like device, this is the card used for SIOC sentence ]
[ Use 0 for only one card, for this value you not need specify Device number. If you not use DEVICE parameter in a definition in SIOC script, the default index used is 0]
[ Number of device = 0 for first USB card of this type detected, or device number for a specifies device ]
[ Example of two USBServos for index 0 and 1, and device number 17 and 23 ]
[ USBServos=0,17 ]
[ USBServos=1,23 ]
USBStepper=0,0
USBKeys=0,44
USBServos=0,0
USBRelays=0,0
USBDCmotor=0,0
[ Para los ejes analógicos se usan los números de devices de las tarjetas donde están alojados ]
[ For analogic axles, you use the device number of cards what allow the axles ]
USBAnalogic=0,0
[************** FSUIPC MODULE ***************]
[ Desabilitar lectura de las FSUIPC ]
[ FSUIPC disable mode yes/no ]
FSUipcdisable=No
[ Refresco recepción FSUIPC ]
[ FSUIPC refresh ]
FSUipcRefresh=50
[************** IOCP CLIENTS MODULES ***************]
[ Retraso para inicializacion una vez conectado el cliente en milisegundos ]
[ Delay for initialization when client has been connected in mseconds ]
IOCPini_delay=3000
[************** IOCP CLIENT MODULE #0 ***************]
[ Desactivar el módulo cliente IOCP ]
[ Disable IOCP client module ]
IOCPclient0_disable=Yes
[ IP del servidor donde debe de conectar el cliente ]
[ IOCP client host name ]
IOCPclient0_host=localhost
[ Puerto de envio del protocolo IOCP cliente ]
[ IOCP client port ]
IOCPclient0_port=8090
[************** IOCP CLIENT MODULE #1 ***************]
[ Desactivar el módulo cliente IOCP ]
[ Disable IOCP client module ]
IOCPclient1_disable=Yes
[ IP del servidor donde debe de conectar el cliente ]
[ IOCP client host name ]
IOCPclient1_host=localhost
[ Puerto de envio del protocolo IOCP cliente ]
[ IOCP client port ]
IOCPclient1_port=8099
[************** SOUND MODULE ***************]
[ Ficheros de sonido ]
[ Sound Files ]
[ Desactivar el módulo de sonido ]
[ Disable Sound module ]
Sound_disable=yes
[ Volumen general de los sonidos 0-100 ]
[ Master Volume 0-100 ]
Volume=100
[ put '*' first filename for loop Sound ]
[ anteponer '*' en el fichero para bucle continuo de sonido]
[ Sound=wav_file,frequency,volume,pan ]
[ frequency=100 to 100000 0=original -1=current ]
[ volume=0 to 100, -1=current ]
[ pan=-100 (left) to +100 (right) 0=center -1=current ]
[ Sound=Fichero_wav,frecuencia,volumen,balance ]
[ frecuencia=100 hasta 100000 0=original -1=Por defecto ]
[ volumen=0 hasta 100 -1=Volumen por defecto ]
[ balance=-100 (Izquierda) hasta +100 (Derecha) 0=centro -1=Por defecto ]
[ #1 ]
Sound=APDis.wav,-1,-1,-1
[ #2 ]
Sound=*outermk.wav,-1,-1,-1
[ #3 ]
Sound=*hello.wav
[************** KEYBOARD EMULATOR MODULE ***************]
[ Nombre exacto de la ventana donde se enviarán las teclas ]
[ Name of window for key send ]
[window = "Project Magenta Glass Cockpit - Build 396" ]
window =a.txt - Bloc de notas
[ Asignación de teclas ]
[ assign youe keys ]
#1=\3I\4
#2=\3\1I\2\4
#3=C
#4=D
#5=E
#6=F
#7=G
#8=H
#9=I
#10=J
#11=K
#12=L
#13=M
#14=N
#15=O
#16=P
#17=Q
#18=R
#19=S
#20=T
#21=U
#22=V
#23=W
#24=X
#25=Y
#26=Z
#27=1
#28=2
#29=3
#30=4
#31=5
#32=6
#33=7
#34=8
#35=9
#36=0
#37=<
#38=,
#39=.
#40=-
#41=*
#42=+
#43=//
#44=/0
#45=/1
#46=/A
#47=
#48=
#49=
#50=
#51=
#52=
#53=
#54=
#55=
#56=
#57=
#58=
#59=
#60=
#61=
#62=
#63=
#64=
#65=
#66=
#67=
#68=
#69=
#70=
#71=
#72=
#73=
#74=
#75=
#76=
#77=
#78=
#79=
#80=
#81=
#82=
#83=
#84=
#85=
#86=
#87=
#88=<a
#200=<b
[ End of File ]
If this works (how can I test it?) the next step would be to write a script.
I've looked at a lot of examples at Niko's site, Ive tried a few things but it's unclear to me how to tell a script that when I toggle a switch it should be sent to my flight sim
Could someone please walk me through this ? I would be very grateful.
Martin
So I connected the card, opened sioc and read the device id : 44. I then opened SIOC.ini and changed it to read USBkeys=0,44
here's my sioc.ini :
[************** SIOC ***************]
[ IOCP port ]
IOCP_port=8090
[ IOCP Timeout ]
IOCP_timeout=4000
[ Start minimized in tray ]
Minimized=No
[ Deley needed for var. toggles (Project Magenta) ]
toggle_delay=20
[ Configuration File ]
CONFIG_FILE=.\SCRIPTS\SIOC ATC PMDG.txt
[************** IOCARDS MODULE ***************]
[ Disable IOCards module ]
IOCard_disable=No
[ Use LPT port in IOCards ]
IOCard_LPT=No
[------------- CARDS CONFIG -------------]
[ IOCard Master ]
[...............]
[ English : ]
[ MASTER=(Device index),(Type),(Number of cards),(Device number) ]
[ Device index : Index used in SIOC variable like device, this is the card used for SIOC sentence ]
[ Use 0 for only one card, for this value you not need specify Device number. If you not use DEVICE parameter in a definition in SIOC script, the default index used is 0]
[ type = 0 : Master Card Emulator ]
[ type = 1 : Master Card connected directly to parallel port ]
[ type = 2 : Master Card connected throught compatibility cable to parallel port ]
[ type = 3 : Expansion Card connected throught parallel port ]
[ type = 4 : USBExpansion Card used ]
[ type = 5 : Opencockpits MCP module ]
[ type = 6 : USBOutputs Card used ]
[ type = 7 : Opencockpits EFIS module ]
[ type = 8 : Opencockpits Radio COM module ]
[ type = 9 : Opencockpits Radio NAV module ]
[ type = 10 : Opencockpits Radio ADF module ]
[ type = 11 : Opencockpits Radio ATC module ]
[ Number of Cards = Master cards connecteds, 1 to 4 for expansion cards, 1 for a Master card directly connected or Emulator ]
[ Number of device = 0 for Emulator or first USB card detected, parallel port address, device number for specifies USBexpansion card ]
[ For example, a Master Card connected directly to parallel port : ]
[ MASTER=0,1,1,$0378 ]
[ For example, two USBExpansion cards connected with 3 and 2 Master cards used ]
[ MASTER=0,4,3,22 ]
[ MASTER=1,4,2,24 ]
[ For example, use of Master card emulator ]
[ MASTER=0,0,1,0 ]
[ Use the first USBExpansion card connected with only one Master Card attached ]
[ Esta definición es para usar la primera tarjeta USBExpansion que se encuentre instalada que además llevará conectada una placa Master ]
[MASTER=3,6,1,252]
[MASTER=0,4,1,0]
[MASTER=0,4,1,0]
MASTER=0,4,2,0
MASTER=0,11,2,0
[ Name_of_card=(Device index),(Device number) ]
[ Device index : Index used in SIOC variable like device, this is the card used for SIOC sentence ]
[ Use 0 for only one card, for this value you not need specify Device number. If you not use DEVICE parameter in a definition in SIOC script, the default index used is 0]
[ Number of device = 0 for first USB card of this type detected, or device number for a specifies device ]
[ Example of two USBServos for index 0 and 1, and device number 17 and 23 ]
[ USBServos=0,17 ]
[ USBServos=1,23 ]
USBStepper=0,0
USBKeys=0,44
USBServos=0,0
USBRelays=0,0
USBDCmotor=0,0
[ Para los ejes analógicos se usan los números de devices de las tarjetas donde están alojados ]
[ For analogic axles, you use the device number of cards what allow the axles ]
USBAnalogic=0,0
[************** FSUIPC MODULE ***************]
[ Desabilitar lectura de las FSUIPC ]
[ FSUIPC disable mode yes/no ]
FSUipcdisable=No
[ Refresco recepción FSUIPC ]
[ FSUIPC refresh ]
FSUipcRefresh=50
[************** IOCP CLIENTS MODULES ***************]
[ Retraso para inicializacion una vez conectado el cliente en milisegundos ]
[ Delay for initialization when client has been connected in mseconds ]
IOCPini_delay=3000
[************** IOCP CLIENT MODULE #0 ***************]
[ Desactivar el módulo cliente IOCP ]
[ Disable IOCP client module ]
IOCPclient0_disable=Yes
[ IP del servidor donde debe de conectar el cliente ]
[ IOCP client host name ]
IOCPclient0_host=localhost
[ Puerto de envio del protocolo IOCP cliente ]
[ IOCP client port ]
IOCPclient0_port=8090
[************** IOCP CLIENT MODULE #1 ***************]
[ Desactivar el módulo cliente IOCP ]
[ Disable IOCP client module ]
IOCPclient1_disable=Yes
[ IP del servidor donde debe de conectar el cliente ]
[ IOCP client host name ]
IOCPclient1_host=localhost
[ Puerto de envio del protocolo IOCP cliente ]
[ IOCP client port ]
IOCPclient1_port=8099
[************** SOUND MODULE ***************]
[ Ficheros de sonido ]
[ Sound Files ]
[ Desactivar el módulo de sonido ]
[ Disable Sound module ]
Sound_disable=yes
[ Volumen general de los sonidos 0-100 ]
[ Master Volume 0-100 ]
Volume=100
[ put '*' first filename for loop Sound ]
[ anteponer '*' en el fichero para bucle continuo de sonido]
[ Sound=wav_file,frequency,volume,pan ]
[ frequency=100 to 100000 0=original -1=current ]
[ volume=0 to 100, -1=current ]
[ pan=-100 (left) to +100 (right) 0=center -1=current ]
[ Sound=Fichero_wav,frecuencia,volumen,balance ]
[ frecuencia=100 hasta 100000 0=original -1=Por defecto ]
[ volumen=0 hasta 100 -1=Volumen por defecto ]
[ balance=-100 (Izquierda) hasta +100 (Derecha) 0=centro -1=Por defecto ]
[ #1 ]
Sound=APDis.wav,-1,-1,-1
[ #2 ]
Sound=*outermk.wav,-1,-1,-1
[ #3 ]
Sound=*hello.wav
[************** KEYBOARD EMULATOR MODULE ***************]
[ Nombre exacto de la ventana donde se enviarán las teclas ]
[ Name of window for key send ]
[window = "Project Magenta Glass Cockpit - Build 396" ]
window =a.txt - Bloc de notas
[ Asignación de teclas ]
[ assign youe keys ]
#1=\3I\4
#2=\3\1I\2\4
#3=C
#4=D
#5=E
#6=F
#7=G
#8=H
#9=I
#10=J
#11=K
#12=L
#13=M
#14=N
#15=O
#16=P
#17=Q
#18=R
#19=S
#20=T
#21=U
#22=V
#23=W
#24=X
#25=Y
#26=Z
#27=1
#28=2
#29=3
#30=4
#31=5
#32=6
#33=7
#34=8
#35=9
#36=0
#37=<
#38=,
#39=.
#40=-
#41=*
#42=+
#43=//
#44=/0
#45=/1
#46=/A
#47=
#48=
#49=
#50=
#51=
#52=
#53=
#54=
#55=
#56=
#57=
#58=
#59=
#60=
#61=
#62=
#63=
#64=
#65=
#66=
#67=
#68=
#69=
#70=
#71=
#72=
#73=
#74=
#75=
#76=
#77=
#78=
#79=
#80=
#81=
#82=
#83=
#84=
#85=
#86=
#87=
#88=<a
#200=<b
[ End of File ]
If this works (how can I test it?) the next step would be to write a script.
I've looked at a lot of examples at Niko's site, Ive tried a few things but it's unclear to me how to tell a script that when I toggle a switch it should be sent to my flight sim
Could someone please walk me through this ? I would be very grateful.
Martin