Jump to content
Sign in to follow this  
sikorsky77

Luacom.dll & pokey 56U card

Recommended Posts

Hi

 

i am a bit disapointed because i am fully stopped in Home cockpit advancement due to an error i can't explain

i made the choice to use Linda & Lua script for with Fsuipc for 3 reasons

     first i already use Linda  programming tools for my Saitek and Vrinsight MCP and i am clearly happy with the result

    secundly ; i discovered with standard Linda Script the capabilities of Lua programming

     third , i want to use a pokey56u card instead of using OC cards & IOCP/SIOC programming solution because the pokey card could be used by Linda and Lua

 

as i understand , the pokey 56U could be interfaced with Linda Lua truth 3 Dll , the Lua5.1.dll in the P3d Root folder, the Luacom.dll in Modules\Lua folder and it pokeysdevice_dll.dll in Lua folder too

 

i resused a part of a Lua script (written iniatially by Terry Hall who seems 3 years ago satisfied with this solution) , named it Lib-Zpokey56u01, stored in the Modues\linda\libs folder to be called by the lua script opening in sequence all lib-*.lua files

no issue on that except that the lib-zpokey56u01.lua script generate an error

 

LUA.1: [iNIT] Loading...
LUA.1:  Aircraft: Carenado A36 Bonanza 60th Anniversa
LUA.1:  Aircraft module detected: FSX Default
LUA.0:  AivlaSoft library loaded...
LUA.0:  FSX standard library loaded...
LUA.0:  IVAO library loaded...
LUA.0:  RealityXP library loaded...
LUA.0:  Weather library loaded...
[E] *** LUA Error: error loading module 'luacom' from file 'D:\Prepar3d V2\modules\lua\luacom.dll':
Le module spécifié est introuvable. (required module not found)
Advanced Weather Interface Enabled
 
the script start by a require "luacom" (to load the luacom.dll) which seems generating the error , i don't know why because "require" command search the dll file in the appropriate folder as you could see in error message
i thank that i had not the security rights to read or open the luacom.dll  or  Prepar3d V2 Folder  under my Login but security properties show me that i have the Full security control of Dll file and all p3d folder
 
so i am very perplex about the cause of issue
 
i post the script below 
 
THierry
I7-950 3.07Ghz  OC 3.71Ghz on a MB Asus Rampage Extreme II /12 Gb mem / Nvidia 660 TI 2 Gb / OS Windows 8 Pro 64 bit & P3D V2 on SSD disk / 2 monitor 26"
 
-- =================================================================================
-- Initial Setup
-- =================================================================================
require "luacom"
poKeys = luacom.CreateObject("PoKeysDevice_DLL.PoKeysDevice")
 
ipc.runlua('Linda\\lua\\ipcDebug')
 
if poKeys == nil then
  ipc.log("Error: Unable to create PoKeysDevice_DLL object")
  ipc.display("Error: Unable to create PoKeysDevice_DLL object")
 
  ipc.exit()
end
if poKeys ~= nil then
  ipc.log("Success: Able to create PoKeysDevice_DLL object")
  ipc.display("Success: Able to create PoKeysDevice_DLL object")
end
-- =================================================================================
-- check current physical switch setting and update FSX software switch to match
-- =================================================================================
 
