The digital outputs of Roboteq controller are open collector type. That means that they can drive any kind of inductive or resistive load, as long as the load consumption does not exceed the 1 A maximum current capacity of the digital outputs. The digital outputs can also be used as a HIGH-LOW state output by connecting a pullup resistor to a voltage of a maximum of 24 V.

 

Digital outputs specs:


Maximum Current

1 A

Maximum Voltage

24 V


Connection examples

 

  •  Inductive loads


A reverse diode should be used in parallel to the load for the flyback effect of the coil 



  • Resistive loads



In both cases the current of the load should be calculated to not exceed the digital output’s capacity.

  • Pullup Resistors

When using a pullup resistor, the voltage measured at point A will have inverted logic. That way, when digital output is enabled, the Voltage level at point A will be LOW, and when the output is disabled, the voltage level at point A will be HIGH.





Output State

Voltage Level

On

Low

Off

High



Interfacing digital outputs



The digital outputs can be configured from the Utility to be activated under specific events.

 



The logic level of the digital output can also be configured to be inverted.


Serial commands


The digital outputs can be controlled with the following serial commands that can be sent also from console tab:


DS - Set all digital output bits

Syntax: !DS nn ,where:

nn = Bit pattern to be applied to all output lines at once

Example:

!DS 03 : will activate outputs 1 and 2. All others are off


DO - Read Digital Output Status

Syntax Serial: ?DO

Example:

Q: ?DO

R: DO=17 : Outputs 1 and 5 active, all others inactive


D1 - Set Individual Digital Out bits 

Syntax Serial: !D1 nn

Where:

nn = Output number

Example:

!D1 1 : will activate output 1


D0 - Reset Individual Digital Out bits

Syntax Serial: !D0 nn

Where:

nn = Output number

Example:

!D0 2 : will deactivate output 2



Controlling Digital outputs through script



The digital outputs can be accessed also through script. The below script example will toggle digital output 3 with period of 1 sec if a button at digital input 1 is pressed. 


Disclaimer:


This script is provided as a sample and has not been validated for any specific use. It is the customer's responsibility to thoroughly test and evaluate the script before using it in any application. We do not assume any liability for errors or issues that may arise from its use. Use at your own risk.



start: 'Main Loop

 

button getvalue(_DI,1'Read the state of digital input 1

 

if button 'If the button is pressed

    

    allOutputs getvalue(_DO,1'Get all outputs state in binary

    

    'E.g. If digital output 3 is High, it will return 4 (0x0100)

    '     If digital output 1 and 3 are High, it will return 5 (0x0101)

    

    output3 allOutputs and 'Mask the digital outputs frame to get only the necessary bit

    

    'Use 1 (0x0001) for output 1

    '    2 (0x0010) for output 2

    '    4 (0x0100) for output 3

    '    8 (0x1000) for output 4

    'etc...

    

    if (output3' If output 3 is high (variable value is higher than 0)

        

        setcommand(_D0,3'Make output 3 low

        

    else

    

        setcommand(_D1,3'Make output 3 high

        

    end if 

    

    wait(500)

    

end if

 

wait(1'main loop period is 1 ma

 

goto start 'jump to start - loop forever