Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ctypes
#1
how can I declare using ctypes where my DLL file is located.?

this line gives me an error
OSError: [WinError 193] %1 is not a valid Win32 application

pd = ctypes.WinDLL("C:\\APAS_ATE\\Arinc429_RTX\\APISPA.dll")
Reply
#2
What is APISPA.dll?
Reply
#3
(Apr-19-2023, 05:42 PM)deanhystad Wrote: What is APISPA.dll?

it is a DLL provided by the manufacturer of an electronic module I need to use to transmit some sort of avionic protocol named ARINC429.
they say this DLL can be used by any windows language including Python,
once the library be installed I'm suppose to use the function for that electronic module
Reply
#4
The error indicates the DLL is of the wrong type. When it can't find the DLL ther error is "The specified module could not be found".

Do they have multiple DLL's? Maybe they have a 32 bit and a 64 bit version? Is it this "http://www.rtxsystems.com/SPA.html"? Looks like something I would use with DOS on my vintage 396 computer.

Are they aware there is a Python newer than 2.7? Windows Python requires dll's written using a Visual Studio compiler that is compatible with the Visual Studio used to compile Python. Maybe you need to compile the DLL code.
Reply
#5
no, in the CD only found out...

APISPA.dll
APISPA.c
APISPA.h

do you think this DLL is 32 bits and my system is 64?
Reply
#6
Is this DLL registered on the system in the first place, e.g. during install of some software or via regsrv32?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#7
Any readme.txt on the CD? The website is not a fountain of information.
Reply
#8
There is a conversion package for that format

PiPy: https://pypi.org/project/arinc424/
GitHub: https://github.com/jack-laverty/arinc424

I've never used it, so can't vouch for it, But i expect it's worth trying.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  using ctypes to use a dll in a python module dauriac 3 392 Mar-06-2024, 04:38 PM
Last Post: dauriac
  Trying to debug segfault in ctypes binding to Fortran bthomas 1 608 Sep-01-2023, 11:26 AM
Last Post: bthomas
  Issue while using ctypes in python GiggsB 6 2,796 Mar-27-2022, 03:38 AM
Last Post: GiggsB
  Ctypes and libffi.so.7 luxedo 1 6,065 Oct-23-2021, 09:24 PM
Last Post: DeaD_EyE
  possible ctypes and numpy conflict? herbal_rage 0 3,157 Apr-16-2020, 11:35 AM
Last Post: herbal_rage
  python kernell crash with a ctypes program Jstechg 1 3,502 Nov-24-2018, 02:37 PM
Last Post: Jstechg
  generating ctypes wrapper for a c library? brighteningeyes 9 7,084 Nov-04-2018, 02:31 AM
Last Post: brighteningeyes
  DLL library with ctypes Max20 0 2,915 Aug-19-2018, 11:15 AM
Last Post: Max20
  dll not loading to Ctypes Philbot 1 6,865 Jul-01-2018, 09:55 AM
Last Post: Philbot
  Error Ctypes in Windows rramosg 4 9,373 Oct-17-2017, 05:26 AM
Last Post: rramosg

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020