IND256x
9 min
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 docid\ tuy hh0gi8djvot70wroh to the connected device, refer to the following register table and tag parameters refer to the following additional resources organize device and tag data by using metadata docid\ mu 6j6zhi0cvchdad0w8n tag formula variables docid\ io7xgyrdvv vmpnfxoaci 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