This documentation is out of date.

The new version of the documentation is here: https://cannylogic.com/docs

Difference between revisions of "CANNY 5.2 duo, Discrete IO Driver"

From CANNY Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
(Digital output mode)
Line 177: Line 177:
 
An example of a functional diagram performing every second, alternate switching of electrical potentials from + 12V (1mA) to GND (120 mA) at controller terminals, corresponding to channels #8 & #9.
 
An example of a functional diagram performing every second, alternate switching of electrical potentials from + 12V (1mA) to GND (120 mA) at controller terminals, corresponding to channels #8 & #9.
  
[[Изображение:14_6_3_1.png]]
+
[[File:14_6_3_1.png]]
  
 
{|
 
{|
|valign="top" style="padding-left:0.5em;"|'''ВНИМАНИЕ!'''
+
|valign="top" style="padding-left:0.5em;"|'''ATTENTION!'''
|valign="top" style="padding-left:0.5em;"|'''В отличие от CANNY 7, каналы CANNY 5.2 duo не имеют автоматической интеллектуальной защиты от короткого замыкания или перегрузки. Цепи каналов защищены лишь токоограничительными сгораемыми резисторами (см. схемы). Во избежание выхода каналов из строя, избегайте прямого подключения каналов с включенным выходным потенциалом GND к силовым цепям положительной полярности либо организуйте программную защиту канала в диаграмме!'''
+
|valign="top" style="padding-left:0.5em;"|'''Unlike [[CANNY 7]] channels CANNY 5.2 duo are not have intellectual protection against short-circuit or overload. channel circuits are protected by a current-limiting resistors combustible (see. circuit diagram). To avoid output channels down, avoid direct connection channels with the included output potential GND to the power circuits of positive polarity or организуйте программную защиту канала в диаграмме!'''
 
|}
 
|}
  
Каналы возвращают значение «1» в регистре своего входного значения, если на соответствующем контакте контроллера установился электрический потенциал «GND»; и возвращает значение «0» в регистре входного значения, когда на соответствующем контакте контроллера установился электрический потенциал «+12В».
+
The channel returns a value of "1" in its input value register, if on the appropriate controller pin establishes an electrical potential "GND"; and returns the value "0" to input value register, if on the appropriate controller pin establishes an electrical potential "+ 12 V".  
  
Изменение потенциала на контактах каналов №№8 и 9 приведет к немедленному автоматическому выходу контроллера из режима пониженного энергопотребления при нахождении контроллера в нём.
+
Change potential on the channel pin #8 & #9, will result in immediate automatic exip controller from hibernation.
  
 
Каналы контроллера в режиме дискретного входа работают с максимальной чувствительностью, т.е. «защита от дребезга» не предусмотрена и должна быть реализована, при необходимости, в функциональной диаграмме.
 
Каналы контроллера в режиме дискретного входа работают с максимальной чувствительностью, т.е. «защита от дребезга» не предусмотрена и должна быть реализована, при необходимости, в функциональной диаграмме.
  
Пример функциональной диаграммы, включающей встроенный зеленый светодиод контроллера при поступлении и удержании в течение не менее 200мс на соответствующем каналу №8 контакте контроллера, потенциала GND:
+
An example of a functional diagram, switching-on a built-in green LED with the flow and hold for at least 200ms at the appropriate pin of channel №8, the potential GND:
  
[[Изображение:14_6_3_2.png]]
+
[[File:14_6_3_2.png]]
 
+
=== PWM output mode ===
+
 
+
The channel configured for operation in PWM output, generates on the corresponding controller pin a pulse width signal of a predetermined polarity, frequency, and duty cycle. In this mode, the channel is asynchronous to functional diagram, which allows for greater stability of generated timing signal, than in the organization of PWM generator by functional diagram resources.
+
 
+
[[File:6_6_5_1.png|center]]
+
 
+
Channel configuration for operation in this mode is determined by a constant, representing a combination of parameters that determine the electrical potential and current to the terminal in the active "ON" and passive "OFF" generating phase, corresponding channel of the controller, and a pair of numeric values defining the frequency and filling generating pulses in milliseconds.
+
 
