How to connect your scale to a network (Ethernet) using Moxa’s NPort 5110A

Many scales and balances are equipped with an RS-232 interface. Moxa’s NPort series and similar serial device servers allow you to connect such scales to a network (Ethernet). In this article, I’ll show you how to connect a Moxa NPort 5110A to an Ohaus scale and how to configure and test it.

1. Physical connection

The Moxa Nport 5110A has an RS-232 port (DE9M) on one side and an Ethernet port on the other side:

Data cables (red) are not included.

To communicate with your scale, you’ll need a matching RS-232 cable. The Ohaus Defender 3000 scale used in this example requires a DE9M to DE9F straight (1:1) cable:

Ohaus scale with Ethernet connection through Moxa NPort 5110A

Once the physical connection to the scale has been established, the Moxa NPort has to be configured. There are several ways to do so. I prefer the following method:

  1. Connect the NPort directly to a single computer (not a LAN) with an Ethernet cable.
  2. Use the NPort Administator software included with the device to configure it.

2. Network configuration

Start the NPort Administrator and locate your NPort by clicking on the Search button:NPort Administrator: Search

It should be found at the default IP address (192.168.127.254).

Note: It’s not always necessary to change your PC’s IP address if you’re running the NPort Administrator software. However, if you receive error messages during the following steps, try to temporarily set your computer’s IP address to an address on the same subnet (such as 192.168.127.1).

Select the Ethernet connection under Control Panel > Network and Internet > Network connections, right-click on it and choose Properties, then select Internet Protocol Version 4 (TCP/IPv4) and click on Properties. Make a note of your current settings so that you can restore them later, then enter the temporary IP address:
Ethernet IP address setting in Windows 10

If the NPort is shown as locked, right-click on it and select Unlock:
NPort Administrator: UnlockThe default password is “moxa”.

Right-click again and select Configure, then select the Network tab:
NPort Administrator: Network configurationEnter a static IP address, subnet mask and gateway that work on your network (or select DHCP or BOOTP for automatic address assignment, though this is not recommended for most operating modes).

To make the NPort accessible on our network, I set its IP address to 192.168.0.253:
NPort Administrator: Modified network settings

With the network configuration complete, you can disconnect the NPort 5110A from your computer and connect it to your network (LAN).

3. RS-232 configuration

It is essential that both the NPort and the scale use the same settings for the serial port (RS-232). In the Serial tab, select the port (the NPort 5110A only has one, but you still have to select it), check Modify and click on Settings:
NPort Administrator: Default serial settings

Enter the RS-232 settings found in your scale’s menu or user manual. The default settings of our Ohaus Defender 3000 scale are shown in the screenshot below:NPort Administrator: Serial configuration (RS-232)

Important: By default, the NPort is set to CTS/RTS flow control! You cannot change this setting when using the Setup Wizard through the web console. As mentioned before, I recommend using the NPort Administrator software instead.

4. Set an operating mode

To change the mode, go to the Operating Mode tab, check Modify, select the port and click on Settings:NPort Administrator: Operating Mode

The NPort 5110A supports several operating modes, I will only discuss the following two here:

  • Real COM mode: This mode allows you to create a virtual COM port on a PC and use the scale as if it were connected directly to that PC. This is very useful when you’re using software which only supports connections to COM ports and cannot communicate over TCP/IP (such as our 232key virtual keyboard wedge software).
    Please note that you’ll have to install a virtual COM port driver on the PC that communicates with the scale. In my tests on Windows 10, setting up the COM port through NPort Administrator did not create a new virtual COM port on the system. However, using the NPort Windows Driver Manager worked.
  • TCP Server: The NPort acts as a server, waiting for incoming connections from TCP clients on port 4001 (or on another user-defined port). The maximum number of concurrent connections can be changed from 1 (default) to up to 8. This mode works with software like our Simple Data Logger and many others.
    NPort Administartor: TCP Server mode

    Note: It is not necessary to set the data packing options unless you want to optimize either for minimal latency or maximum throughput. By default, the device will try to find a reasonable compromise (this is likely achieved by observing the delay between the data received over RS-232 to determine when a “line” of data is complete).

    When I set the scale to continuous transmission mode (wich has no delay between the weight values), the NPort packed 104 bytes in each Ethernet frame, corresponding to almost 6 weight values (the scale sends 80 values/s):
    Wireshark screenshot

