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.
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/
这个项目没有t 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.
ctypesis 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.
HiGTProdMgr,
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.
Hi,
Is there some news regarding the use of Python?
With the kindest regards,
Mark