+
{|border="1" style="border-collapse:collapse;" align="left" width="100%"
+
|- align="center" valign="top"
+
!width="250px"|Parameter
+
!Acceptable values
+
|- valign="top"
+
|Channel type
+
|PWM output.
+
|- valign="top"
+
|"ON"
+
|plus (1mA); PLUS (100mA); minus (1mA); MINUS (100mA);air.
+
|- valign="top"
+
|"OFF"
+
|plus (1mA); PLUS (100mA); minus (1mA); MINUS (100mA);air.
+
|}
+
 
+
Named constants that represent channels configuration parameters combination available to the user, contains in the "DIO Channel Configuration" CannyLab constants directory, which can be accessed via function block entry context menu having a type of "constant".
+
 
+
To transfer controller channel in to PWM output mode it is necessary:
+
*to copy value constant,  corresponding to the selected mode into selected channel address "DIO Mode IO Channel ##";
+
*to copy digital value 0 to 65565, setting generated pulses period in ms into selected channel address "DIO Period IO Channel ##" ;
+
*to copy digital value 0 to 65565, setting generated pulses duty cycle in ms into selected channel address "DIO Output IO Channel ##" ;
+
 
+
An example of a functional diagram performing every second, alternate switching of electrical potentials from + 12V (100mA) to GND (1 mA) at controller terminal, corresponding to channel #0.
+
 
+
[[File:6_6_5_2.png|center]]
+
 
+
=== Digital input mode ===
+
 
+
The channel, configured to operate as a digital input, returns a value of "1" in its input value register, if on the appropriate controller pin establishes an electrical potential corresponding to the "Input polarity" state; and returns the value "0" to input value register, if on the appropriate controller pin establishes an electrical potential not corresponding to the "Input polarity" state.
+
 
+
Channel configuration for operation in this mode is determined by a constant, representing a combination of parameters that determine the electrical potential at the terminal accepted for the state of "1" of corresponding controller channel, the existence and potential of internal controller pin  "pull-up",  sensitivity and channel activity in a low power mode of the controller.
+
 
+
{|border="1" style="border-collapse:collapse;" align="left" width="100%"
+
|- align="center" valign="top"
+
!width="250px"|Parameter
+
!Acceptable values
+
|- valign="top"
+
|Channel type
+
|Digital Input.
+
|- valign="top"
+
|Input polarity
+
|PLUS; MINUS.
+
|- valign="top"
+
|Pull-up
+
|plus; minus; air.
+
|- valign="top"
+
|Standby mode
+
|active; passive.
+
|- valign="top"
+
|Sensitivity
+
|max (0 ms); high (20 ms); norm (200 ms); low (700 ms).
+
|}
+
 
+
Change potential  on the channel pin is in the active standby mode, will result in immediate automatic exip controller from hibernation. Change potential  on the channel pin is in the active standby mode, will result in immediate automatic exip controller from hibernation. Change potential  on the channel pin is in the passive standby mode, does not affect controller power consumption.
+
 
+
Channel sensitivity  determines its "bounce protection", ie the time interval during which the electrical potential on the corresponding channel pin  should remain unchanged, in order to be considered a set and change channel input value.
+
 
+
Named constants that represent channels configuration parameters combination available to the user, contains in the "DIO Channel Configuration" CannyLab constants directory, which can be accessed via function block entry context menu having a type of "constant".
+
 
+
To transfer controller channel into Digital Input mode it is necessary to copy value constant, corresponding to the selected mode into channel address "DIO Mode IO Channel ##".
+
 
+
An example of a functional diagram, switching-on a built-in green LED with the flow and hold for at least 200ms at the appropriate pin of channel №0, the potential GND:
+
 
+
[[File:6_6_6_1.png|center]]
+
 
+
=== Counter mode ===
+
The channel configured for operation of a counter, returns a number to its output value register, corresponding to the number of electric potential switching on the corresponding controller pin from the state opposite of the parameter "Input Polarity" into the state of the parameter "Input Polarity" for the last time a given duration. Thus, the channel in this mode functions as a counter  of the signal rising edges or frequency meter.
+
 
+
In this mode, the channel is asynchronous to functional diagram, which allows for greater accuracy in determining the time parameters of the signal and measure higher frequency signal than in the organization of pulse counter by functional diagram resources.
+
 
+
Channel configuration for operation in this mode is determined by a constant, is parameters combination  that determine the electrical potential when it appears at the controller channel corresponding  pin registers the rising edge of a signal, presence and potential of internal "pull-up".
+
 
+
Channel Configuration for operation in this mode is given by the combination of the following parameters:
+
 
