'Mettler toledo IND780 read weight through javascript

How one can communicate with Mettler toledo IND780 device for reading weight through browser application through javascript. I know ActiveXObject will work with only Internet explorer . But is there any documentation or API to do this via javascript.



Solution 1:[1]

First, You need to contact the developers of the Mettler toledo IND780 device and confirm with them, whether this product can interact with any Web application or not. As other community member already informed you that this kind of devices can not be accessible from any web app.

I try to visit their site and I find that this product can work like below.

enter image description here

Reference:

IND780 Advanced Weighing Terminal

They can give you the proper idea or any example to interact with this device.

If they deny you that this device cannot work with Web app then try to store the data from that device to any Excel file and then try to import the data from that Excel file to your web app may help you to solve the issue.

Solution 2:[2]

You need to use a TelNet client to communicate with the device. Currently i'm using C# to connect and read information. I think you can use a similar library from JavaScript side.

Solution 3:[3]

Old thread but maybe this answer can help someone, best way around is to code a back-end application to get the data you need from the Shared Data of the IND780 (Shared Data Reference manual), example in Python3:

            import socket
            import time

            # Create a TCP/IP socket
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

            # Connect the socket to the port where the server is listening
            server_address = ('172.16.40.98', 1701)
            print('connecting to {} port {}'.format(*server_address))
            sock.connect(server_address)

            try:

                time.sleep(0.1)
                data = sock.recv(2048)
                print('1 received {!r}'.format(data))

                message = b'user admin\n'
                print('2 sending {!r}'.format(message))
                sock.sendall(message)
                
                data = sock.recv(2048)
                print('3 received {!r}'.format(data)) 
                print(len(message))

                print('')

                message = b'read wt0101\n'
                # wt--01 Displayed Gross Weight
                
                print('4 sending {!r}'.format(message))
                sock.sendall(message)
                
                data = sock.recv(2048)
                print('5 received {!r}'.format(data)) 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Deepak-MSFT
Solution 2 rodrick
Solution 3 NicoJet