IND256x
Review the following information for setting up and configuring the IND256x driver.
The driver connects Litmus Edge (LE) to an IND256x weighing scale over Ethernet (TCP or UDP) or Serial. It reads the scale's streamed output and parses it into predefined tags for values such as net weight, tare weight, gross weight, and units. It can also send commands to the scale, such as tare, print, clear, and zero.
Tags in this driver use one of the following interaction patterns:
- Stream: A single byte-array tag that receives the scale's continuous output. The stream tag is the source for every predefined custom tag.
- Custom tags: Predefined, read-only tags (such as NetWT, TareWT, and GrossWT) that the driver parses from the stream. You select these from a drop-down list when you add a tag.
- Write: A tag used to send commands or requests to the scale.
Compatibility
Compatibility Parameter | Compatible Items |
|---|---|
Driver Type | Ethernet (TCP, UDP), Serial |
Validated Devices/Series | IND256x scale |
How to configure the device
To set up and configure this device in Litmus Edge, you will need to do the following:
- Step 1: Set up and configure the device
- Step 2: Set up the device in Litmus Edge DeviceHub
- Step 3: Configure the list of registers
Step 1: Set up and configure the device
Configure the IND256x scale to communicate over the transport you plan to use, then match those settings in LE.
- On the scale, enable the communication port for your chosen transport (Ethernet TCP/UDP or Serial) and configure it to send its output.
- For an Ethernet connection, note the scale's IP address or hostname and its port.
- For a serial connection, note the scale's serial settings (baud rate, data bits, stop bits, and parity) so you can enter matching values in DeviceHub.
- If the scale requires a command to begin sending data, note that command so you can enter it in the Connection Request field.
Note: Most IND256x commands require \r\n terminators, which the driver adds by default. Confirm the terminators your scale expects before you change this behavior.
Step 2: Set up the device in Litmus Edge DeviceHub
Configure the following parameters when you connect a device with this driver. Update default values to the specific setup of your device.
Parameter | Value |
|---|---|
Type | Generic |
Driver | IND256x |
Transport | Select TCP, UDP, or Serial. |
Network Address | Scale's hostname or IP address. Applies when Transport is TCP or UDP. |
Network Port | Scale's port. Applies when Transport is TCP or UDP. |
Device File | File of the serial port you are using. Applies when Transport is Serial. |
Baud Rate | Serial baud rate: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, or 921600. Applies when Transport is Serial. |
Data Bits | 5, 6, 7, or 8. Applies when Transport is Serial. |
Stop Bits | 1, 1.5, or 2. Applies when Transport is Serial. |
Parity | Even, Mark, None, Odd, or Space. Applies when Transport is Serial. |
Connection Request | Command the device requires to initiate the connection, if any. |
Protocol Byte Order | Byte order for the protocol: BigEndian (bytes-little): BADC, BigEndian: ABCD, LittleEndian (bytes-big): CDAB, or LittleEndian: DCBA. |
Data Byte Order | Byte order for the data: BigEndian (bytes-little): BADC, BigEndian: ABCD, LittleEndian (bytes-big): CDAB, or LittleEndian: DCBA. |
Multiple Connections | Enable or disable multiple streams. Applies when Transport is TCP or UDP. |
TLS | Enable or disable TLS encryption. Applies when Transport is TCP. |
Step 3: Configure the list of registers
When you Add a Tag to the connected device, refer to the following register table and tag parameters. Refer to the following additional resources:
Register table
Note: Add the Stream tag before you add any custom tags. Apart from the Stream and Write tags, the driver provides a drop-down list of all predefined tags available for the IND256x scale. The custom tags report data only when the Stream tag is present. The Write tag works even when the Stream tag has not been added.
Name | Value Types | Access Types | Description |
|---|---|---|---|
Write | uint8, uint16, uint32, uint64, int8, int16, int32, int64, float32, float64, string, []byte | R/W | Sends commands to the scale, such as T, P, C, or Z, or changes a value |
Stream | []byte | R/O | Continuous output stream from the scale. Required for the custom tags to report data |
NetWT | float64 | R/O | Net weight |
TareWT | float64 | R/O | Tare weight |
GrossWT | float64 | R/O | Gross weight |
Units | string | R/O | Weight units reported by the scale |
InMotion | bool | R/O | Indicates whether the scale is in motion |
IsUnderloadOverload | bool | R/O | Indicates an underload or overload condition |
RoundingIncrement | uint8 | R/O | Rounding increment applied to the reported weight |
IsPrintRequest | bool | R/O | Indicates a print request from the scale |
IsHighResolution | bool | R/O | Indicates whether the scale is in high-resolution mode |
Tag parameters
Configure the following parameters when you add a tag.
Parameter | Value |
|---|---|
Name | Register name from the drop-down list. Available options depend on the names in the register table. |
Value Type | Data type from the drop-down list. Available options depend on the register name selected. Supported types are uint8, uint16, uint32, uint64, int8, int16, int32, int64, float32, float64, string, and []byte. |
Polling Interval | Value in seconds. This determines how often the tag should poll the register for data. |
Tag Name | Name for the tag. |
Description (Optional) | Description for the tag. |
Payload | For Write registers, the command or request to send to the device as a hex string or in ASCII format. For example, to send the command TARE with the terminator \r, enter "TARE\r", "TARE" 0D, or 544152450D. Make sure the value type is string. |
Request Params | For Write registers, the request parameters formatted as JSON. Use this field to enter an address or area code to include in the request. Leave it empty if no request parameters are needed and you only need to send a command. For example: {"addr": "0007"}. |
Response Index | Start index of the values within the response. Enter 0 if you only need to send commands. |
Value Length | Length of a single value in bytes. Enter 0 for the entire response. |
Response Terminator | Characters or byte sequence (for example, \r) that indicate the end of the device response. The driver adds \r\n by default because most IND256x commands require it. You can remove it, enter a different terminator, or leave it blank to match your device's requirements. |
Include Terminator | Enable to include the response terminator in the value. |
Response Max Length | Largest full response frame size the driver is allowed to read from the socket before parsing stops. Enter 0 for unlimited. |
Override Transport | Defines an alternate endpoint for a single request. Note: The connection for an override transport is not persistent. |
Tag Formula | Formula to process tag data. See Tag formula below. |
Only Publish on Change of Value | Select the checkbox to publish NATS messages only when the value parameter changes to a new value. Change of Value only applies to boolean, numeric (such as int or float), and simple string data types. It does not apply to complex types, such as JSON or array. Poll-once topics are not affected by Change of Value settings. These topics will still only see a single message. |
Meta Data | Metadata summarizes basic information about data. This feature allows you to define key-value pair data for the device output payload later on. It can then be used to find, use, and reuse particular instances of data. Note: If you use special characters in meta data key names, the special characters are replaced with underscore characters in the payload. This can cause two key names to be combined into one. For example, configuring the key names a**b and a&&b will cause only one key name to be created (a__b). |
Tag formula
Enter a formula for the tag to process the generated data. Two variables are permitted: value (current tag value) and timestamp (current tag UNIX time in milliseconds). The following math functions are available:
Function | Description |
|---|---|
sin | Sine |
cos | Cosine |
sqrt | Square root |
tan | Tangent |
power(x) | Performs the operation 10^x |
log(x) | Natural logarithm (base e) |
exp(x) | Performs the operation e^x |