function fsx_setup()
  ipc.log("FSX_Setup Script started")
  ipc.display("FSX_Setup Script started")
  if ipc.testbutton(10,0) == true then
    ipc.writeUD(0x281C, 1) -- set FSX battery switch ON
  else
    ipc.writeUD(0x281C, 0) -- set FSX battery switch OFF
  end
  if ipc.testbutton(10,0) == true then
  -- physical switch in ON
    if ipc.readUD(0x281C) == 0 then -- FSX switch is Off
      ipc.control(66241)  -- toggle FSX switch to ON
    end
  else
 -- physical switch in OFF
    if ipc.readUD(0x281C) == 1 then -- FSX switch is On
      ipc.control(66241)  -- toggle FSX switch to OFF
    end
  end
  chk_pin_10 = false
  chk_pin_10, onoff_pin_10 = poKeys:GetInput(10)
 
  if (chk_pin_10 == false) then
    -- GetInput Failed... Most likely not configured properly
    -- Put code here to perform for failure
  else
    -- We got results from the switch GetInput Function
    if (onoff_pin_10 == true) then
      -- Switch at Pin 10 is ON
      -- Put code here you wish FSX to perform
      ipc.writeUD(0x281C, 1) -- set FSX battery switch ON
    else
      if (onoff_pin_10 == false) then
        -- Switch at Pin 10 is OFF
        -- Put code here you wish FSX to perform
        ipc.writeUD(0x281C, 0) -- set FSX battery switch OFF
      else
        -- Could not determine status of Switch at Pin 10
        -- Put code here you wish FSX to perform
      end
    end
  end -- chk_pin_10
 
  -- =======================================
  -- Check Switch Position Connect to Pin 10
  -- =======================================
  chk_pin_10 = false
  chk_pin_10, onoff_pin_10 = poKeys:GetInput(9)
 
  if (chk_pin_10 == false) then
    -- GetInput Failed... Most likely not configured properly
    -- Put code here to perform for failure
  else
    -- We got results from the switch GetInput Function
    if (onoff_pin_10 == true) then
      -- Switch at Pin 10 is ON
      -- Put code here you wish FSX to perform
      ipc.writeUD(0x281C, 1) -- set FSX battery switch ON
    else
      if (onoff_pin_10 == false) then
        -- Switch at Pin 10 is OFF
        -- Put code here you wish FSX to perform
        ipc.writeUD(0x281C, 0) -- set FSX battery switch OFF
      else
        -- Could not determine status of Switch at Pin 10
        -- Put code here you wish FSX to perform
      end
    end
  end -- chk_pin_10
end -- check_switches
 
-- =================================================================================
-- Initial Script Startup
-- =================================================================================
connect_usb = true    -- true = USB  /  false = ethernet
if (connect_usb == true) then
  -- Get Number of poKeys Devices Found
  no_devices = poKeys:EnumerateDevices()
  -- Connect to Device
  if (num_devices ~= 0) then
    connect_flag = poKeys:ConnectToDevice(0)
    if(connect_flag == false)then
      -- code to perform if ConnectToDevice fails
      ipc.log("Error connecting to poKeys USB Device 1")
      ipc.Display("Error connecting to poKeys USB Device 1")
      ipc.exit()
    end
    if(connect_flag == true)then
        ipc.log("Pokey56U01 mounted")
        ipc.display("Pokey56U01 mounted")
end
  end
else
  connect_to_ethernet()
end
ipc.log("FSX_Setup Lua Script Called")
ipc.display("FSX_Setup Lua Script Called")
fsx_setup()     -- check physical switch and configure fsx software switch
 
-- =================================================================================
-- Event Section
-- =================================================================================
-- Gear up / down event
event.timer(100,"check_switches")

 


sorry everybody , i forgot Thanks for your idea or help

Share this post


Link to post
Share on other sites

Hello,

 

You'd better ask Pete about this issue.

 

But I think it's something about Lua libs search path variable (at system level). I don't remember how it is named. And you can try to put your luacom.dll to P3D root folder or in Windows root. May be this will help.

 

Ask Pete...


Artem Crum, EASA PPL
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
LINDA Lua Integrated Non-complex Device Assigning
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

Share this post


Link to post
Share on other sites

Hello Artem

 

It is not a issue on the path because "Require" command search the Luacom.dll in the good folder ,

Night sleeping was benefit , and this morning i try something

i downloaded from Lua.org website the last 5.1.43 Lua package version for windows and installed it

the error disappeared , now i have a error with the "Luacom.createobject" object pokeysdevice_dll.dll and i think now it is just a path issue

 

thanks to take time to answer


i forgot to give the solution

i copied from Lua folders (in Program Files (X86)\Lua\5.1)  the Lua51.dll & Lua5.1.dll and replaced them in Prepar3d v2 root folder,

i also copied from Lua folders (in Program Files (X86)\Lua\5.1\clibs) luacom.dll  and replace it in Prepar3d v2\modules\lua folder

i saw in the same time that my Luacom.dll changed of size (164 Kb to 168 kb)

maybe the install adapted the dll to my windows 8 pro 64bit version

 

i closed the post

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...