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.

BMP5 and LabVIEW


capiedrav May 13, 2015 10:01 PM

Hello everyone,

I'm testing the BMP5 SDK on LabVIEW but I'm having problems so far.

I've loaded the simplepb.dll library on LabVIEW. It ask me for a header file before loading the dll, so I use the one that's in the C++ example.

Because I'm just starting, I'm just trying to open and close a serial port (using the OpenPort() and ClosePort() functions). At first everything seemed to be ok because the code returned by the functions was 0, but when I tested trying to open serial ports that didn't exist or were already open, the functions still returned code 0, and not -1 as expected.

Anyone has experience using BMP5 in LabVIEW?

Thank you for your attention.


thommark May 13, 2015 10:06 PM

I'm not sure OpenPort() is the best for testing functionality. You might try GetDLLVersion() first. This will tell you if your header file is actually working.


jtrauntvein May 14, 2015 12:18 AM

Starting with version 2 of simplepb.dll, the OpenPort() function will only set up the parameters for future communications it will not attempt to open the port until a call is made that will require actual communications with the datalogger.


capiedrav May 14, 2015 07:37 PM

Hello,

I've tried using the GetDLLVersion() function, but I'm receiving weird strings (&#"_~). The returned code is still 0.

I have tried passing the return_data argument as a C string pointer and as a pointer to an array of bytes, with no luck.

Any advice would be appreciated.

Thank you.


GTProdMgr Nov 16, 2017 04:24 PM

Assuming you are using the v4.5 BMP5 Direct SDK, you should take a careful look at the MS-VS2015 C++ example code.

In earlier SDKs the C++ project was called Mfc, MFC-VS2013, or MSC++. Take a look at the file simplepb.h. This shows how each of the SDK commands should be declared in a C/C++ environment. My understanding is that LabView would make declarations for these functions in a very similar, if not identical way. This should clarify for you where pointers are used as arguments in the function calls, etc.

Then by looking at the C++ code (SimpleExample.cpp, ConnectTabDlg.cpp, MainDlg.cpp) you can see how these functions are called. I think if you try to use LabView to declare and execute the calls in the same way as the C/C++ code that it will work for you.

Also - remember that there are other ways for LabView to communicate with a CR1000 : RS-232 via C-ports, and MODBUS. The LoggerNet SDK can also be used - these are ActiveX/COM controls that can be embedded into a LabView VI. If the regular LoggerNet software is available and running, then the PC-OPC server can be used to obtain datalogger data via LabView.

Another approach - if the CR1000 has an IP address is to use Web-API commands - basically a set of specific URLs that can query data out of the datalogger via HTTP (see Chapter 4 of the CS Web Server manual:

https://s.campbellsci.com/documents/us/manuals/csi-web-server.pdf )

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