Created
February 17, 2020 18:33
-
-
Save aeciolevy/c5cc51a7209099500d417ea58bc3fe2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const net = require('net'); | |
const client = net.createConnection({ host: '192.168.7.2', port: 9999 }); | |
const delay = time => new Promise(resolve => setTimeout(resolve, time)); | |
client.on('data', (data) => { | |
data = data.toString().trim(); | |
console.log('data received: ', data); | |
}); | |
(async function main() { | |
client.write('estop/status'); | |
await delay(2000); | |
client.write('estop/trigger/request'); | |
await delay(5000); | |
client.write('estop/release/request'); | |
await delay(2000); | |
client.write('estop/systemreset/request'); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment