OneWire (FB) ¶ FUNCTION_BLOCK OneWire This function block is the base class for 1-wire devices controlled via the global OneWireMaster instance gOneWireMaster . It is meant to be extended by other function blocks that overload the following methods/properties and replace it with their specific implementation, always including a call of the base implementation with super^.<MethodName>() : AfterReadInputs (reading input data) BeforeWriteOutputs (writing output data) Initialize [optional] (used to read parameters from the configuration) Operational [optional] (used to signal the status of the device) The body of this FB is called by the methods AfterReadInputs and BeforeWriteOutputs , where _xAfterReadInputs indicates the caller. InOut: Scope Name Type Initial Comment Input sDataFile STRING ‘/w1_slave’ name of file that inlcudes the data Properties: DataPath ID Operational Methods: SetIDFromString SetMasterInstance AfterReadInputs BeforeWriteOutputs Initialize Structure: DataPath (Property) ID (Property) SetIDFromString (Method) SetMasterInstance (Method) connector AfterReadInputs (Method) BeforeWriteOutputs (Method) Initialize (Method) status Operational (Property)
OneWire.DataPath (PROP) ¶ PROPERTY DataPath : STRING This property returns the path in the file system that contains the data
OneWire.ID (PROP) ¶ PROPERTY ID : OneWireUniqueID Gets or sets the device ID
OneWire.SetIDFromString (METH) ¶ METHOD SetIDFromString : BOOL allows to set the device ID with a string, that needs to have the format XX-AABBCCDDEEFF return value TRUE indicates that the setting was successful. InOut: Scope Name Type Return SetIDFromString BOOL Input sID STRING
OneWire.SetMasterInstance (METH) ¶ METHOD SetMasterInstance : BOOL with this method the internal pointer to the master device can be set. note: this method can only be applied when the slave device is not part of the device tree (where all this action is done automatically), but manually instanciated. Then, it must be linked to the master instance with this function. InOut: Scope Name Type Return SetMasterInstance BOOL Input pMaster POINTER TO OneWireMaster
connector ¶ AfterReadInputs (Method) BeforeWriteOutputs (Method) Initialize (Method)
status ¶ Operational (Property)
OneWireMaster (FB) ¶ FUNCTION_BLOCK OneWireMaster This function block represents a 1-wire master. Its outputs are set during initialization and give information about the present devices. InOut: Scope Name Type Comment Output uiMaxDevices UINT maximum number of connected devices pasScannedDevices POINTER TO ARRAY [0..19] OF OneWireUniqueID list of scanned devices uiScannedDevices UINT number of scanned devices Properties: Operational Path Methods: AddDevice GetNumberOfSlaves Scan Structure: AddDevice (Method) GetNumberOfSlaves (Method) Operational (Property) Path (Property) Scan (Method)
OneWireMaster.AddDevice (METH) ¶ METHOD AddDevice : BOOL This method adds a slave device to the master’s update list InOut: Scope Name Type Return AddDevice BOOL Input sSlave STRING
OneWireMaster.GetNumberOfSlaves (METH) ¶ METHOD GetNumberOfSlaves : UINT This method returns the number of present devices during the last scan. InOut: Scope Name Type Return GetNumberOfSlaves UINT