Skip to content

Commit

Permalink
Merge 70fd5cc into ca03b0c
Browse files Browse the repository at this point in the history
  • Loading branch information
joyja committed Apr 26, 2020
2 parents ca03b0c + 70fd5cc commit 3556d70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/device/ethernetip.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { Model } = require(`../database`)
const { Controller, Tag } = require('ethernet-ip')
const logger = require(`../logger`)

class EthernetIP extends Model {
static async initialize(db, pubsub) {
Expand Down Expand Up @@ -99,7 +100,9 @@ class EthernetIPSource extends Model {
}
async read() {
if (this.ethernetip.connected) {
await this.ethernetip.client.readTag(this.tagData)
await this.ethernetip.client.readTag(this.tagData).catch((error) => {
logger.error(error)
})
await this.tag.setValue(this.tagData.value, false)
}
}
Expand Down

0 comments on commit 3556d70

Please sign in to comment.