esi-simaticbatchbridge
Dependencies
library | version | inmation core library |
---|---|---|
dkjson |
2.5.0 |
yes |
socket |
3.0.0 |
yes |
esi-variables |
1.0.0 |
yes |
Available functions
All functions have to be called according to the ESI standard, using colons, e.g. lib:FUNCTIONNAME(params)
Documentation
CHAINBATCH2BATCH(params,credentials)
CHAINBATCH2BATCH chains a given batch to another batch.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set successor batch handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- set predecessor batch handle
params.predecessor = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 222)"
params.chainonstart = false
params.gaptimeinsec = 10
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:CHAINBATCH2BATCH(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
COPYBATCH(params,credentials)
COPYBATCH creates a copy of a batch and inserts it with a new name.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set handle of the batch to copy
params.hdl = "78/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- batch name
params.name = "MyBatch"
-- order description (optional)
params.desc = "Test batch"
-- if the "optlock" is set then newly created object will be locked and should be unlocked by the application after use
params.optlock = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:COPYBATCH(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
COPYFORMULA(params,credentials)
COPYFORMULA creates a copy of a formula and inserts it with a new name.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set handle of the formula to copy
params.hdl = "78/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- formula name
params.name = "MyFormula"
-- formula version
params.version = "v1"
-- formula description (optional)
params.desc = "description"
-- if the "optlock" is set then newly created object will be locked and should be unlocked by the application after use
params.optlock = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:COPYFORMULA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
COPYORDER(params,credentials)
COPYORDER creates a copy of an order and inserts it with a new name.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set handle of the order to copy
params.hdl = "78/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- order name
params.name = "MyOrder"
-- order description (optional)
params.desc = "Test order"
-- if the "optlock" is set then newly created object will be locked and should be unlocked by the application after use
params.optlock = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:COPYORDER(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
COPYRECIPE(params,credentials)
COPYRECIPE creates a copy of a given recipe and inserts it with a new name.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set handle of the recipe to copy
params.hdl = "/7/3/CG6_23227-613-21/(2:0-7#22, 110)"
--if set then subfolderhdl will be used
params.usesubfolder = true
-- set parent folder handle
params.subfolderhdl = "7/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- new name of the recipe
params.name = "MyRecipe"
-- version of the recipe
params.version = "v1"
-- order category description (optional)
params.desc = "My description"
-- if set then object will be locked
params.optlock = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:COPYRECIPE(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
CREATEBATCH(params,credentials)
CREATEBATCH creates a new batch in the given order.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set order handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
-- startmode parameter is optional
params.startmode = lib.StartMode.Manual
params.planstart = "2020-12-20T20:10:00.000Z"
params.planend = "2020-12-20T21:10:00.000Z"
-- batch name
params.name = "MyBatch"
-- batch size
params.size = 1
-- batch description (optional)
params.desc = "Test batch"
-- defines the handle of the recipe/formula
params.formormrhdl = "4/1/AF6_21137-613-22/(0:0-2805#5063, 320)"
-- if the "optlock" is set then newly created object will be locked and should be unlocked by the application after use
params.optlock = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:CREATEBATCH(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
CREATEFORMULA(params,credentials)
CREATEFORMULA creates a new formula in the given formula category.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set order category handle
params.hdl = "78/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- formula name
params.name = "MyOrder"
-- formula version
params.version = "v1"
-- order description (optional)
params.desc = "Test order"
-- if the "optlock" is set then newly created object will be locked and should be unlocked by the application after use
params.optlock = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:CREATEFORMULA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
CREATEFORMULACAT(params,credentials)
CREATEFORMULACAT creates a formula category.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
--if set then subfolderhdl will be used
params.usesubfolder = true
-- set parent folder handle
params.subfolderhdl = "7/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- order category name
params.name = "MyOrderCat"
-- order category description (optional)
params.desc = "My description"
-- if set then object will be locked
params.optlock = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:CREATEFORMULACAT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
CREATEMATERIAL(params,credentials)
CREATEMATERIAL creates a material.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
--if set then subfolderhdl will be used
params.usesubfolder = true
-- set parent folder handle
params.subfolderhdl = "7/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- material name
params.name = "MyOrderCat"
-- material description (optional)
params.desc = "My description"
-- set material code
params.code = "0815"
-- set material usage
params.usage = lib.MaterialUsage.Both
-- if set then object will be locked
params.optlock = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:CREATEMATERIAL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
CREATEORDER(params,credentials)
CREATEORDER creates a new order in the given order category.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set order category handle
params.hdl = "78/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
params.earliest = "2020-12-20T20:10:00.000Z"
params.latest = "2020-12-20T21:10:00.000Z"
-- order name
params.name = "MyOrder"
-- order size
params.size = 1
-- order description (optional)
params.desc = "Test order"
-- if the "optlock" is set then newly created object will be locked and should be unlocked by the application after use
params.optlock = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:CREATEORDER(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
CREATEORDERCAT(params,credentials)
CREATEORDERCAT creates an order category.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
--if set then subfolderhdl will be used
params.usesubfolder = true
-- set parent folder handle
params.subfolderhdl = "7/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- order category name
params.name = "MyOrderCat"
-- order category description (optional)
params.desc = "My description"
-- if set then object will be locked
params.optlock = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:CREATEORDERCAT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
CREATEQUALITY(params,credentials)
CREATEQUALITY creates a quality.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set material handle
params.hdl = "7/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- quality name
params.name = "MyOrderCat"
-- quality description
params.desc = "description"
-- quality code
params.code = 198
-- quality description (optional)
params.desc = "My description"
-- if the "optlock" is set then newly created object will be locked and should be unlocked by the application after use
params.optlock = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:CREATEQUALITY(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
CREATESUBFOLDER(params,credentials)
CREATESUBFOLDER creates a subfolder (available from version 7.12).
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set parent folder handle
params.hdl = "18/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- subfolder name
params.name = "MySubfolder"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:CREATESUBFOLDER(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
DELETEBATCH(params,credentials)
DELETEBATCH deletes the given batch from the given order.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set batch handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:DELETEBATCH(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
DELETEFORMULA(params,credentials)
DELETEFORMULA deletes a formula.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set formula handle
params.hdl = "7/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:DELETEFORMULA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
DELETEFORMULACAT(params,credentials)
DELETEFORMULACAT deletes a formula category.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set formula category handle
params.hdl = "7/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:DELETEFORMULACAT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
DELETEMATERIAL(params,credentials)
DELETEMATERIAL deletes a material.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set material handle
params.hdl = "18/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:DELETEMATERIAL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
DELETEORDER(params,credentials)
DELETEORDER deletes the given order from the given order category.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set order handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:DELETEORDER(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
DELETEORDERCAT(params,credentials)
DELETEORDERCAT deletes an order category.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set order category handle
params.hdl = "7/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:DELETEORDERCAT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
DELETERECIPE(params,credentials)
DELETERECIPE deletes a recipe.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set recipe handle
params.hdl = "7/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:DELETERECIPE(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
DELETEQUALITY(params,credentials)
DELETEQUALITY deletes a quality.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set quality handle
params.hdl = "18/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:DELETEQUALITY(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
DELETESUBFOLDER(params,credentials)
DELETESUBFOLDER deletes a subfolder (available from version 7.12).
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set subfolder handle
params.hdl = "18/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:DELETESUBFOLDER(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLBATCHES4ORDER(params,credentials)
GETALLBATCHES4ORDER returns all batches for the given order.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set order handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
-- if the optional parameter "synctime" is set then only objects created or modified after the given time are returned
params.synctime = "02.09.2020 16:45:00"
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLBATCHES4ORDER(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLCHAINEDPREDECESSORS4BATCH(params,credentials)
GETALLCHAINEDPREDECESSORS4BATCH returns all predecessors of a chained batch..
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set batch handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLCHAINEDPREDECESSORS4BATCH(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLCHAINEDSUCCESSORS4BATCH(params,credentials)
GETALLCHAINEDSUCCESSORS4BATCH returns all successors of a given batch.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set batch handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLCHAINEDSUCCESSORS4BATCH(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLCHAINROOTS4PCELL(params,credentials)
GETALLCHAINROOTS4PCELL returns all chain roots (all batches without any predecessor).
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLCHAINROOTS4PCELL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLDATATYPES4PCELL(params,credentials)
GETALLDATATYPES4PCELL returns all data types and values for the given process cell.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLDATATYPES4PCELL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLFORMULACATS4PCELL(params,credentials)
GETALLFORMULACATS4PCELL returns all formula categories for the given process cell.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Returns
The result contains the handles and selected attributes of all formula categories for the process cell.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
params.synctime = "02.09.2020 16:45:00"
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLFORMULACATS4PCELL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLFORMULAS4FORMULACAT(params,credentials)
GETALLFORMULAS4FORMULACAT returns all formulas for the given formula category.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Returns
The result contains the handles and selected attributes of all formulas in the formula category.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set formula category handle
params.hdl = "/13/4/BF6_44517-124-74/(0:0-2199#5132, 200)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
params.synctime = "02.09.2020 16:45:00"
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLFORMULAS4FORMULACAT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLFORMULAS4MR(params,credentials)
GETALLFORMULAS4MR return all formulas for the given recipe.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Returns
The result contains the handles and selected attributes of all formulas for the given recipe.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set recipe handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
--if the optional parameter "synctime" is set then only object created or modified after the given time are returned
params.synctime = "02.09.2020 16:45:00"
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLFORMULAS4MR(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLFORMULASORMR4CREATEBATCH(params,credentials)
GETALLFORMULASORMR4CREATEBATCH returns all recipes/formula suitable for creating a batch.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Returns
The result contains the handles and selected attributes of all formulas / recipes suitable for creating a batch.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
params.synctime = "02.09.2020 16:45:00"
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLFORMULASORMR4CREATEBATCH(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLLIB4PCELL(params,credentials)
GETALLLIB4PCELL returns all libraries for the given process cell (available from version 7.12).
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
params.synctime = "02.09.2020 16:45:00"
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLLIB4PCELL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLMATERIALS4PCELL(params,credentials)
GETALLMATERIALS4PCELL returns all materials for the given process cell.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Returns
The result contains the handles and selected attributes of all materials for the process cell.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
params.synctime = "02.09.2020 16:45:00"
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLMATERIALS4PCELL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLMR4PCELL(params,credentials)
GETALLMR4PCELL returns all recipes for the given process cell.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
params.synctime = "02.09.2020 16:45:00"
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLMR4PCELL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLORDERCATS4PCELL(params,credentials)
GETALLORDERCATS4PCELL returns all order categories for the given process cell.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Returns
The result contains the handles and selected attributes of all order categories for the process cell.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
params.synctime = "02.09.2020 16:45:00"
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLORDERCATS4PCELL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLORDERS4ORDERCAT(params,credentials)
GETALLORDERS4ORDERCAT returns all orders for the given order category.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Returns
The result contains the handles and selected attributes of all orders in the order category.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set order category handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
-- if the optional parameter "synctime" is set then only objects created or modified after the given time are returned
params.synctime = "02.09.2020 16:45:00"
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLORDERS4ORDERCAT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLPCELLS4PROJECT(params)
GETALLPCELLS4PROJECT returns all available process cells for the given project.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
lib:SETCONNECTION({})
local result, exception = lib:GETALLPCELLS4PROJECT(params)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLPHYSICALUNITS4PCELL(params,credentials)
GETALLPHYSICALUNITS4PCELL returns all physical units for the given process cell.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLPHYSICALUNITS4PCELL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLPROJECTS(params)
GETALLPROJECTS returns all available SIMATIC BATCH projects.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
lib:SETCONNECTION({})
local result, exception = lib:GETALLPROJECTS(params)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLQUALITIES4MATERIAL(params,credentials)
GETALLQUALITIES4MATERIAL return all qualities for the given material.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
set material handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
params.synctime = "02.09.2020 16:45:00"
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLQUALITIES4MATERIAL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETALLSUBFOLDERS4PCELL(params,credentials)
GETALLSUBFOLDERS4PCELL returns all subfolders for the given process cell.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETALLSUBFOLDERS4PCELL(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETATTRIBUTE4OBJECT(params,credentials)
GETATTRIBUTE4OBJECT returns attributes for a given object.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETATTRIBUTE4OBJECT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETBATCHSIZE(params,credentials)
GETBATCHSIZE returns the batch size.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local credentials = {}
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set batch handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETBATCHSIZE(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETBATCHSTATE(params,credentials)
GETBATCHSTATE returns the state, extended state and chaining info for a given batch.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local credentials = {}
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set batch handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETBATCHSTATE(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETBATCHSTARTDATA(params,credentials)
GETBATCHSTARTDATA returns the state, extended state and chaining info for a given batch.
For detailed explanation see SIMATIC BATCH COM API documentation.
Returns
The output contains the following batch data: planned start, estimated end, actual start, actual end, start modus.
Usage
local lib = require("esi-simaticbatchbridge")
local credentials = {}
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set batch handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETBATCHSTARTDATA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETCHILDREN(params,credentials)
GETCHILDREN returns all children for a given object.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
--if the optional parameter "synctime" is set then only object created or modified after the given time are returned
params.synctime = "02.09.2020 16:45:00"
params.objecttype = lib.ObjectType.Batch
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETCHILDREN(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETEVENTS(params)
GETEVENTS returns events collected for the given handle in the buffer since the last GETEVENTS() call.
Returns
The result contains error code, the list of events, the information if overflow occured since last GETEVENTS() call and if all events were returned.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set subscription handle (value returned from SUBSCRIBE() call)
params.handle = "CC8596BD-DF37-4F34-9EB4-0965C35FD739"
lib:SETCONNECTION({})
local result, exception = lib:GETEVENTS(params)
return (require "esi-string"):STRING({res=result,ex=exception})
GETERRORTEXT(errorcode)
GETERRORTEXT returns the text for an error code.
For detailed explanation see SIMATIC BATCH COM API documentation.
GETFORMULACAT4MR(params,credentials)
GETFORMULACAT4MR returns the formula category for the given recipe.
For detailed explanation see SIMATIC BATCH COM API documentation.
Returns
The result contains the handle and selected attributes of the formula category referenced in the recipe.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set recipe handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETFORMULACAT4MR(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETMATERIALDATA(params,credentials)
GETMATERIALDATA returns material data for a given material.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local credentials = {}
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
set material handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
params.outputbar = true
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETMATERIALDATA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETMR4FORMULA(params,credentials)
GETMR4FORMULA returns all referenced recipes for a given formula.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Returns
The result contains the handles and selected attributes of all recipes referencing the formula.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set formula handle
params.hdl = "/13/4/BF6_44517-124-74/(0:0-2199#5132, 200)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
params.hierarchy = false
params.wildcardfilter4name = "A*"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETMR4FORMULA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETOBJECTDATA(params,credentials)
GETOBJECTDATA returns a given object.
For detailed explanation see SIMATIC BATCH COM API documentation.
Parameters
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
params.useexttransform = false
params.exttransform = ""
-- archiveversion has value between 1 and 9
params.archiveversion = 9
params.dataflags = lib.DataFlags.PCell + lib.DataFlags.Charts
-- or
-- params.archiveversion = 3
-- params.default = false
-- params.pcell = true
-- or
-- params.archiveversion = 2
-- params.pcell = true
-- or
-- params.archiveversion = 1
-- params.extdata = false
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETOBJECTDATA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETOBJECTHEADER(params,credentials)
GETOBJECTHEADER returns the header parameter block of objects. The function is implemented 4 batch, lib, mr, formula objects.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local credentials = {}
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
set object handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
params.withactvalue = true
params.withparameter = true
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETOBJECTHEADER(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETOBJECTSTATE(params,credentials)
GETOBJECTSTATE returns state and extended state for recipes, libraries, formulas or batches.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local credentials = {}
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
set object handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETOBJECTSTATE(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETPARAMETER(params,credentials)
GETPARAMETER returns the parameters for a given recipe, formula or batch.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
-- all paramters which begin with "A"
params.wildcardfilter4name = "A*"
params.ignoredeferring = true
params.withactvalue = true
params.termid = 2
params.contid = 1
params.usage = lib.ParamUsage.Both
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETPARAMETER(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETPARENT(params,credentials)
GETPARENT returns the parent object of a given object.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETPARENT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETPRODUCTDATA4OBJECT(params,credentials)
GETPRODUCTDATA4OBJECT returns the Product data for a given object (available from version 7.12).
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "/13/4/BF6_44517-124-74/(0:0-2199#5132, 200)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETPRODUCTDATA4OBJECT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETQUALITYDATA(params,credentials)
GETQUALITYDATA returns quality data for a given quality.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local credentials = {}
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
set quality handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
params.outputbar = true
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:GETQUALITYDATA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
GETSTATUS()
GETSTATUS returns information about Simatic Bridge service.
GETSUBSCRIPTIONSTATE()
GETSUBSCRIPTIONSTATE returns the state of the events subscription.
ISMATERIALREFERENCED(params,credentials)
ISMATERIALREFERENCED returns all recipes, libraries or formulas referencing a given material.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set material handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- outputbar specifies the types of the attributes to be returned along with the handle
params.outputbar = lib.AttributeType.Name + lib.AttributeType.Version
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:ISMATERIALREFERENCED(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
LOCKOBJECT(params,credentials)
LOCKOBJECT sets a lock on a SIMATIC BATCH object.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local credentials = {}
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:LOCKOBJECT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SETATTRIBUTE4OBJECT(params,credentials)
SETATTRIBUTE4OBJECT sets attributes for a given object.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- set attribute type
params.attributetype = lib.AttributeType.Desc
-- set attribute value
params.value = "Main instance"
local credentials = {}
params.username = "JOW"
params.usernamelong = "John Wood"
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SETATTRIBUTE4OBJECT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SETBATCHSIZE(params,credentials)
SETBATCHSIZE sets the batch size.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set batch handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
params.size = 100
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SETBATCHSIZE(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SETBATCHSTARTDATA(params,credentials)
SETBATCHSTARTDATA sets the start data for a given batch.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set batch handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
params.startmode = lib.StartMode.Time
params.planstart = "2020-12-20T20:10:00.000Z"
params.planend = "2020-12-20T21:10:00.000Z"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SETBATCHSTARTDATA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SETBATCHSTATE(params,credentials)
SETBATCHSTATE sets the state, extended state and continue flag for a batch.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set batch handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
params.state = lib.BatchState.Released
params.exstate = lib.BatchExState.InitialValue
params.continue = true
params.stayincontimode = true
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SETBATCHSTATE(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SETCONNECTION(args)
SETCONNECTION configures TCP connection settings.
It should be called before any other Simatic Bridge function.
SETFORMULACAT4MR(params,credentials)
SETFORMULACAT4MR sets a reference to the given formula category for the given recipe.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set recipe handle
params.hdl = "7/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- set formula category handle
params.formcathdl = "6/4/CF6_88888_611-31/(0:0-2805#5063, 320)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SETFORMULACAT4MR(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SETMATERIALDATA(params,credentials)
SETMATERIALDATA sets material data for a given material.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set material handle
params.hdl = "/77/3/CG6_21137-613-22/(2:0-7#22, 110)"
params.name = "MyMaterial"
-- material description (optional)
params.desc = "My description"
-- set material code
params.code = "0815"
-- set material usage
params.usage = lib.MaterialUsage.Both
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SETMATERIALDATA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SETMR4FORMULA(params,credentials)
SETMR4FORMULA sets a recipe reference for the given formula.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set formula handle
params.hdl = "7/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
-- set recipe handle
params.mrhdl = "6/4/CF6_88888_611-31/(0:0-2805#5063, 320)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SETMR4FORMULA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SETOBJECTSTATE(params,credentials)
SETOBJECTSTATE sets the state, extended state for an object.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
params.state = lib.BatchState.Released
params.exstate = lib.BatchExState.InitialValue
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SETOBJECTSTATE(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SETPARAMETER(params,credentials)
SETPARAMETER sets or changes parameters for a given batch or formula.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
params.ignoredeferring = true
params.withactvalue = true
params.parameters = {}
local p1 = {}
params.parameters[1] = p1
p1.usage = lib.ParamUsage.Both
p1.datatypeid = 6
p1.physicalunitid = 3
p1.id = 1
p1.materialhdl = "/10/4/SB6_3741141072619/(0:0-3764#12349, 219)"
p1.value = "13"
local p2 = {}
params.parameters[2] = p2
p2.usage = lib.ParamUsage.Input
p2.datatypeid = 24
p2.physicalunitid = 0
p2.id = 2
p2.value = "94"
local p3 = {}
params.parameters[3] = p3
p3.usage = lib.ParamUsage.Input
p3.datatypeid = 50
p3.id = 5
p3.valueid = 2
local p4 = {}
params.parameters[4] = p4
p4.usage = lib.ParamUsage.Both
p4.id = 1
p4.amount = 13
p4.materialhdl = "/10/4/SB6_3741141072619/(0:0-3795#12414, 219)"
p4.physicalunitid = 3
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SETPARAMETER(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SETPRODUCTDATA4OBJECT(params,credentials)
SETPRODUCTDATA4OBJECT gets the product data for a given object (MR/FORM/BATCH)..
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- set product handle
params.producthdl = "/60/4/CF6_14517-124-74/(0:0-2199#5632, 211)"
local credentials = {}
params.username = "JOW"
params.usernamelong = "John Wood"
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SETPRODUCTDATA4OBJECT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SETQUALITYDATA(params,credentials)
SETQUALITYDATA sets the quality data.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set quality handle
params.hdl = "/77/3/CG6_21137-613-22/(2:0-7#22, 110)"
-- quality name
params.name = "MyQuality"
-- quality description (optional)
params.desc = "My description"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SETQUALITYDATA(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SISCONNECT(params,credentials)
SISCONNECT creates connection to the SIS server.
Parameters
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
params.position4eventid = lib.Position4EventId.Actual
params.eventid = 0
params.adviseoptions = lib.AdviseOptions.Default
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SISCONNECT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SISDISCONNECT(credentials)
SISDISCONNECT ends connection to the SIS server.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
lib:SISCONNECT(params, credentials)
local result, exception = lib:SISDISCONNECT(credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SISGETALLEVENTDEFINITIONS(credentials)
SISGETALLEVENTDEFINITIONS returns all available event definitions.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
lib:SISCONNECT(params, credentials)
local result,exception = lib:SISGETALLEVENTDEFINITIONS(credentials)
-- at the end disconnect from SIS server
lib:SISDISCONNECT(credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SISGETALLSUBSCRIPTIONS(credentials)
SISGETALLSUBSCRIPTIONS returns all subscribed event definitions.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
lib:SISCONNECT(params, credentials)
local result = lib:SISSUBSCRIBE()
local handle = result.handle
params = {}
-- set handle of the SIS event to subscribe
params.hdl = "29/4/SB6_XYZ/1-Batch"
lib:SISSUBSCRIBEEVENT(params, credentials)
params = {}
-- use the handle acquired during SISSUBSCRIBE
params.hdl = handle
-- from time to time query internal buffer to get events
local events, ex = lib:SISGETEVENTS(params)
-- retrieve subscribed event definition
local definitions = lib:SISGETALLSUBSCRIPTIONS(credentials)
params = {}
-- set handle of the SIS event to unsubscribe
params.hdl = "29/4/SB6_XYZ/1-Batch"
-- stop receive notifications for particular event
lib:SISUNSUBSCRIBEEVENT(params, credentials)
-- at the end disconnect from SIS server
lib:SISDISCONNECT(credentials)
SISGETBATCHHISTORICALEVENTSBYID(params,credentials)
SISGETBATCHHISTORICALEVENTSBYID retrieves eventdata from batch using event identifiers.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set batch handle
params.hdl = "78/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
params.starteventid = 0
params.endeventid = 999
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SISGETBATCHHISTORICALEVENTSBYID(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SISGETBATCHHISTORICALEVENTSBYTIME(params,credentials)
SISGETBATCHHISTORICALEVENTSBYTIME retrieves eventdata from batch using time.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set batch handle
params.hdl = "78/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
params.starttime = "2020-01-01T01:00:00.000Z"
params.endtime = "2021-10-01T01:00:00.000Z"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SISGETBATCHHISTORICALEVENTSBYTIME(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SISGETCHANGEDBATCHES(params,credentials)
SISGETCHANGEDBATCHES retrieves batches which have been active in a given time interval.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
params.starttime = "2020-01-01T01:00:00.000Z"
params.endtime = "2021-10-01T01:00:00.000Z"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SISGETCHANGEDBATCHES(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SISGETEVENTS(params)
SISGETEVENTS queries internal buffer to get SIS events.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
lib:SISCONNECT(params, credentials)
local result = lib:SISSUBSCRIBE()
local handle = result.handle
params = {}
-- set handle of the SIS event to subscribe
params.hdl = "29/4/SB6_XYZ/1-Batch"
lib:SISSUBSCRIBEEVENT(params, credentials)
params = {}
-- use the handle acquired during SISSUBSCRIBE
params.hdl = handle
-- from time to time query internal buffer to get events
local events,exception = lib:SISGETEVENTS(params)
params = {}
-- set handle of the SIS event to unsubscribe
params.hdl = "29/4/SB6_XYZ/1-Batch"
-- stop receive notificationsstop receive notifications for particular event
lib:SISUNSUBSCRIBEEVENT(params, credentials)
-- at the end disconnect from SIS server
lib:SISDISCONNECT(credentials)
return (require "esi-string"):STRING({res=events,ex=exception})
SISGETSUBSCRIPTIONSTATE()
SISGETSUBSCRIPTIONSTATE returns the state of the SIS events subscription.
Returns
The result contains the project and pcell of the current SIS subscription. Additionally it contains list of used handles, number of events in all buffers and number of buffers.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
lib:SISCONNECT(params, credentials)
local result = lib:SISSUBSCRIBE()
local handle = result.handle
lib:SISSUBSCRIBEALLBASICEVENTS(credentials)
local state, exeption = lib:SISGETSUBSCRIPTIONSTATE()
-- free all handles acquired during SISSUBSCRIBE
lib:SISUNSUBSCRIBEALL()
return (require "esi-string"):STRING({res=state,ex=exception})
SISGETUNITHISTORICALEVENTSBYID(params,credentials)
SISGETUNITHISTORICALEVENTSBYID retrieves eventdata from unit using event identifiers.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set unit handle
params.hdl = "78/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
params.starteventid = 0
params.endeventid = 999
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SISGETUNITHISTORICALEVENTSBYID(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SISGETUNITHISTORICALEVENTSBYTIME(params,credentials)
SISGETUNITHISTORICALEVENTSBYTIME retrieves eventdata from unit using time.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set unit handle
params.hdl = "78/4/CF6_23447-613-22/(0:0-2805#5063, 320)"
params.starttime = "2020-01-01T01:00:00.000Z"
params.endtime = "2021-10-01T01:00:00.000Z"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:SISGETUNITHISTORICALEVENTSBYTIME(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
SISSUBSCRIBE()
SISSUBSCRIBE prepares Simatic Batch Bridge server for accepting SIS notifications. Can be called multiple times from different scripts.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
lib:SISCONNECT(params, credentials)
local result = lib:SISSUBSCRIBE()
local handle = result.handle
lib:SISSUBSCRIBEALLBASICEVENTS(credentials)
params = {}
-- use the handle acquired during SISSUBSCRIBE
params.hdl = handle
-- from time to time query internal buffer to get events
local events,ex = lib:SISGETEVENTS(params)
-- call this one and no more events are collected
lib:SISUNSUBSCRIBEALL()
-- at the end disconnect from SIS server
lib:SISDISCONNECT(credentials)
SISSUBSCRIBEALLBASICEVENTS(credentials)
SISSUBSCRIBEALLBASICEVENTS subscribes for all types of basic SIS events with one call.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
lib:SISCONNECT(params, credentials)
local result = lib:SISSUBSCRIBE()
local handle = result.handle
lib:SISSUBSCRIBEALLBASICEVENTS(credentials)
params = {}
-- use the handle acquired during SISSUBSCRIBE
params.hdl = handle
-- from time to time query internal buffer to get events
local events,ex = lib:SISGETEVENTS(params)
-- call this one and no more events are collected
lib:SISUNSUBSCRIBEALL()
-- at the end disconnect from SIS server
lib:SISDISCONNECT(credentials)
SISSUBSCRIBEEVENT(params,credentials)
SISSUBSCRIBEEVENT subscribes for a single event definitions.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
lib:SISCONNECT(params, credentials)
local result = lib:SISSUBSCRIBE()
local handle = result.handle
params = {}
-- set handle of the SIS event to subscribe
params.hdl = "29/4/SB6_XYZ/1-Batch"
lib:SISSUBSCRIBEEVENT(params, credentials)
params = {}
-- use the handle acquired during SISSUBSCRIBE
params.hdl = handle
-- from time to time query internal buffer to get events
local events, ex = lib:SISGETEVENTS(params)
params = {}
-- set handle of the SIS event to unsubscribe
params.hdl = "29/4/SB6_XYZ/1-Batch"
-- stop receive notifications for particular event
lib:SISUNSUBSCRIBEEVENT(params, credentials)
-- at the end disconnect from SIS server
lib:SISDISCONNECT(credentials)
SISUNSUBSCRIBE(params)
SISUNSUBSCRIBE frees handle acquired during SISSUBSCRIBE.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
lib:SISCONNECT(params, credentials)
local result = lib:SISSUBSCRIBE()
local handle = result.handle
lib:SISSUBSCRIBEALLBASICEVENTS(credentials)
params = {}
-- use the handle acquired during SISSUBSCRIBE
params.hdl = handle
-- from time to time query internal buffer to get events
local events,ex = lib:SISGETEVENTS(params)
params = {}
-- use the handle acquired during SISSUBSCRIBE
params.hdl = handle
-- free handle acquired during SISSUBSCRIBE
lib:SISUNSUBSCRIBE(params)
SISUNSUBSCRIBEALL()
SISUNSUBSCRIBEALL frees all handles acquired during SISSUBSCRIBE.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
lib:SISCONNECT(params, credentials)
local result = lib:SISSUBSCRIBE()
local handle = result.handle
lib:SISSUBSCRIBEALLBASICEVENTS(credentials)
params = {}
-- use the handle acquired during SISSUBSCRIBE
params.hdl = handle
-- from time to time query internal buffer to get events
local events,ex = lib:SISGETEVENTS(params)
-- free all handles acquired during SISSUBSCRIBE
lib:SISUNSUBSCRIBEALL()
SISUNSUBSCRIBEEVENT(params,credentials)
SISUNSUBSCRIBEEVENT unsubscribes for single event definitions.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
lib:SISCONNECT(params, credentials)
local result = lib:SISSUBSCRIBE()
local handle = result.handle
params = {}
-- set handle of the SIS event to subscribe
params.hdl = "29/4/SB6_XYZ/1-Batch"
lib:SISSUBSCRIBEEVENT(params, credentials)
params = {}
-- use the handle acquired during SISSUBSCRIBE
params.hdl = handle
-- from time to time query internal buffer to get events
local events, ex = lib:SISGETEVENTS(params)
params = {}
-- set handle of the SIS event to unsubscribe
params.hdl = "29/4/SB6_XYZ/1-Batch"
-- stop receive notifications for particular event
lib:SISUNSUBSCRIBEEVENT(params, credentials)
-- at the end disconnect from SIS server
lib:SISDISCONNECT(credentials)
SUBSCRIBE(params)
SUBSCRIBE requests notifications to be sent to the bridge application.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set the list of notification types that will be ignored
params.notifytype = {lib.NotifyType.UnLock, lib.NotifyType.Lock}
-- set the list of object types that will be ignored
params.objecttype = {lib.ObjectType.SubFolder, lib.ObjectType.Material}
local credentials = {}
lib:SETCONNECTION({})
local result, exception = lib:SUBSCRIBE(params)
return (require "esi-string"):STRING({res=result,ex=exception})
UNCHAINBATCHFROMBATCH(params,credentials)
UNCHAINBATCHFROMBATCH unchains a given batch from another batch.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set successor batch handle
params.hdl = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 211)"
-- set predecessor batch handle
params.predecessor = "/64/4/BF6_24517-324-74/(0:0-2199#5632, 222)"
local credentials = {}
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:UNCHAINBATCHFROMBATCH(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
UNSUBSCRIBE(params)
UNSUBSCRIBE requests that notifications will not be saved in the buffer assigned to the handle.
Usage
local lib = require("esi-simaticbatchbridge")
local params = {}
-- set subscription handle (value returned from SUBSCRIBE() call)
params.handle = "CC8596BD-DF37-4F34-9EB4-0965C35FD739"
lib:SETCONNECTION({})
local result, exception = lib:UNSUBSCRIBE(params)
return (require "esi-string"):STRING({res=result,ex=exception})
UNLOCKOBJECT(params,credentials)
UNLOCKOBJECT releases the lock from a SIMATIC BATCH object.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local credentials = {}
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:UNLOCKOBJECT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})
UNSUBSCRIBEALL()
UNSUBSCRIBEALL requests that notifications no longer will be sent to the bridge application.
VALIDATEOBJECT(params,credentials)
VALIDATEOBJECT validates a given recipe, library or batch.
For detailed explanation see SIMATIC BATCH COM API documentation.
Usage
local lib = require("esi-simaticbatchbridge")
local credentials = {}
local params = {}
-- set project handle
params.projecthdl = "1/DeProject9"
-- set process cell handle
params.pcellhdl = "/3/3/CF6_23337-613-22/(2:0-7#22, 110)"
-- set object handle
params.hdl = "128/4/CF6_23337-613-22/(0:0-2805#5063, 320)"
credentials.username = "JOW"
credentials.usernamelong = "John Wood"
credentials.password = "MyPassword"
credentials.domain = "MyDomain"
lib:SETCONNECTION({})
local result, exception = lib:VALIDATEOBJECT(params, credentials)
return (require "esi-string"):STRING({res=result,ex=exception})