Open protocol is a communication protocol created by Atlas Copco which defines the way we have to communicate with Atlas Copco tightening controllers
Years ago I had the opportunity to work with Atlas Copco Open Protocol and it was cool and funny to create and manipulate the controllers with it.
I could create applications that exchanges TCP/IP packages to operate it, such as setting up a Job/Parameter Set, retrieving old tightenings or receiving them in real time, as many other functions that are available inside these tightening controllers which Open Protocol help us to interact with them.
Although it was funny, it was a little troublesome too. Parsing all those dozens or even hundreds of bytes was a pain in the *** (head đ), a bit stressful I should say.
By that time, Iâve noticed the packages structure and that could exists a library that does all the parsing, such as a .jar or .dll. And someday, while I was at home, I asked myself:
Have someone ever thought about creating a library to handle all these packages?
So I started searching if there was a library out there in any programming language. For my surprise, I have found NONE.
All I had was the docs and a Power Focus tightening controllerâŚ
Few days later I committed to build one! I knew it would be a big effort, but why not build something to help me and other people out there??
The Open Protocol Interpreter
Then the open protocol interpreter was born!
What Iâve done was to take their documentation and try compile into a single C# library which I called âOpen Protocol Interpreterâ (currently on version 3.0.0).
In a few words: It takes the received package and translates/âbeautifiesâ it to an object which is better to work with. The inverse can be done too!
It took a lot of effort to build and test it, but itâs done and working!!
Well, there is much about it but I wonât write how it fully works at itâs core, since it is already written on my article at CodeProject. Please check it out for more information.
Also the project is open source and available at GitHub.
Working with Open Protocol
Cool, we now have a lib to make our life easier, but how does open protocol works? How do I communicate with my controller without the lib?
We should start by sending a MID 0001 to our controller, which will be an ASCII string like this: 00200001003_________
Consider â_â as a blank space
But what does that package means? If you havenât take a look at their documentation I will explain a little of it to you, first of all, this is only our header data, our Data Field section is right after the 20 characters.
For Mid 0001 there is no Data Field section, so there is only the header.
Understanding it:
- 0020 : Package total size (consider blank spaces);
- 0001 : Mid number, this means youâre sending a MID 0001;
- 003 : Revision, this means youâre saying to the controller you want to work with them using revision 3.
The blank spaces does have a meaning, but they can be filled or not, depending if the MID needs it specified or not, which I recommend you to take a look at their docs here.
The controller can respond you with a MID 0002 or MID 0004.
MID 0004 means that some error has occurred while processing the received mid, in case of Mid 0001 we have 2 possible errors: âClient already connectedâ or âMid revision unsupportedâ. Otherwise it will respond you with a MID 0002, Acknowledging you that he accepted your connection.
This is the very beginning of a communication with a controller, from now on you can send any other mid.
A real example
A real sequence of package exchanging would be like:
Consider C as the controller and I as integrator/you.
Top comments (0)