PDA

View Full Version : OC USB output card



150245
03-10-2010, 10:05 AM
hi all,

would it be possiible to do the inputs via joystick and mangage the outputs via above card and FSUIPC. I build an FMC for PMDG 747 and do the inputs via Leo Bodnard BUO...

Example: button 1 = AP
press AP on my FMC - AP is on shows active green on the Monitor, but not on the FMC as there are no pssibilities to add an LED. Could it work with the OC outputcard??

thanks in advance
best regards
CJK

fransfarmer
05-13-2010, 10:24 AM
I have the same problem, and I have donw some research. Here is what i have found:

PMDG does not use the default FS options for MCP functionality, so to map the correct function, eg. the state of HDG SEL you need a special variable from the PMDG_747400_Main.DLL, read through a FSUIPC .lua file. I did a test with PMDG J-41, selecting AP HDG ON, and then killing all electrical power. This switched the HDG LED off, and returned a .lua L.var called coamingAPHDG=0. So these "L.vars" seem to fully obey the PMDG cockpit logic.

http://i44.tinypic.com/9a026s.jpg

If there is some way to send these variable from FSUIPC to SIOC, it can be done.
I have tried to search for documentation on the issue, but found none. As far as I know SIOC only reads standard FSUIPC variables in the $XXXX,length format.

Perhaps there is another way to send FSUIPC vars to the board, bypassing SIOC?

737NUT
05-13-2010, 11:12 AM
Use the Joy or Key press sioc function then set-up FSUIPC to activate your Lua variable thru fsuipc. Thats how i do it.

fransfarmer
05-13-2010, 12:43 PM
thanks for the quick reply! I will try that out.

fransfarmer
05-17-2010, 02:53 AM
If anybody should be interested, there an example on how to send the state of L:vars via FSUIPC to SIOC. It can be used to trigger LEDs.

1. The L:vars are gathered with Peter Dowsons log lvars.lua script.
2. The relevant L:vars are then stored in a 0x0000 format offset in a .lua script, that runs in the background and continuously updates the offsets. For the J41 coaming panel it could look something like this:

while 1 do

--store the value that is read from the L:vars:
attgetred = ipc.readLvar("L:CoamingAttGetRed")
attgetyellow = ipc.readLvar("L:CoamingAttGetYellow")
aphdg = ipc.readLvar("L:CoamingAPHDG")
apnav = ipc.readLvar("L:CoamingAPNAV")
apapr = ipc.readLvar("L:CoamingAPAPR")
apalt = ipc.readLvar("L:CoamingAPALT")
apaltsel = ipc.readLvar("L:CoamingAPALTSEL")
apvs = ipc.readLvar("L:CoamingAPVS")
apias = ipc.readLvar("L:CoamingAPIAS")
apsby = ipc.readLvar("L:CoamingAPSBY")

--write the stored value to 0x0000 format offsets that SIOC can read:
ipc.writeUB("6300", attgetred)
ipc.writeUB("6301", attgetyellow)
ipc.writeUB("6302", aphdg)
ipc.writeUB("6303", apnav)
ipc.writeUB("6304", apapr)
ipc.writeUB("6305", apalt)
ipc.writeUB("6306", apaltsel)
ipc.writeUB("6307", apvs)
ipc.writeUB("6308", apias)
ipc.writeUB("6309", apsby)

-- the ipc.display section can be used for testing purposes or deleted:
ipc.display

("attgetred="..attgetred.."\nattgetyellow="..attgetyellow.."\naphdg="..aphdg.."\napapr="..apapr.."\napalt="..apalt.."\napaltsel="..apaltsel.."\napvs="..apvs.."\napias="..apias.."\napsby="..apsby)

ipc.sleep(50)

end

3. the ipc.display feature is used th check that the L:vars are correct. In the picture the "attgetred"
and "attgetyellow" are alternating 0 and 1, following the warnings in the PMDG J41 cockpit.
4. A feature in FSUPIC that reads offset states are used to check that the L:var is actually put into the offset. In the picture offset 6300 and 6301 are also alternating 0 and 1, because L:vars of the red and yellow warning lights are are stored.
5. in SIOC, LEDs on the USB outputs card can be assigned to the offsets.

http://i44.tinypic.com/2njvjf5.jpg

bagarie
05-17-2010, 10:16 AM
Hi,

I'm interested to appication of LUA to my home cockpit b737 PMDG. It's possible by LUA read the status of annunciators of the B737 PMDG Overhead Panel ?

Also what's exactly LUA and what's his use?

Many thanks
Arnaldo

fransfarmer
05-17-2010, 01:08 PM
Hi Arnaldo

LUA is a programming language. It can be used to make small scripts to load in FSUIPC. It allows us to read and write variables that are normally out of reach, for instance the status of annunicators.
First you will need to buy FSUIPC to be able to use it.
Then you can load a LUA script (like the one I posted below) to get the B737 annunicator status (called L:vars)
The same LUA script can send this info to SIOC, a piece of software that runs outside FS and controls USB outputs.
Hope this helps!

bagarie
05-17-2010, 02:05 PM
Hi

I know FSUIPC because most of my commands on my cockpit are made by Fsuipc macro, keyboard multiple ecc. ecc. So I know it quite well.
I know also SIOC. I made some commands by a SIOC script.
Now I would integrate it with Lua scripts for lighting up my annunciators on Overhead.
The question is how assign a macro mouse command (I yet have on my FSUIPC) to a Lua Variable and than to SIOC script?
I started to study many Lua script and example on Fsuipc forum, but it's no yet very clear how to interface Lua and Fsuipc.

thanks
Arnaldo

fransfarmer
05-17-2010, 04:24 PM
Hi Arnaldo

I am not sure you should use a mouse macro. As I understand it, mouse macros are used when you need to interact with FS. Annunicators sometime come on by themselves, which is why I have made the LUA script posted in this thread. It picks up the annunicator state when the script is running (it reads a L:var inside FS) and send it directly to an offset that SIOC reads. You can assign a key in FSUIPC to run the LUA script.

So the key is to find L:vars for the PMDG B737 annunicators. I donīt have it installed at the moment so I canīt test if there are L:vars for the annunicators, but FSUIPC has a function to scan for L:vars.Then you can edit the script I posted above to use with your L:vars.

kind regards,
Ole