Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

BMP5DIRECTSDK incl. Python?


Makada Nov 13, 2020 10:32 AM

Hi,

I am using the BMP5DIRECTSDK examples C#with Visual Studio at the moment.

I would like to have an Python 3 example serial connection in the examples map in BMP5DIRECTSDK.

Is that possible?

Or does someone has a working Python code to get aserial connection with a cr1000?

With kind regards.


GTProdMgr Dec 31, 2020 04:01 PM

There aren't any Python examples that I know about for using the BMP5 Direct SDK.

The following, however, might be what you are looking for (it is based on PakBus, not the BMP5 Direct SDK) :

https://pycampbellcr1000.readthedocs.io/en/latest/

This project is not officially supported by Campbell Scientific, and I don't know if it the code is still being maintained or not.

--

It is theorectically possible to use Python with the BMP5 Direct SDK. It is all about being able to tie in to the "C language calling convention" functions that are contained in the file "simplepb.dll" that is included with the SDK.

ctypes is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries :

https://docs.python.org/3/library/ctypes.html

https://stackoverflow.com/questions/252417/how-can-i-use-a-dll-file-from-python

The BMP5 Direct SDK documentation discusses what functions are contained in the simplepb.dll and how to reference those functions with the correct argument types to successfully make the calls from your code. To create Python examples, that is the process that Campbell would go through. We can note the request for consideration in future releases.


Makada Jan 1, 2021 08:32 AM

Hi GTProdMgr,

Thanks for the reply.

yes i know the pycampbellcr1000 python code, i am using it.

But it doesnt work because of an error when i try to run the code/connect to the cr1000.

It gives the error:"stdout has no attribute buffer".

I am in contact with the developer of the pycampbellcr1000 code And he knows there has been reports with this error, but he cant remember how he solved it.

He is very helpfull and im sure he will sort it.

With kind regards. 

Log in or register to post/reply in the forum.