For further details and for information on the other modes, please consult the user manual.

5. Run a test

Depending on the operating mode chosen above, you’ll have to use different programs to test the NPort 5110A. In addition to the software I’ve already mentioned above, you could use the following:

Real COM mode

A terminal program like Termite or HTerm can connect to the virtual COM port. Make sure that the connection parameters correspond to the settings of your scale.

TCP Server

You can use PuTTY set to “Raw” TCP mode to act as a TCP client:
PuTTY configurationThe following screenshot shows commands sent to the scale and the replies:PuTTY communication with Ohaus scaleAnother option is our free TCPTester software. It repeatedly sends a user-defined command to the scale (e.g. to request the weight). Once a reply has been received, the command is repeated:

TCPTester tcp utility used to test Moxa NPort connected to Ohaus scale
TCPTester free TCP test utility available from Smartlux

During testing, it can be useful to observe the LEDs on the NPort:

  • The “Ready” LED should be green.
  • The “Link” LED is green when the NPort has established a 100 Mbs Ethernet connection and orange on a 10 Mbps connection.
  • The Tx/Rx LED flashes orange when the NPort receives data from the scale and flashes green when the NPort is sends data to the scale over the serial port. Therefore, If you’re sending commands to a scale, you should be able to see it flash green. A reply from the scale would cause the LED to flash orange. If this is too difficult to see, consider using the web console to diagnose connection issues (I found it worked best in Firefox):
    Moxa web console monitor async

I hope this article has been useful. What are your experiences with Moxa’s NPort serial device servers? Please don’t hesitate to leave a comment! For support, please contact Moxa or your vendor.

Did you find this article helpful? You can support this blog by purchasing a PDF version for US$2/copy (contains no additional information).

Ohaus Scout STX – a touchscreen scale done right

The first scale with a touchscreen display that I ever used (not made by Ohaus) took a while to start up, reacted sluggishly and – if I remember this correctly – required me to set up a user account before it would let me actually use it. That was a few years ago, but still, I was a bit skeptical when Ohaus announced that the newest model in their legendary Scout series would now have a touchscreen, too. However, after purchasing the cheapest Scout STX (the STX 421) and testing it extensively over several weeks, I can say that my worries were unfounded.

Startup time

As you can see in this short video, the Scout STX is even faster than the Ohaus Ranger 3000:

Ohaus Scout STX Einschaltdauer

Settings

How many scales can truly claim to be so easy to set up that you never have to look at the manual? As an example, here’s how you change the language: Touch “Menu”, then you’ll see 8 settings, of which “Balance Setup” looks the most promising. You’ll now see another seven settings with “Language” being the first one:

Ohaus Scout STX Sprache ändern

Should you ever find yourself somewhere you didn’t want to go, you can simply touch “Back” to go back to the previous screen.

Somewhat embarrassingly, the only thing I actually had to look up was how to change into another application mode: Instead of going through the menu, you simply touch the application name shown in the top left corner of the screen.

9 applications

The touchscreen really shines when it comes to different applications. As you can see in this video of me using the parts counting mode with auto-optimization, the STX can even replace a dedicated counting scale:

Waage Ohaus Scout STX: Zählfunktion

12 seconds into the video, you can see that the scale displays a numpad to let me enter the average piece weight or number of samples. There’s simply no way to achieve this kind of application flexibility and user friendliness without a touchscreen.

Touchscreen disadvantages

One common complaint about touchscreens is the lack of tactile feedback. Fortunately, the most frequently used buttons on any scale, ON/OFF/Zero and Tare, were still kept as physical buttons on the Ohaus Scout STX.