+
{|border="1" style="border-collapse:collapse;" align="left" width="100%"
+
|- align="center" valign="top"
+
!width="250px"|Parameter
+
!Acceptable values
+
|- valign="top"
+
|Channel type
+
|Input-Counter.
+
|- valign="top"
+
|Input polarity
+
|PLUS; MINUS.
+
|- valign="top"
+
|Pull-up
+
|plus; minus; air.
+
|}
+
 
+
In the counter mode, the channel is always in active standby with maximum sensitivity. Counting the number of state changes of this channel is carried out asynchronously.
+
 
+
Named constants that represent channels configuration parameters combination available to the user, contains in the "DIO Channel Configuration" CannyLab constants directory, which can be accessed via function block entry context menu having a type of "constant".
+
 
+
To transfer controller channel into Counter mode it is necessary:
+
*to copy value constant, corresponding to the selected mode into selected channel address "DIO Mode IO Channel ##";
+
*to copy digital value 0 to 65565, setting pulses counting period in ms into selected channel address "DIO Period IO Channel ##";
+
 
+
With a value of none-zero in the period register, the value in the input value register of a channel is updated once a period and contains the number of pulses registered by the counter in the intervening period.
+
 
+
Counting the pulse by the counter is conducted with overflow. This means that when the value of 65565 reached and subsequent increases by one, the counter value is set to zero, but each subsequent pulse again increments the counter by one.
+
 
+
An example of a functional diagram of a tachometer with a resolution of 100 RPM, count the number of pulses on the controller pin corresponding  to channel №0:
+
 
+
[[File:6_6_7_1.png|center]]
+
 
+
{|
+
|valign="top" style="padding-left:0.5em;"|''Note:''
+
|valign="top" style="padding-left:0.5em;"|''If the period is set to zero, the counter continuously counts pulses with result accumulation in the register of the channel output value. In this mode, the value of this register is reset only by register overflow .''
+
|}
+
  
 
=== Equivalent circuit diagrams ===
 
=== Equivalent circuit diagrams ===
Line 346: Line 228:
 
|}
 
|}
 
<br clear="all">
 
<br clear="all">
 
=== Electrical protection ===
 
 
For channels operated in a digital output and PWM output modes, whose current in "ON" or "OFF" state significantly exceeds 100 mA, controller system software performs automatic short circuit protection. Protection implemented as the form of switching of a shorted channel into the neutral mode, the subsequent periodic pulse of start test and reset to a user-defined configuration upon detection elimination of short circuit. This protection is fully automatic and requires no user configuration.
 
  
 
== See also ==
 
== See also ==
 
[[CANNY 5.2 duo]]
 
[[CANNY 5.2 duo]]

Revision as of 16:54, 21 December 2016

Genegal Description

CANNY 5.2 duo users have access to three discrete general purpose IO channels. Each channel is physically available through corresponding pins of X3 connectors. Writing and reading data of the respective drivers registers, the functional diagram can manage the electric potential in each of these contacts and getting information about the current potential of each of them. The channel physical characteristics allow connection to various external low-voltage control circuit, or using an external protection diode, small electromagnetic relays. As an external digital signal controller capable of managing the work may use mechanical, electromechanical, and electronic buttons and switches, pulse generators, sources 0-12V voltage, the transistor outputs of various equipment, etc.

Channels operation mode and parameters specified by function diagram. At any given time, the channel can only work in one of the possible modes, but it is possible to dynamically override the channel configuration from the functional diagram.

ATTENTION! Unlike CANNY 7 channels CANNY 5.2 duo are not have intellectual protection against short-circuit or overload. channel circuits are protected by a current-limiting resistors combustible (see. circuit diagram). To avoid output channels down, avoid direct connection channels with the included output potential GND to the power circuits of positive polarity!

IO Registers

The parameters defining operation mode and channel current state, are set for each channel independently. Below is acceptable values specifications of registers controlling input-output channels operation in all major modes.

