It looks like the serial protocol for Zaber devices is pretty simple to implement, but is there any sample code in C++ available?
It looks like the serial protocol for Zaber devices is pretty simple to implement, but is there any sample code in C++ available?
If you are writing managed C++, you can use our .NET library DLL just like you would in a C# or Visual Basic project. You can find more information with the Zaber Console source code. The examples are all in C# or Visual Basic, but you can do the same things in managed C++.
If you're not writing managed C++, you'll have to write directly to the serial port. We have some example C code that will show you how to convert the commands into a byte stream. This snippet prepares the six bytes to write to the serial port.
This snippet processes six bytes received from the serial port.
How you connect to the serial port will probably be different from our example, but the C++ compiler documentation should be able to help you there. Download the example code to see more details, such as a timer to reset the protocol if it gets out of synch.
For more description of the serial communication protocol, see the user manual.
You can also write Zaber Console scripts using C++, although we haven't yet created a C++ script template.