Data Sheet
dScript
dScript User Manual v2.15
Digital I/O
All Digital I/O such as relays, led's, general purpose I/O or virtual I/O are declared with the
digitalport declaration. See module documentation for specific details of the port numbers.
Examples:
digitalport Rly1 1
digitalport Rly2 2
digitalport LedBlue 32
digitalport LedGreen 33
digitalport LedRed 34
digitalport Flag1 100
digitalport Flag2 101
To output to the port just write:
Rly1 = on
LedBlue = on
Rly2 = off
Flag1 = on
There are 64 virtual I/O ports in the range 100 to 163. These are not associated with any real
I/O port, they exist only in the modules memory. Flag1 and Flag2 above are examples of
virtual I/O. They are useful to hold the state of remote I/O, of just as flags to control program
flow.
Analogue I/O
All Analogue inputs are declared with the analogport declaration. See Module documentation
for specific details of the port numbers.
Examples:
analogport TS2 2 ; ext temp sensor
analogport TS1 100 ; on-board temp sensor
analogport PSU 101 ; DC power voltage
Analogue ports do not store any values, so each time you refer to the port a new analogue to
digital conversion is performed.
var Volts
Volts = PSU
Will convert analogue channel PSU and store the result in the variable Volts.
Copyright © 2016, Devantech Ltd.
All rights reserved.
www.robot-electronics.co.uk
17