Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleUse the Annotation Window to view your sample data in the String Viewing Window

Now we are in the Translator!

Every Translator component contains a Main.lua module with a main function that is called each time a message is received or on a configured poll time.

Notice we can see our sample data (variable Variable named Data) passed to main functionby looking at the Annotation Windows.

If we click on the sample data in the annotations, we can view it using The string viewing window.

Expand
titleParse the JSON sample data using json.parse{data=Data}

In main, parse the JSON sample data by passing Data. Create and assign the parsed data to a patient Variable variable.

Code Block
languagelua
local patient = json.parse{data=Data}

JSON objects are parsed into Lua tables as dictionaries with key-value pairs. You can see this by clicking the resulting table in the Annotation Window.

...