Python Forum
Integration of Python and C using .dll files
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Integration of Python and C using .dll files
#11
declare it as None before the call.
Reply
#12
Larz60+,

Thanks for the reply.  However, giving the variable a Null value just gave me a null value in return after using the function because python is not accepting the fact that the temperature value is being "returned" by means of an out variable.

Thanks,
Zach
Reply
#13
Without access to the .dll file or the unit it self, it's difficult to say what the .dll is doing.  It seems to be telling you that what is being received is not  what you think it is and Python does not know how to convert it to an integer.  What happens if you leave "options" out of that line?

We also don't know what the unit is feeding the .dll, and how the usb is configured (just for example, the transfer method). A lot of questions need to be addressed and I'm not sure, without "seeing" what's in the .dll, that they can be answered.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#14
If you install http://www.jetbrains.com/decompiler/
and run with the .dll as target (as suggested) before, will tell us a lot
about the dll.
Reply
#15
Hey guys,

I had downloaded the Dot Peek decompiler and it would not decompile the dll file.  All it told me was that it wasn't supported.  Maybe I did something wrong, but that is all I got from that software.  As far as getting the .dll file, you can navigate to:

http://www.omega.com/pptst/OM-USB-TC.html 

and click on software and install Omega's Universal Library.  It also comes with a help file that will explain the function that I am trying to use "cbTIn()".  As far as leaving out the "options" argument, it is my understanding that C coding doesn't like having blank arguments.  If you do end up looking in the Universal Library, the necessary .dll file is "cbw64.dll." In addition, the usb communication protocol is not available. If it was, I wouldn't be using this .dll file in the first place and would have just hooked up via usb communication in python using PyUSB. However, the company will not give out the communication protocol.

Thanks,
Zach
Reply
#16
I have hated dynamic link libraries since the day they came out.
Another product of Microsoft's infinite wisdom.
Reply
#17
I think we are getting off track as to the forum, which is Python.  As for the USB, it is merely a transport of the packets between the device and the host.  Some of that packet contains the communications protocol, which is handled by the system drivers and the device drivers.  Your main interest is in the data frames within that packet.  To that end, you might try something like this: USB Analyzer (this is not an endorsement as I've never used it) which appears to let you see the raw data being passed.  There just seems to be questions involved that need to be answered before you involve Python into the mix.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Forum Jump:

User Panel Messages

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