Skip to content

Sample project showing how to connect to the scale C32 type via TCP and manage the database using the Json protocol.

Notifications You must be signed in to change notification settings

Radwag/ScaleCommunicationJsonProtocol

Repository files navigation

ScaleCommunicationJsonRdgProtocol App Sample

Contributors Forks Stargazers Issues

Sample project showing how to connect to the scale via TCP on port 4001 and how to manage the database via JsonRdgProtocol.

Technology

Project was written in Core .net5.0 framework.

Working description

After entering the ip address, you can manage the database of C32 devices with JsonRdgProtocol support.

The available options are in the app:

  • Listing of database tables.
  • Displaying a list of table records.
  • Adding records to the table.
  • Modification of records from the table.
  • Delete records from the table.

Commands

  • Get table list
{"Command":"DbGetTables"}8bitCRC\r\n
  • Get table info
{"Table":"TableName", "Command":"TableInfo"}8bitCRC\r\n
  • Get record by Index in table
{"Table":"TableName", "Index":Intiger, "Command":"DbRead"}8bitCRC\r\n
  • Get record by Id
{"Table":"Recipes", "Id":Intiger, "Command":"DbRead"}8bitCRC\r\n
  • Delete record from table
{"Table":"TableName", "Id":Intiger, "Command":"DbDelete"}8bitCRC\r\n
  • Insert record to database
{ "Command": "DbInsert",  "Table":"TableName",  "Name":"Text", ...etc}8bitCRC\r\n
  • Update record from database
{ "Command": "DbUpdate",  "Table":"TableName",  "Id":Intiger ,  "Name":"Text", ...etc}8bitCRC\r\n

Structure of response to a command DbGetTables

image

  • Command - Command name
  • Tables - List table items
  • STS - Status of response

image

  • Name - Unique name of table
  • TranslationCurrent - Translation of the name of the currently set language on the scale
  • TranslationEn - English translation of the name
  • Alterability - Alterability of table
    • 0=Visible
    • 1=ReadOnly
    • 2=Hidden

Structure of response to a command TableInfo

image

  • Table - Table name
  • Count - The number of records in the table
  • MaxCount - Maximum possible number of records in a table
  • Type - Table type
    • 0=Visible
    • 1=ReadOnly
    • 2=Hidden
  • Items - List column items
  • STS - Status of response

image

  • DbName - Unique name of the column in the table
  • Name - Name translations for the current balance language
  • EnName - Permanent English name
  • Type - Data type
    • UNSET = 0,
      • Catalog = 1,
      • Text = 2,
      • Floating = 3,
      • Enum = 4,
      • TimeSpan = 5,
      • DateTime = 6,
      • Int = 7,
      • OneToOneRel = 8,
      • OneToManyRel = 9,
      • Bool = 10,
      • Password = 11,
      • Ean13 = 12,
      • MultiLineText = 13,
      • PrimaryKey = 14,
      • Structure = 15,
      • Mask = 16
  • Alterability - Alterability of column
    • 0=Visible
    • 1=ReadOnly
    • 2=Hidden

Structure of response to a command DbRead for table Clients

image

  • Table - Name of the table the record comes from
  • Index - The position of the row in the table
  • Id - Unique id nuber of the rcord
  • STS - Status of response Rest depends on table info.

Installation

  1. Clone or download this repository.
  2. Open project in Visual Studio.
  3. Build and run.

About

Sample project showing how to connect to the scale C32 type via TCP and manage the database using the Json protocol.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages