195 Set value IEC data type |
195 Set value IEC data type |
196 @param data_type: Value IEC data type |
196 @param data_type: Value IEC data type |
197 """ |
197 """ |
198 self.DataType = data_type |
198 self.DataType = data_type |
199 |
199 |
200 def NewValue(self, tick, value, forced=False, raw="BOOL"): |
200 def NewValues(self, tick, values, raw="BOOL"): |
201 """ |
201 """ |
202 Function called by debug thread when a new debug value is available |
202 Function called by debug thread when a new debug value is available |
203 @param tick: PLC tick when value was captured |
203 @param tick: PLC tick when value was captured |
204 @param value: Value captured |
204 @param value: Value captured |
205 @param forced: Forced flag, True if value is forced (default: False) |
205 @param forced: Forced flag, True if value is forced (default: False) |
206 @param raw: Data type of values not translated (default: 'BOOL') |
206 @param raw: Data type of values not translated (default: 'BOOL') |
207 """ |
207 """ |
|
208 value, forced = values |
|
209 |
208 # Translate value to IEC literal |
210 # Translate value to IEC literal |
209 if self.DataType != raw: |
211 if self.DataType != raw: |
210 value = TYPE_TRANSLATOR.get(self.DataType, str)(value) |
212 value = TYPE_TRANSLATOR.get(self.DataType, str)(value) |
211 |
213 |
212 # Store value and forced flag when value update is inhibited |
214 # Store value and forced flag when value update is inhibited |