Node.js port of aktos-dcs
library (v2).
git init app && cd app
git submodule add https://github.com/aktos-io/aktos-dcs-node dcs
./dcs/update.sh --all
- Create
app/hello-world.ls
:
require! './dcs': {Actor, sleep}
# create a Hello process
new class Hello extends Actor
action: ->
<~ :lo(op) ~>
@log.log "hello!"
<~ sleep 1000ms
lo(op)
# create a World process
new class World extends Actor
action: ->
<~ :lo(op) ~>
@log.log "world!"
<~ sleep 2000ms
lo(op)
- Run:
$ lsc ./app/hello-world.ls
[01:16:56.880] 257f4bea-8f2f-4 : hello!
[01:16:56.884] 45e37675-6ec5-4 : world!
[01:16:57.886] 257f4bea-8f2f-4 : hello!
[01:16:58.885] 45e37675-6ec5-4 : world!
[01:16:58.887] 257f4bea-8f2f-4 : hello!
[01:16:59.888] 257f4bea-8f2f-4 : hello!
If you see the above output, then everything should be okay.
- For more examples, See dcs-nodejs-examples.
aktos-dcs-node
provides following transport and connectors:
- Serial Port Transport
- CouchDB
- SocketIO (Server + Client)
- TCP (Server + Client)
- Omron
- Hostlink
- FINS
- Siemens
- S7 Comm
- Raspberry
- Digital Input
- Digital Output