/
Defining Blocks and Datapoints
Defining Blocks and Datapoints
Blocks implement IzoT Resource files, and each resource file Block contains datapoints and properties. A Python application only needs to create an instance of each desired IzoT block, and all of the mandatory datapoints and properties are automatically created. In the sample lines below, the first set gains access to the IzoT resource files, the second set instantiates those blocks. To expose the various datapoints and properties to a Web browser, see Creating an IzoT Device Class File.
def main(): # Create instances of each desired resource block # the app object is obtained from the framework, see Creating an IzoT Application Object # ... global keypad global lux keypad = app.block(profile = iotKeypad()) lux = app.block(profile = iotAnalogOutput())
You can create a tuple that creates multiple blocks based on the same profile. The following example shows how to create a lux block tuple:
MAX_LUX = 2 lux = tuple( app.block( profile = iotAnalogOutput(), ext_name = 'lux{0}'ext_name = 'lux{0}'.format(i)) for i in range (MAX_LUX))
, multiple selections available,
Related content
Creating an IzoT Python Application
Creating an IzoT Python Application
More like this
Defining the Program ID
Defining the Program ID
More like this
Creating an IzoT Application Object
Creating an IzoT Application Object
More like this
IzoT Examples
IzoT Examples
More like this
Defining Connection Assemblies
Defining Connection Assemblies
More like this
Creating an Izot Device Class File
Creating an Izot Device Class File
More like this