YuTGT: YuDash Text Generator

YuDash Text Generator

YuDash Text Generator is a powerful engine to generate any kind of text payload in flexible manner including the telemetry, metadata and timestamps. YuDash Text Generator is primarily used to generate text

YuDash Text Generator for Payload

The YuDash Text Generator is primarily for payload generator, which is explained here. It is also used in FTP file name creation, and local data logging. The semantics for engine remains same.

Payload Settings

  1. Select the payload Format of "TEXT_FORMAT_20" to use YuTGT.

  2. Select the timestamp format to be used in Text Generator.

  3. The configuration to YuDash Text Generator

YuDash Text Generator Block

The YuTGT block contains the series of encoding block (string) to generate the output payload text. Each string is separated by blank space(s). The complete block is processed by YuTGT engine to generate the text payload in every run-cycle.

YuTGT String components

Encoding StringDescription

$meta_data

The string prefixed by $ is encoded as it is in the output text (with $ removed). It is used to encoder any meta_data in the output text.

Single character

A single character (probably , . # etc) is encoded as it is in the output text. This simplifies creation of CSV without cryptic encoding. It is assumed that variable names are at least 2 characters!

#AA Encoder

The string prefixed with an # followed by 2 capital letters are used to encode specific data-times and special characters.

#TS

The timestamp as selected in payload settings will be encoded in the text. It can be UTC or local-time as per selection in Time-Stamp Settings.

#YY

Year encoded as 4 digits. This is taken from local-time.

#MM

Month encoded as 2 digits. This is taken from local-time.

#DD

Date encoded as 2 digits. This is taken from local-time.

#HH

Hour encoded as 2 digits. It is taken in 24 hour cycle from localtime.

#NN

Minutes encoded 2 digits. It is taken from local-time. Please note that minutes is #NN (not #MM, which used in month).

#SS

Seconds encoded as 2 digits. It is taken from local-time.

#DT

Date is format YYYY_MM_DD in encoded. It is taken from local-time.

#TD

TimeOfDay of format HH_NN_SS is encoded.

#NL

New line character. Please use #NL at end if you need and newline after text. Also, this is used to create a multi-line text file.

#SP

A black space is generated in the output text.

normal_string

A normal string is one without a prefix (a $ or an #) and at least 2 character long. This is looked up in the variables of payload and replaced with the actual value. Notes: a) For example, a temperature variable read from modbus written as 234.56 in the output text. The numbers are written as 2 decimal digits as default. b) In case the normal_string is not found in the variable list, it is ignored and no output text will be generated. c) In case, there was an error associated with reading of given variable (say modbus read error), the error string can be encoded in the output. It has to be specified in JSON configuration (not available in UI)

YuTGT Examples

Let's understand the YuDash Text Generator by actual examples. In all the examples, we are reading temperature and humidity from XY02 modbus sensor which are read as temp and humid in Modbus Settings.

YuTGT Example#1

Input YuDash Text Encoder Block

#YY / #MM / #DD , #HH : #NN : #SS , temp , humid , #NL

Output Text payload

2024/05/18,10:13:04,38.50,27.70,

Explanation

  • #YY #MM and #DD are replaced with present date. They were encoded with / in between.

  • #HH #NN #SS was the time block, which were encoded with : in between.

  • The temp and humid values as read from Modbus sensor were encoded with comma separators.

  • Finally, #NL adds a newline to the output file.

YuTGT Example#2

Input YuDash Text Encoder Block

$date , $temp , $humid #NL , $celcius , $percent #NL #TS , temp , humid , #NL

Output Text payload

date,temp,humid
,celcius,percent
2024_05_18_11_12_12,38.70,27.80,

Explanation

  • $date $temp $humid strings are encoded as raw string (meta) data.

  • #NL is used to create multiple line file with new lines between 3 parts.

  • #TS is used to generate a fixed time stamp format. Timestamp format of TS_64 has been selected in TimeStamp section to generate given time stamp.

  • The actual value of temp and humid were encoded in the output text.

Last updated