You also have to consider that the fairly large screen needs a lot of power. The Scout STX can be used with four AA batteries, but those won’t last more than a few hours (6 according to Ohaus). It’s certainly a good idea to use the included power adapter whenever possible.

Links and further information

Free software for scales and balances with RS-232 and USB interface

Are you still manually entering weight readings from your scale or balance on your PC? Is your scale equipped with an RS-232 or USB (virtual COM port) interface? If yes, you can probably eliminate manual data entry by connecting your scale to your computer and using our free 232key software.

232key automatically types the weight into any application

Our software runs in the background, listens to the COM port (serial port) your scale is connected to and waits for measurement values sent by the scale. Those values are then parsed, formatted and typed into the application running in the foreground at the current cursor position as simulated keystrokes. This means that 232key can be used to transfer the weight (or other measurement values) into any application that accepts keyboard inputs, e.g. Microsoft Excel, OpenOffice / LibreOffice Calc, Google Docs, a form on a website, etc.

In the following example, I used A&D’s FG-60KBM scale with an optional RS-232 interface (FG-OP-23). I connected it to my laptop with A&D’s serial cable (AX-PC09-SCA) and an inexpensive converter to USB (as my laptop doesn’t have a serial port). Upon pressing the “PRINT” key on the scale, the weight was typed directly into an input field on a website:
Transferring the weight from a scale to a website

Compatibility with scales and balances

To use 232key, you’ll need a scale with a RS-232 interface (aka. serial port, COM port, EIA-232) or an interface which appears as a (virtual) COM port when the scale is connected to your PC. This is the case for many (but not all) scales with a USB interface and for scales which support the Bluetooth Serial Port Profile.

Your scale or balance also has to send the weight in ASCII format. Ideally, the weight should be the first numeric value sent and it should only be sent once (after you’ve pressed a key on the scale or on stability), not continuously.

The vast majority of scales and balances available on the market today fulfill these requirements. To give you a few examples, you should be able to use 232key with most or all scales and balances made by A&D, Mettler-Toledo, Ohaus, Sartorius and other well-known brands. New device profiles are constantly added!

Finally, an easy way to transfer data from your scale to your PC

We designed 232key to make your life easier. No complicated configuration is required. If your scale manufacturer or model is included in the list of predefined devices, you don’t even have to manually enter the interface parameters: Simply select your scale and click on Set defaults to load the settings.
interface settings for weighing scales and other instruments

Not sure which COM port your scale is connected to? Press the “Auto” button and 232key will try to detect the port automatically (works with devices which have some sort of hardware handshaking functionality, e.g. scales and balances made by A&D or Sartorius).

Do you know which decimal separator (point or comma) your scale is using? Why should you! 232key understands both input formats and lets you choose which output format you want.
output weight with dot or comma

Would you like 232key to press an additional key after typing the weight, e.g. the “Enter” key to jump to the next row in a spreadsheet? No problem, simply specify the desired key in the Output tab.
Press Enter after weight

All of these useful and user-friendly features are available for free! Additional functionality is available in the paid “Plus” version of 232key.

Download and documentation

Please visit our product website 232key for further information and to download our free software. There you’ll also find the documentation, an extensive troubleshooting guide and FAQ. Should you still have questions or feature suggestions, please post them in our support forum or as a comment below.


Do you prefer to write the weight to a file instead?

232key is a great solution for sending the weight from your scale to an application running on your PC (as simulated keystrokes). In some cases, however, it makes more sense to record the weight to a file which is opened later (e.g. in Excel).

This is particularly true for unattended data logging applications running over long periods of time. Another example are applications with high data rates (several weight values per second) which would overwhelm your PC when sent as keyboard inputs.

For these use cases, we’ve created Simple Data Logger, an easy to use solution for recording the weight sent from your scale to a CSV file. You can read more about it on this blog or on www.smartlux.com/sdl.


Article last changed on November 19, 2020: Screenshots and some links updated.