Dirk7589 Posted January 7, 2012 Share Posted January 7, 2012 Hello Everyone, I have been doing a lot of reading about how data can be exported from DCS Black Shark using Lua scripts. I installed Lua, and have done a fair bit of reading, but I'm still a little lost as to where to get started. I want to export data on LED indicators to either a usb HID device or a file or a serial port. Does anyone know where I can find information on how to do this? Thanks for all your help. Sincerely, Dirk7589 Link to comment Share on other sites More sharing options...
JG14_Smil Posted January 7, 2012 Share Posted January 7, 2012 (edited) http://en.wiki.eagle.ru/wiki/Export_1_0_1 Link explains how to get info from BS. Helios can do most of it for you, Edited January 7, 2012 by JG14_Smil Link to comment Share on other sites More sharing options...
Dirk7589 Posted January 7, 2012 Author Share Posted January 7, 2012 Thank you for the information, it is greatly appreciated. Thanks, Dirk7589 Link to comment Share on other sites More sharing options...
Meta Posted January 7, 2012 Share Posted January 7, 2012 If you are able to understand german this could be interesting: http://forums.eagle.ru/showthread.php?t=76621 It's my selfmade USB devices which is able to be controlled by the simulation using LUA commands. Link to comment Share on other sites More sharing options...
Dirk7589 Posted January 7, 2012 Author Share Posted January 7, 2012 If you are able to understand german this could be interesting: http://forums.eagle.ru/showthread.php?t=76621 It's my selfmade USB devices which is able to be controlled by the simulation using LUA commands. This is exactly what I'm hoping to make, sadly my german is a little rusty, but I will have a good look. What kind of micro controller is being used to interface? A PIC or an AVR? Thanks, Dirk7589 Link to comment Share on other sites More sharing options...
Dirk7589 Posted January 7, 2012 Author Share Posted January 7, 2012 Forgive me, but even after reading the wiki article, I'm still lost as to how to export data. I see how you can use the functions describe to obtain the information, but do you write that in your own script that gets run somewhere? Also, I'm pretty new with Lua so where do the scripts get run? Sorry for being so new at this. Thanks, Dirk7589 Link to comment Share on other sites More sharing options...
Meta Posted January 7, 2012 Share Posted January 7, 2012 The microcontroller is an AVR ATmega16. I use the BlackShark\Config\Export\Export.lua file. There are a view functions that are called by the simulation. LuaExportStart() is called once just before mission start. LuaExportBeforeNextFrame() called before every simulation frame and can be used to give input data to the simulation so it can be used for calculation. LuaExportAfterNextFrame() called after every simulation frame to get freshly calculated outputs from the simulation. LuaExportStop() called once just after mission stop. LuaExportActivityNextEvent(t) is called in chosen intervals dependent on value t. Link to comment Share on other sites More sharing options...
Dirk7589 Posted January 7, 2012 Author Share Posted January 7, 2012 Very cool, thank you for the explanation :). I will see what I can get working. What are you using to pass the information to and from the ATmega16? Having the Lua write out to a text file that gets read in by another program? Link to comment Share on other sites More sharing options...
Meta Posted January 7, 2012 Share Posted January 7, 2012 no.. compiled an USB library for LUA.. so I can talk directly to the device... Link to comment Share on other sites More sharing options...
Recommended Posts