The A2A Simulations Community

"Come share your passion for flight"
It is currently Sun May 19, 2013 1:59 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Sep 11, 2010 3:18 pm 
Offline
Airman Basic

Joined: Thu Oct 19, 2006 3:27 pm
Posts: 3
Hi,
For all the cockpit builders here: I post this in the Pilot Lounge section as it's related to all accusim aircrafts, I hope it's OK.
There was a post by Guenseli explaining how to make use of FSUIPC, L:Vars, macros and LUA to use our home made cockpits switches and controllers with special accusim functions otherwise not accessible via classic offsets.

http://a2asimulations.com/forum/viewtopic.php?f=29&t=21420

Many thanks to him. Using virtual joystick functionality of SIOC it was possible to use OpenCockpits hardware plugged in a networked computer and control specific accusim functions .

Having done that, my main concern was about my gauges, some are made with Gauge Composer, others are physical gauges with servos, all controlled from another computer linked with IOCP server and WideFS.
Image

The problem: For instance making a GC gauge for manifold pressure using the usual MP offset doesn't give a correct reading, as accusim manifold pressure is different (and much more complex). So digging into L:Vars dump of P-47, I realized that those 'real' values for gauges were here, in the L:Vars.


The solution: A simple LUA script that reads L:Vars value (for instance L:ManifoldPressure1) and writes the value in a free (user reserved?) FSUIPC offset (from 66C0 to 66FF), and then link to those 'new' offsets with GC or SIOC over the network.

Early LUA script for the P-47 and a few gauges:

Code:
while 1 do
-- Read the values from L:Vars
cat = ipc.readLvar("L:CarbAirTemp1")
cht = ipc.readLvar("L:EngCylinderHeadTemp_1")
OILT = ipc.readLvar("L:EngOilTemp1")
OILP = ipc.readLvar("L:Eng1OilPressure")
FUELP = ipc.readLvar("L:FuelPressure1")
RPM = ipc.readLvar("L:EngRPM_1")
MP = ipc.readLvar("L:ManifoldPressure1")

-- Formatting the values for use with SIOC/GC  (need to improve that and pass reals instead of integers?)
cht = cht * 10
cat = cat * 10
OILT = OILT * 100
OILP = OILP * 10
FUELP = FUELP * 100
if MP < 10 then
   MP = 10
end
MP = MP - 10
MP = MP * 100
-- Write value into new FSUIPC Offsets accessible other the network
ipc.writeSD(0x66c0, cat)
ipc.writeSD(0x66c4, cht)
ipc.writeSD(0x66c8, OILT)
ipc.writeSD(0x66D2, OILP)
ipc.writeSD(0x66D6, FUELP)
ipc.writeSD(0x66E0, RPM)
ipc.writeSD(0x66E4, MP)
ipc.sleep(68) 

end


The script is a never ended loop, for now I trigger the launch with a keypress and the stop with another, but I will link it to a switch, for instance battery switch would seem to be a good choice: battery on, trigger the script, battery off, kill the script.

So now I have correct readings on my home made gauges, including all the jittering of RPM when too low. And it will also work with physical gauges as far as you can choose the offset for it.

The only thing I need now is A2A guys make a accu-simmed Yak 3 ... (please ! That's a very interesting aircraft, with pneumatic starter and flaps, a new challenge for you! :D )


Top
 Profile  
 
PostPosted: Sun Sep 12, 2010 5:48 am 
Offline
A2A Spitfire Crew Chief
User avatar

Joined: Tue Jul 29, 2008 11:41 pm
Posts: 3207
That is absolutely brilliant mate!!!!!!!!!!!!!!! I have been worried about how I was ever going to make the Flight illusion Gauges work with Accusim. Thank you so much..it seems like it will be a fairly easy job for even one as computer illiterate as I.

Thank you for the great tip. I hope I can trouble you for a bit of a hand when things get that far with the new Spitfire?
cheers

Oh and that looks like a great cockpit you have there!

Darryl

_________________
Image Image
...Some say he never blinks, and that he roams around the woods at night foraging for Merlin parts...


Image Image Image


Top
 Profile  
 
PostPosted: Fri Feb 10, 2012 3:18 pm 
Offline
Airman Basic

Joined: Sun Dec 04, 2011 12:23 pm
Posts: 4
I am heavily doing research on the process listed above, as I am trying to set up Virtual gauges on a different pc using the network. I have two pieces of software that I am testing. One is called FSXpand and interfaces with the sim through fsuipc. Unfortunately, the current version does not allow you to customise the offset that is driving any of the gauges. The other one is called Panelbuilder and it uses Simconnect to talk to the sim. I have been in contact with the developer of this one to see if he is willing to try and get everything working correctly in accusim, and he seems open to the idea.

My question is, is it possible to access the L:vars for RPM & Manifold Pressure, etc with simconnect, or is FSXpand required for the process or remapping the offset?

I'm trying to wrap my head around the whole process.

Has anyone here tried this using Simconnect only?


Top
 Profile  
 
PostPosted: Fri Feb 10, 2012 10:17 pm 
Offline
A2A Spitfire Crew Chief
User avatar

Joined: Tue Jul 29, 2008 11:41 pm
Posts: 3207
No, sorry haven't tried.

Check your email shortly mate!

D

_________________
Image Image
...Some say he never blinks, and that he roams around the woods at night foraging for Merlin parts...


Image Image Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Mazo and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group