Class S7Functions
java.lang.Object
research.ch.cern.unicos.cpc.utilities.siemens.S7Functions
Class containing functions for Siemens Step 7
- Author:
- Ivan Prieto Barreiro
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LinkedHashSet<research.ch.cern.unicos.utilities.IDeviceInstance> get_instances_FI(String deviceType) Function for getting the Fast Interlock HashSet of objects of the DeviceType specifiedstatic StringgetTargetDeviceInformationParam(String parameterName, String typeName) Get the value of an attribute defined in the TargetDeviceInformation family from the Device type definition.static voidInitialize the value of the internal memberisLargeApplication.static booleanisFastInterlock(research.ch.cern.unicos.utilities.IDeviceInstance deviceInstance) Function for checkin if a particular instance is fast interlockstatic booleanGet the value of the class member isLargeApplication @seeinitialize()static StringThis function provides the symbol name of the DB for a given instance name (e.g.static StringThis function provides the symbol name of the DB for a given instance name (e.g.static StringThis function provides the symbol name of the DB for a given instance name (e.g.static StringThis function provides the symbol name of the DB for a given instance name (e.g.static Strings7db_id(research.ch.cern.unicos.utilities.IDeviceInstance instance, boolean isDBSimpleRequested) This function provides the symbol name of the DB for a given instance name (e.g.static StringThis function provides the symbol name of the DB for a given instance name (e.g.static Strings7db_id(research.ch.cern.unicos.utilities.IInstancesFacade theUnicosProject, String name, boolean isDBSimpleRequested) This function provides the symbol name of the DB for a given instance name (e.g.static Strings7db_id(research.ch.cern.unicos.utilities.IInstancesFacade theUnicosProject, String name, String deviceTypes) This function provides the symbol name of the DB for a given instance name (e.g.static Strings7db_id(research.ch.cern.unicos.utilities.IInstancesFacade theUnicosProject, String name, String deviceTypes, boolean isDBSimpleRequested) This function provides the symbol name of the DB for a given instance name (e.g.
-
Constructor Details
-
S7Functions
public S7Functions()
-
-
Method Details
-
initialize
public static void initialize()Initialize the value of the internal memberisLargeApplication. The value is taken from the UnicosApplication.xml file, parameter:SiemensPLC:SiemensSpecificParameters:GeneralConfiguration:LargeApplication. The method must be called once for each application generation before calling any of thes7dbid(...)class methods. -
get_instances_FI
public static LinkedHashSet<research.ch.cern.unicos.utilities.IDeviceInstance> get_instances_FI(String deviceType) Function for getting the Fast Interlock HashSet of objects of the DeviceType specified- Parameters:
deviceType- Device Type which fast interlock objects are returned- Returns:
- The fast interlock instances in order
-
isFastInterlock
public static boolean isFastInterlock(research.ch.cern.unicos.utilities.IDeviceInstance deviceInstance) Function for checkin if a particular instance is fast interlock- Parameters:
deviceInstance- The instance to be checked- Returns:
-
s7db_id
public static String s7db_id(research.ch.cern.unicos.utilities.IInstancesFacade theUnicosProject, String name, String deviceTypes) throws Exception This function provides the symbol name of the DB for a given instance name (e.g.s7db_id(specFile, AIRinstance1Name, "AnalogInputReal")returnsDB_AIR_All.AIR_SET). Calling this method is equivalent to:s7db_id(IInstancesFacade, String, String, boolean)with the boolean parameter equal to false.Example:
FeedbackOn = instance.getAttributeData("FEDeviceEnvironmentInputs:Feedback On") if FeedbackOn != "": s7db_id_result=self.thePlugin.s7db_id(self.theUnicosProject, FeedbackOn, "DigitalInput") self.thePlugin.writeInstanceInfo('''$Name$.HFOn:='''+s7db_id_result+FeedbackOn+'''.PosSt;''')- Parameters:
theUnicosProject- Java representation of the UNICOS specifications file.name- Is the name of the instance that we want to processdeviceTypes- Device type list (comma separated)- Throws:
Exception
-
s7db_id
This function provides the symbol name of the DB for a given instance name (e.g.s7db_id(AIRinstance1Name, "AnalogInputReal")returnsDB_AIR_All.AIR_SET). The function will use the same specs. file used in the application to search for the specified instance. Calling this method is equivalent to:s7db_id(IInstancesFacade, String, String, boolean)with the boolean parameter equal to false.Example:
FeedbackOn = instance.getAttributeData("FEDeviceEnvironmentInputs:Feedback On") if FeedbackOn != "": s7db_id_result=self.thePlugin.s7db_id(FeedbackOn, "DigitalInput") self.thePlugin.writeInstanceInfo('''$Name$.HFOn:='''+s7db_id_result+FeedbackOn+'''.PosSt;''')- Parameters:
name- Is the name of the instance that we want to processdeviceTypes- Device type list (comma separated)- Throws:
Exception
-
s7db_id
public static String s7db_id(research.ch.cern.unicos.utilities.IInstancesFacade theUnicosProject, String name, String deviceTypes, boolean isDBSimpleRequested) throws Exception This function provides the symbol name of the DB for a given instance name (e.g.s7db_id(specFile, AIRinstance1Name,"AnalogInputReal", false)returnsDB_AIR_All.AIR_SET).Note:
- If the flag
isDBSimpleRequestedisTRUE, and - If the specified instance is an
AnalogInputRealor aDigitalInputdevice
DB_<RepresentationName>_All_S.<RepresentationName>_SET.Example:
FeedbackOn = instance.getAttributeData("FEDeviceEnvironmentInputs:Feedback On") if FeedbackOn != "": s7db_id_result=self.thePlugin.s7db_id(self.theUnicosProject, FeedbackOn, "DigitalInput", false) self.thePlugin.writeInstanceInfo('''$Name$.HFOn:='''+s7db_id_result+FeedbackOn+'''.PosSt;''')- Parameters:
theUnicosProject- Java representation of the UNICOS specifications file.name- Is the name of the instance that we want to processdeviceTypes- Device type list (comma separated)isDBSimpleRequested- TRUE if the DB Simple is requested.- Throws:
Exception
- If the flag
-
s7db_id
public static String s7db_id(String name, String deviceTypes, boolean isDBSimpleRequested) throws Exception This function provides the symbol name of the DB for a given instance name (e.g.s7db_id(AIRinstance1Name,"AnalogInputReal", false)returnsDB_AIR_All.AIR_SET). The function will use the same specs. file used in the application to search for the specified instance.Note:
- If the flag
isDBSimpleRequestedisTRUE, and - If the specified instance is an
AnalogInputRealor aDigitalInputdevice
DB_<RepresentationName>_All_S.<RepresentationName>_SET.Example:
FeedbackOn = instance.getAttributeData("FEDeviceEnvironmentInputs:Feedback On") if FeedbackOn != "": s7db_id_result=self.thePlugin.s7db_id(FeedbackOn, "DigitalInput", false) self.thePlugin.writeInstanceInfo('''$Name$.HFOn:='''+s7db_id_result+FeedbackOn+'''.PosSt;''')- Parameters:
name- Is the name of the instance that we want to processdeviceTypes- Device type list (comma separated)isDBSimpleRequested- TRUE if the DB Simple is requested.- Throws:
Exception
- If the flag
-
s7db_id
public static String s7db_id(research.ch.cern.unicos.utilities.IInstancesFacade theUnicosProject, String name) throws Exception This function provides the symbol name of the DB for a given instance name (e.g.s7db_id(specFile, AIRinstance1Name)returnsDB_AIR_All.AIR_SET). Calling this method is equivalent to calling:s7db_id(IInstancesFacade, String, boolean)with the boolean parameter equal to false.Example:
FeedbackOn = instance.getAttributeData("FEDeviceEnvironmentInputs:Feedback On") if FeedbackOn != "": s7db_id_result=self.thePlugin.s7db_id(self.theUnicosProject, FeedbackOn) self.thePlugin.writeInstanceInfo('''$Name$.HFOn:='''+s7db_id_result+FeedbackOn+'''.PosSt;''')- Parameters:
theUnicosProject- Java representation of the UNICOS specifications file.name- Is the name of the instance that we want to process- Throws:
Exception
-
s7db_id
This function provides the symbol name of the DB for a given instance name (e.g.s7db_id(specFile, AIRinstance1Name)returnsDB_AIR_All.AIR_SET). The function will use the same specs. file used in the application to search for the specified instance. Calling this method is equivalent to calling:s7db_id(IInstancesFacade, String, boolean)with the boolean parameter equal to false.Example:
FeedbackOn = instance.getAttributeData("FEDeviceEnvironmentInputs:Feedback On") if FeedbackOn != "": s7db_id_result=self.thePlugin.s7db_id(FeedbackOn) self.thePlugin.writeInstanceInfo('''$Name$.HFOn:='''+s7db_id_result+FeedbackOn+'''.PosSt;''')- Parameters:
name- Is the name of the instance that we want to process- Throws:
Exception
-
s7db_id
public static String s7db_id(research.ch.cern.unicos.utilities.IInstancesFacade theUnicosProject, String name, boolean isDBSimpleRequested) throws Exception This function provides the symbol name of the DB for a given instance name (e.g.s7db_id(specFile, AIRinstance1Name, false)returnsDB_AIR_All.AIR_SET).Note::
- If the flag
isDBSimpleRequestedisTRUE, and - If the specified instance is an
AnalogInputRealor aDigitalInputdevice
DB_<RepresentationName>_All_S.<RepresentationName>_SET.Example:
FeedbackOn = instance.getAttributeData("FEDeviceEnvironmentInputs:Feedback On") if FeedbackOn != "": s7db_id_result=self.thePlugin.s7db_id(self.theUnicosProject, FeedbackOn, false) self.thePlugin.writeInstanceInfo('''$Name$.HFOn:='''+s7db_id_result+FeedbackOn+'''.PosSt;''')- Parameters:
theUnicosProject- Java representation of the UNICOS specifications file.name- Is the name of the instance that we want to processisDBSimpleRequested- TRUE if the DB Simple is requested.- Throws:
Exception
- If the flag
-
s7db_id
This function provides the symbol name of the DB for a given instance name (e.g.s7db_id(specFile, AIRinstance1Name, false)returnsDB_AIR_All.AIR_SET). The function will use the same specs. file used in the application to search for the specified instance.Note:
- If the flag
isDBSimpleRequestedisTRUE, and - If the specified instance is an
AnalogInputRealor aDigitalInputdevice
DB_<RepresentationName>_All_S.<RepresentationName>_SET.Example:
FeedbackOn = instance.getAttributeData("FEDeviceEnvironmentInputs:Feedback On") if FeedbackOn != "": s7db_id_result=self.thePlugin.s7db_id(self.theUnicosProject, FeedbackOn, false) self.thePlugin.writeInstanceInfo('''$Name$.HFOn:='''+s7db_id_result+FeedbackOn+'''.PosSt;''')- Parameters:
name- Is the name of the instance that we want to processisDBSimpleRequested- TRUE if the DB Simple is requested.- Throws:
Exception
- If the flag
-
s7db_id
public static String s7db_id(research.ch.cern.unicos.utilities.IDeviceInstance instance, boolean isDBSimpleRequested) throws Exception This function provides the symbol name of the DB for a given instance name (e.g.s7db_id(Instance1Name, false)returnsDB_AIR_All.AIR_SET).Note:
- If the flag
isDBSimpleRequestedisTRUE, and - If the specified instance is an
AnalogInputRealor aDigitalInputdevice
DB_<RepresentationName>_All_S.<RepresentationName>_SET.- Parameters:
instance- The device instance.isDBSimpleRequested- TRUE if the DB Simple is requested.- Throws:
Exception
- If the flag
-
isLargeApplication
public static boolean isLargeApplication() throws research.ch.cern.unicos.plugins.interfaces.GenerationExceptionGet the value of the class member isLargeApplication @seeinitialize()- Returns:
- The value of the class member 'isLargeApplication' obtained in the method
initialize(). - Throws:
research.ch.cern.unicos.plugins.interfaces.GenerationException
-
getTargetDeviceInformationParam
Get the value of an attribute defined in the TargetDeviceInformation family from the Device type definition.- Parameters:
parameterName- Name of the parameter in the TargetDeviceInformation family.typeName- Device type name.
-