Sets and gets the values of the digital input and output channels.
Signal.DIO(channel, count)=<new_value>
-or-
... Signal.DIO(channel, count)
Prerequisites
None
Parameters
channel
A required numeric expression that specifies the first digital channel to be accessed. Signal numbers are organized into ranges based on the signal type. Within those ranges, the signals are organized into banks of 96 I/O points. The bank numbers start at 0. A signal number is formed by adding the signal base value to 100 times the bank number. In a distributed servo network, general digital I/O signals on the slave controllers may be accessed from the master controller by adding 100000 times the slave controller node number to the signal number.
count
An optional numeric expression that specifies the number of successive digital channels to be accessed. The value may range from 1 to 32. If omitted, only a single channel is accessed and the property value is a Boolean. If specified, the property value is a numeric bit mask. Omitting the count parameter is not the same as specifying a count of 1. If multiple channels are specified, all channels within the range signal to signal+count-1 must be valid.
Remarks
When specifying DIO signal (channel) numbers, a positive base signal number indicates that the signal is True if its logical level is high. A negative base signal number indicates that the signal is True if its logical level is low. For example, if the channel is 10001, the signal is True if the input is at a logic high level. If the channel is –10001, the signal is True if the input is at a logic low level.
Only an output DIO signal can be written. The current values of both input and output signals can be read. If count is specified, the DIO specified by channel corresponds to bit 0 of the property value. channel+1 corresponds to bit 1, channel+n corresponds to bit n, where n < count. Table 19-76 shows the possible signal numbers based on the type and the bank.
| Signal Type | Signal Base | Signal Range | Banks |
|---|---|---|---|
|
Test |
0 |
0 |
|
|
General |
1 |
1 + 100*bank |
0 = Local outputs, |
|
Dedicated |
8001 |
8001 + 100*bank |
0 = Controller outputs, |
|
General |
10001 |
10001 + 100*bank |
0 = Local inputs, |
|
Dedicated |
18001 |
18001 + 100*bank |
0 = Controller inputs, |
|
Software I/O |
20001 |
20001 - 20064 |
Not used |
|
Reserved |
21001 |
21001 - 100000 |
|
|
Servo Network node n general |
100000*n + 13 |
100000*n + 20 |
0 = Local outputs only |
|
Servo Network node n general |
100000*n + 10001 |
100000*n + 10012 |
0 = Local inputs only |
|
Servo Network node n dedicated inputs and outputs |
|
|
Slave controller dedicated IO cannot be accessed by the master controller |
Table 19-77 describes the different types of digital IO signals:
| DIO Type | Description |
|---|---|
|
Test |
Channel 0 is a special test value that always reads False no matter what value is written to it. |
|
General |
These are the “user” DIO signals that are provided in the controller or remote I/O boards. They do not have a predefined use and can be freely employed. In some cases, general DIO may be configured to serve as dedicated IO. For example, a general DIO can be configured as a joint over-travel limit. |
|
Dedicated |
The dedicated DIO are pre-defined to fixed machine control functions such as a home sensor. Some of these signals are assigned to specific pins. However, others can be mapped to General DIO pins. |
|
Software |
These “soft” IO do not drive or read actual hardware output or input signals. They can be used as semaphores between threads or in place of hardware DIO for testing control algorithms. |
Please consult the hardware specification for your specific version of controller for information on the maximum number of input and output channels of each type available on your system
Examples
Dim semaphore As Boolean
Signal.DIO(20001) = True ' Sets soft signal 20001 to True
semaphore = Signal.DIO(-20001) ' Will set semaphore value to False
Signal.DIO (20001) = 4 ' Sets soft signal 20001 to True
' since 4 is non-zero.
Signal.DIO (20001, 1) = 4 ' Sets soft signal 20001 to False
Signal.DIO (20001, 3) = 4 ' Sets soft signal 20001 to False
' and soft signal 20002 to False
' and soft signal 20003 to True
See Also