[r2]: / trunk / legacy / Libraries / OneWire_DS18B20.library.xml  Maximize  Restore  History

Download this file

234 lines (234 with data), 9.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://www.plcopen.org/xml/tc6_0200">
<fileHeader companyName="" productName="CODESYS" productVersion="CODESYS V3.5 SP11" creationDateTime="2018-07-16T11:54:05.9004452" />
<contentHeader name="Raspberry 1-wire DS18B20" version="1.3.0.0" modificationDateTime="2015-11-24T04:28:44" organization="3S - Smart Software Solutions GmbH" author="3S - Smart Software Solutions GmbH">
<Comment>Library containing device support for DS18B20 under Raspberry Pi</Comment>
<coordinateInfo>
<fbd>
<scaling x="1" y="1" />
</fbd>
<ld>
<scaling x="1" y="1" />
</ld>
<sfc>
<scaling x="1" y="1" />
</sfc>
</coordinateInfo>
<addData>
<data name="http://www.3s-software.com/plcopenxml/projectinformation" handleUnknown="implementation">
<ProjectInformation>
<property name="Author" type="string">3S - Smart Software Solutions GmbH</property>
<property name="Company" type="string">3S - Smart Software Solutions GmbH</property>
<property name="DefaultNamespace" type="string">DS18B20</property>
<property name="Description" type="string">Library containing device support for DS18B20 under Raspberry Pi</property>
<property name="Placeholder" type="string">PlaceholderTemplate</property>
<property name="Project" type="string">OneWire_DS18B20</property>
<property name="Released" type="boolean">false</property>
<property name="Title" type="string">Raspberry 1-wire DS18B20</property>
<property name="Version" type="version">1.3.0.0</property>
<property name="library-category-list" type="library-category-list" />
</ProjectInformation>
</data>
</addData>
</contentHeader>
<types>
<dataTypes />
<pous>
<pou name="OneWire_DS18B20" pouType="functionBlock">
<interface>
<outputVars>
<variable name="rTemp">
<type>
<REAL />
</type>
</variable>
<variable name="stdTimeStamp">
<type>
<derived name="RTS_SYSTIMEDATE" />
</type>
</variable>
<variable name="xSignalOk">
<type>
<BOOL />
</type>
</variable>
</outputVars>
<addData>
<data name="http://www.3s-software.com/plcopenxml/pouinheritance" handleUnknown="implementation">
<Inheritance>
<Extends>OneWire</Extends>
</Inheritance>
</data>
</addData>
</interface>
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml">super^();</xhtml>
</ST>
</body>
<addData>
<data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
<Method name="AfterReadInputs">
<interface>
<returnType>
<INT />
</returnType>
<documentation>
<xhtml xmlns="http://www.w3.org/1999/xhtml"> This method can be overloaded by extending FBs.
It is used to read in the inputs of the device in the beginning of the cycle.
Always including a call of the base implementation with super^.AfterReadInputs()
In the base implementation, the body of the FB is called.</xhtml>
</documentation>
</interface>
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml">Evaluate();
SUPER^.AfterReadInputs();
</xhtml>
</ST>
</body>
<addData />
</Method>
</data>
<data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
<Method name="Evaluate">
<interface>
<localVars>
<variable name="fr">
<type>
<derived name="FileReader" />
</type>
</variable>
<variable name="hFile">
<type>
<derived name="RTS_IEC_HANDLE" />
</type>
</variable>
<variable name="result">
<type>
<derived name="RTS_IEC_RESULT" />
</type>
</variable>
<variable name="udiRead">
<type>
<UDINT />
</type>
</variable>
<variable name="sPath">
<type>
<string />
</type>
</variable>
<variable name="sData">
<type>
<string />
</type>
</variable>
<variable name="i">
<type>
<INT />
</type>
</variable>
</localVars>
<addData>
<data name="http://www.3s-software.com/plcopenxml/attributes" handleUnknown="implementation">
<Attributes>
<Attribute Name="conditionalshow" Value="" />
</Attributes>
</data>
</addData>
</interface>
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml">IF _pMaster &lt;&gt; 0 THEN
sPath := DataPath;
hFile := SysFileOpen(sPath, ACCESS_MODE.AM_READ, ADR(result));
IF hFile &lt;&gt; RTS_INVALID_HANDLE THEN
fr(hFile := hFile);
IF fr.GetLine(ADR(sData), SIZEOF(sData)) AND LEN(sData) &gt; 3 THEN
IF RIGHT(sData, 3) = 'YES' THEN
xSignalOk := TRUE;
ELSE
xSignalOk := FALSE;
END_IF
ELSE
xSignalOk := FALSE;
END_IF
IF xSignalOk THEN
IF fr.GetLine(ADR(sData), SIZEOF(sData)) THEN
i := FIND(sData, 't=');
IF i &gt; 0 THEN
sData := RIGHT(sData, LEN(sData) - i - 1);
IF sData = '85000' THEN
xSignalOk := FALSE;
ELSE
rTemp := STRING_TO_REAL(sData) * 1E-3;
SysTimeRtcConvertUtcToDate(SysTimeRtcGet(result), stdTimeStamp);
END_IF
ELSE
xSignalOk := FALSE;
END_IF
END_IF
END_IF
ELSE
xSignalOk := FALSE;
END_IF
SysFileClose(hFile);
END_IF
</xhtml>
</ST>
</body>
<addData />
</Method>
</data>
<data name="http://www.3s-software.com/plcopenxml/property" handleUnknown="implementation">
<Property name="Operational">
<interface>
<returnType>
<BOOL />
</returnType>
<documentation>
<xhtml xmlns="http://www.w3.org/1999/xhtml"> This property has to return TRUE, when the device is configured and running</xhtml>
</documentation>
</interface>
<GetAccessor>
<interface>
<addData>
<data name="http://www.3s-software.com/plcopenxml/attributes" handleUnknown="implementation">
<Attributes>
<Attribute Name="hide" Value="" />
</Attributes>
</data>
</addData>
</interface>
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml">Operational := xSignalOk;</xhtml>
</ST>
</body>
<addData />
</GetAccessor>
<addData />
</Property>
</data>
</addData>
</pou>
</pous>
</types>
<instances>
<configurations />
</instances>
<addData>
<data name="http://www.3s-software.com/plcopenxml/libraries" handleUnknown="implementation">
<Libraries>
<Library Name="#Standard" Namespace="Standard" HideWhenReferencedAsDependency="false" PublishSymbolsInContainer="false" SystemLibrary="false" LinkAllContent="false" DefaultResolution="Standard, * (System)" />
<Library Name="#IoStandard" Namespace="IoStandard" HideWhenReferencedAsDependency="false" PublishSymbolsInContainer="false" SystemLibrary="false" LinkAllContent="false" DefaultResolution="IoStandard, * (System)" />
<Library Name="#Raspberry Pi Peripherals" Namespace="Raspi" HideWhenReferencedAsDependency="false" PublishSymbolsInContainer="false" SystemLibrary="false" LinkAllContent="false" DefaultResolution="Raspberry Pi Peripherals, * (3S - Smart Software Solutions GmbH)" />
<Library Name="#SysFile" Namespace="SysFile" HideWhenReferencedAsDependency="false" PublishSymbolsInContainer="false" SystemLibrary="false" LinkAllContent="false" DefaultResolution="SysFile, * (System)" />
<Library Name="#SysTimeRtc" Namespace="SysTimeRtc" HideWhenReferencedAsDependency="false" PublishSymbolsInContainer="false" SystemLibrary="false" LinkAllContent="false" DefaultResolution="SysTimeRtc, * (System)" />
<Library Name="SysTypes Interfaces, * (System)" Namespace="SysTypes" HideWhenReferencedAsDependency="false" PublishSymbolsInContainer="false" SystemLibrary="false" LinkAllContent="false" />
<addData />
</Libraries>
</data>
</addData>
</project>