Dear colleagues,
We're measuring data from a Microstrain inertial sensor (i.e. accelerometer, magnetometer and gyro) with a CR1000. For now, we are setting the sensor with the SerialOut() function, sending blocks of hexadecimal pairs described by a Single-Byte Protocol. However, we need to ask for more than one function of the Microstrain Data Protocol and to do that we have to use a MIP Packet Protocol, in which we should send a packet of pre-defined codes and wait for an answer.
The sensor's manual gives a package of C++ functions and we're wondering how could we translate that to a CRBasic program. Are there any available CRBasic function that could help us with this issue?
Regards,
Francisco.
The process of taking a C++ library and converting it to run in CRBasic is definitely an advanced task.
Someone with a knowledge of both C++ and CRBasic could paste the libraries into a CRBasic program and meticulously go through and convert the syntax over from C++ to CRBasic.
Some of the "object oriented" code may require conversion into a different coding style since there isn't true object support in CRBasic.
Another approach might be to get the library converted to Visual Basic first. Some tools exist for that:
http://www.campbellsci.com/forum/messages.cfm?threadid=B4A64561-5183-429F-811D77141BAD5BC7&page=1
That is one possible product that I found with a brief search, but isn't the only option.
Once the code is in VisualBasic the jump to CRBasic will be a lot easier but will still involve some modification and rework and probably some advanced knowledge here and there.
Your result would be either a large CRBasic program or an "included" CRBasic module that contains a large number of functions and subroutines.
Due to the difficult nature of the task, it may make sense to just study the C++ code or read the MIP packet protocol and write your own routines for creating the kind of packet messages you need to send or receive/decode.
http://www.tangiblesoftwaresolutions.com/Product_Details/CPlusPlus_to_VB_Converter_Details.html
This is the link I was trying to provide in my previous post.
Hello GTProdMgr,
So, if I've understood correctly, the CRBasic programming language allows us to create APIs, right?
I'll dig on the MIP Packet protocol to see what general functions I'll have to use and the best way to make then in the CRBasic programming language.
Cheers,
Francisco.
I would probably call it a "rudimentary API" capability. You can create modules of code that contain functions and subroutines. Those modules get associated with your main program (Include instruction) and then you can call on the subroutines or functions. So if you could get your task worked down to just a few main function calls (with supporting code in other subroutines and functions) then it could be fairly simple to attach the module and add a few lines of code to your main program, etc.