Simpit Software from SDA - Page 168 - ED Forums


Thread Tools Display Modes
Old 04-25-2020, 08:39 PM   #1671
Junior Member
Join Date: Apr 2020
Posts: 1


I've tried the ExportScript a bit now. I have a real AJS37 simulator that I want to run using DCS and then I thought that the DCS ExportScript would be a good solution.

I already have software to communicate with all the hardware, since it's many different interfaces (synchro-motors, AC-servos, bulbs, solenoids, buttons etc.) that currently runs with Prepar3d.

I have managed to connect this to the UDP socket of the ExportScripts, but I can't figure out how to increase the rate of communication so that the real instruments move in a smooth way, and how to send the full data set every now and then since I can't be sure that my software always run when DCS is first started (and all variables are sent once).

I did look into the Config.Lua-file, and tried to lower the ExportScript.Config.ExportInterval and ExportScript.Config.ExportLowTickInterval without any effect. I also thought that ExportScript.Config.FirstNewDataSend and ExportScript.Config.FirstNewDataSendCount would mean that the full dataset is sent every X packets, but that doesn't seem to happen.

Can you help me to do this using these scripts?

This is how my Config.lua looks like:
ExportScript.Config = {}
ExportScript.Version.Config = "1.2.1"

-- Ikarus a Glass Cockpit Software
ExportScript.Config.IkarusExport    = true         -- false for not use
ExportScript.Config.IkarusHost      = ""  -- IP for Ikarus
ExportScript.Config.IkarusPort      = 1625         -- Port Ikarus (1625)
ExportScript.Config.IkarusSeparator = ":"

-- D.A.C. (DCS Arcaze Connector)
ExportScript.Config.DACExport        = false        -- true for use
ExportScript.Config.DAC              = {}
-- first hardware
ExportScript.Config.DAC[1]           = {}
ExportScript.Config.DAC[1].Host      = "" -- IP for hardware 1
ExportScript.Config.DAC[1].SendPort  = 26026       -- Port for hardware 1
ExportScript.Config.DAC[1].Separator = ":"
-- secound to n hardware
--ExportScript.Config.DAC[2]           = {}
--ExportScript.Config.DAC[2].Host      = "" -- IP for hardware 2
--ExportScript.Config.DAC[2].SendPort  = 9092        -- Port for hardware 2
--ExportScript.Config.DAC[2].Separator = ":"

-- Ikarus and D.A.C. can data send
ExportScript.Config.Listener         = false         -- false for not use
ExportScript.Config.ListenerPort     = 26027        -- Listener Port for D.A.C.

-- Other
ExportScript.Config.ExportInterval         = 0.03	-- export evry 0.05 secounds
ExportScript.Config.ExportLowTickInterval  = 0.3	-- export evry 0.5 secounds
ExportScript.Config.LogPath                = lfs.writedir()..[[Logs\Export.log]]
ExportScript.Config.ExportModulePath       = lfs.writedir()..[[Scripts\DCS-ExportScript\ExportsModules\]]
ExportScript.Config.Debug                  = true
ExportScript.Config.SocketDebug            = false
ExportScript.Config.FirstNewDataSend       = true
ExportScript.Config.FirstNewDataSendCount  = 10
danielzarins is offline   Reply With Quote
Old 05-22-2020, 07:54 PM   #1672
Junior Member
Join Date: May 2020
Location: Canada
Posts: 52

Using DCS-ExportScript successfully to output plane data. Awesome script.

Hoping i'm posting in the correct thread here, but I'm wondering if anyone can poke me in the right direction.

I would like to change the output for a given piece of data.

For example, Heading is displayed as a range from 0.0000 to 1.0000, 0.5000 being 180 degrees. I can obviously take 0.5 * 360 to get my correct 180 heading displayed but am having trouble figuring out where to get the variable data from in the export plane lua file.

In P-51D.lua (DCS-ExportScript) within the ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) function

ExportScript.Tools.SendData(2001, string.format("%d", (0.12345678 * 360)))

allows me to monitor the DCS ID of 2001 and correctly takes the decimal number 0.12345678 and formats it to heading of 44 degress.

What i need to figure out now is how to get the raw heading data as a variable, for exampe:

MyGyroHeading = liveData
ExportScript.Tools.SendData(2001, string.format("%d", (MyGyroHeading * 360)))

Have played with GetDevice(20) which seems to return an Array

I digress, need to figure out how to find the variables and access them. Something like:
myGyroHeading = ExportScript.gyroheading[1]['value']

Any help would be greatly appreciated.
nosaMtrevoC is online now   Reply With Quote
Old 05-22-2020, 11:34 PM   #1673
Junior Member
Join Date: May 2020
Location: Canada
Posts: 52

In case anyone haps upon this looking for the answer to my above questions I asked (about applying modifiers or math to the data), I edited my planes export dcs lua file and added the following to the following:

function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
     ExportScript.Tools.SendData(2001, string.format("%d", (mainPanelDevice:get_argument_value(12) * 360))..'°')
This now creates a new ID that i can monitor "2001" that displays 180° for my heading instead of 0.5000

Now I can apply similiar formatting to all the other values that look strange.
nosaMtrevoC is online now   Reply With Quote
Old 05-24-2020, 02:22 AM   #1674
Junior Member
Join Date: May 2020
Location: Canada
Posts: 52

Using the principles above and stream deck, now showing live data on my stream deck. plan to first create an icon set for the p-51, currently using button icons from tons of other peoples work, then build an f/18 pit.
nosaMtrevoC is online now   Reply With Quote
Old 05-25-2020, 09:12 PM   #1675
Join Date: Oct 2010
Posts: 128

Very Nice!!!
Laidback is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 12:42 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.