How to communicate with a USB/serial device [closed]
I have to send command to METTLER-TOLEDO weightscale and also I would like to receive information from it. The weightscale has a proprietary command set called MT-SICS, basically the weightscale is programmed with ASCII strings and replies in the same way. The weightscale has an output pl2303 serial port which I convert into usb with an adapter and ROS Kinetic is able to see the usb. I would know how could I send ASCII strings to the weightscale and read information from it.
I can understand why you'd post this question here, on ROS Answers, but I'm closing it nonetheless.
Your question is about how to programmatically interact with a device that has a serial port. This in itself is not related (nor influenced) by your choice to ultimately use ROS with it.
I would ..
.. recommend to search around for information on how to use serial ports (with Python, C++ or whichever programming language you intend to use) and first get the basics worked out (ie: be able to query and command the scale using the "ascii commands" you mention by writing to the serial port).
Once that works, start thinking about how you'd want to wrap that in a ROS node, and what the interface that ROS node implements should be (ie: services, topics, actions, etc).
At that point it becomes a ROS question. If you're there, and still have questions (fi about the msgs to use), ..
.. feel free to post a question here.
Note that there are actually already quite a few Python modules and examples available for communicating with Mettler-Toledo devices.
Some random Googling turned up:
and ..
.. project/mettler_toledo_device.
The first is a basic script, the second a more complex library with support for much more lab equipment and the last a Python module specifically geared towards the Toledo device.