Register Expected values
DIO Output Value Register, IO Cannel 8
DIO Output Value Register, IO Cannel 9
DIO Output Value Register, IO Cannel 10
In Digital Input mode:
0...65535 = the value is ignored;
In Digital Output mode:
≥ 1 = set at the appropriate controller pin, the electric potential specified by this channel configuration for status "ON";
0 = set at the appropriate controller pin, the electric potential specified by this channel configuration for status «OFF»;
DIO Input Active Wait / Raising Edges Counter Enable Register, IO Channel 8
DIO Input Active Wait / Raising Edges Counter Enable Register, IO Channel 9
DIO Input Active Wait / Raising Edges Counter Enable Register, IO Channel 10
In Digital Output mode:
0...65535 = the value is ignored;
In Digital Input mode:
≥ 1 = set the appropriate controller pin to the active mode / turn on counter mode - react to potential changes to the respective contact controller / to count the number of potential changes from the state "OFF" to state "ON";
0 = set the appropriate controller pin to normal mode of operation as a digital input.

Registers control IO channels driver are divided into containing information of the IO driver altogether and containing information about the state of each channel individually. The following describes registers control driver return values of IO channels in all major operation modes.

Register Return values
DIO Input Activity Detect Register
1 = during the last execution cycle of a functional diagram, registered the change of the electric potential in any controller pin respective to a channel which is configured as an active input or pulse counter; or register values of output channels either input-counters were changed by a diagram;
0 = for the last functional diagram execution cycle, changes on active controller inputs or changes in the values of drivers' registers is not found.
DIO Input Valve Register, IO Channel 8
DIO Input Valve Register, IO Channel 9
DIO Input Valve Register, IO Channel 10
In Digital Input or Output mode:
1 = at the appropriate controller pin established electric potential corresponding to the polarity of the channel in the "ON" mode;
0 = at the appropriate controller pin established electric potential corresponding to the polarity of the channel in the "OFF" mode;
DIO Input Counter Valve, IO Channel 8
DIO Input Counter Valve, IO Channel 9
DIO Input Counter Valve, IO Channel 10
In Input Counter mode:
0...65535 = the number of pulses registered in the appropriate controller pin after activation counter mode;
In Other mode:
0 = always 0.


Channel neutral state

При включении контроллера, все силовые выходные элементы каналов находятся в выключенном состоянии. На контактах контроллера соответствующих каналам 8 и 9 устанавливаются потенциал 12В/1мА на контакте соответствующем каналу 10 — очень слабый отрицательный потенциал («воздух»).

Работа с каналами из пользовательской диаграммы

При записи ненулевого значения в регистр выходного значения канала на соответствующем контакте контроллера установится электрический потенциал «GND» 120мА, а при записи значения «0», потенциал соответствующий состоянию канала в момент запуска контроллера (см.выше).

Примечание: В любой момент времени, вне зависимости от состояния выхода канала возможно получить значение, соответствующее фактическому текущему электрическому потенциалу на контакте данного канала, что позволяет организовать обратную связь и, при необходимости, реализовать программную защиту от перегрузки канала.

An example of a functional diagram performing every second, alternate switching of electrical potentials from + 12V (1mA) to GND (120 mA) at controller terminals, corresponding to channels #8 & #9.

14 6 3 1.png

ATTENTION! Unlike CANNY 7 channels CANNY 5.2 duo are not have intellectual protection against short-circuit or overload. channel circuits are protected by a current-limiting resistors combustible (see. circuit diagram). To avoid output channels down, avoid direct connection channels with the included output potential GND to the power circuits of positive polarity or организуйте программную защиту канала в диаграмме!

The channel returns a value of "1" in its input value register, if on the appropriate controller pin establishes an electrical potential "GND"; and returns the value "0" to input value register, if on the appropriate controller pin establishes an electrical potential "+ 12 V".

Change potential on the channel pin #8 & #9, will result in immediate automatic exip controller from hibernation.

Каналы контроллера в режиме дискретного входа работают с максимальной чувствительностью, т.е. «защита от дребезга» не предусмотрена и должна быть реализована, при необходимости, в функциональной диаграмме.

An example of a functional diagram, switching-on a built-in green LED with the flow and hold for at least 200ms at the appropriate pin of channel №8, the potential GND:

14 6 3 2.png

Equivalent circuit diagrams

Equivalent circuit diagrams for each possible state of the input-output channel shown in the table below:

Channel state Equivalent circuit diagram
«air»
6 6 9 1.png
«plus (1mA)»
6 6 9 2.png
«PLUS (100mA)»
6 6 9 3.png
«minus (1mA)»
6 6 9 4.png
«MINUS (100mA)»
6 6 9 5.png
«pull up air»
6 6 9 6.png
«pull up plus»
6 6 9 7.png
«pull up minus»
6 6 9 8.png


See also

CANNY 5.2 duo