550 561 04

 

Digital Output Channel

This section provides full details about the structure and contents of a Digital Output Channel.

 

RegNo.

Identifier

MEMORY TYPE

Read Out

Type

SI unit

0

FlagReg

RAM Read Write

Binary

Bit8

---

1

IOTimer

RAM Read Write

Decimal

Real

S

2

Counter

RAM Auto Save

Decimal

LongInteger

---

3

OutCurrent

RAM Read only

Decimal

Real

A

4

Operatingtime

RAM Auto Save

Decimal

Real

S

5

 

 

 

 

 

6

MinMaxCurTimer

RAM Read Write

Decimal

Real

S

7

InputPreset

RAM Init EEPROM

Decimal

Real

S

8

OutputPreset

RAM Init EEPROM

Decimal

Record

S

9

ChConfig

EEPROM RPW

------

Record

---

10

 

 

 

 

 

11

MinMaxCurrent

EEPROM RPW

Decimal

Record

---

12

 

 

 

 

 

13

Maintenance

EEPROM RPW

------

Record

---

14

ChType

PROM Read Only

------

Record

---

15

CHError

RAM Read only

Binary

Record

---

 

Channel Register Structure and Function

 

RegNo. 0: FlagReg

 

 

FlagReg:

Bit8;

 

 

7

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0: Not used

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1: Error

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2: Not used

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3: Control

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4: Not used

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5: Not used

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6: InFlag

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7: OutFlag

 

 

 

 

 

 

 

 

 

 

The FlagReg can be accessed as one Byte or as individual bits.

 

Bit 1: Error

The purpose of the Error bit is to indicate an error condition on the channel (overload, underload and hardware errors). Error = TRUE, indicates ChError.Act <> 0.

 

Bit 3: Control

The Control flag is used to control special functions (see ChConfig.Functions). After a power-up or a reset of the module, the Control flag is FALSE. If ChConfig.Functions is set to Input mode or Input hold mode the Control flag follows the InFlag.

 

Bit 6: InFlag

The input flag is controlled by the input detector, and shows the logic level on the input terminals. The input flag is true, when the input is ON. If the channel is used as an output, the input flag will follow the output flag. If the output terminals are short-circuited, the input flag will not follow the output flag. The input signal can be simulated, by setting the channel into input simulation mode (ChConfig.Enablebit[0] = TRUE) and subsequently writing the state to the input flag. The input flag is FALSE after a reset in simulation mode.

 

Bit 7: OutFlag

This flag shows the logic level on the digital output. When OutFlag is TRUE, the output is

ON.

 

A P-NET transmission can control the OutFlag if the ChConfig.Function is set to Output

Mode. In other cases, the OutFlag is controlled by the special output function, and the OutFlag is treated as a read only bit from P-NET.

 

After a power-up or a reset of the module, OutFlag is FALSE.

 

 

RegNo. 1: IOTimer [s]

 

 

IOTimer:

Real;

 

 

Each channel has a timer, used with the special functions. The timer is either pre­set via P‑NET, or from the OutputPreset.OnPreset / PTPreset  registers, depending on which function is selected for the channel. The timer counts down. The count continues through negative values. The timer register is cleared after a power failure.

 

 

RegNo. 2: Counter

 

 

Counter:

LongInteger;

 

 

The counter counts the number of pulses at the input. The counter counts up to a maximum of 2147483647 (a LongInteger). When the counter exceeds +2147483647, it re-starts at -2147483648. On a rising edge at the input the counter increments by one.

 

 

RegNo. 3: OutCurrent [A]

The OutCurrent register indicates the value of the current in the output load.

 

 

OutCurrent:

Real;

 

 

 

RegNo. 4: Operatingtime [s]

 

 

Operatingtime:

Real;

 

 

This variable totalises the time period during which InFlag is True.

 

 

RegNo. 6: MinMaxCurTimer [s]

 

 

MinMaxCurTimer:

Real;

 

 

The MinMaxCurTimer is used to disable current control for a short period after the output is switched on. control together with the MinMaxCurrent. The MinMaxCurTimer is preset from OutputPreset.MinMaxCurPreset when the output is set. The timer counts down, and continues through negative values. As long as the value of the timer is positive, current control is disabled. Refer to MinMaxCurrent for a precise function description.The timer register is cleared after a power failure.

 

 

RegNo. 7: InputPreset[s]

 

 

InputPreset:

Real;

Only PD 621 ver. 1.11 or higher

 

This register holds the preset value for the IOTimer when the channel is in Input hold mode, Input delay mode or Input edge detect mode.

 

 


RegNo. 8: OutputPreset [s]

This register holds the preset Values for the IOTimer and the preset value for the MinMaxCurrentTimer. The preset values are passed to the timer by the special functions.

The IOPreset variable is a record having the following structure:

 

Record

 

OnPreset:

Real;

 

 

PTPreset:

Real;

 

 

MinMaxCurPreset:

Real;

 

End;

 

The function of OnPreset and PTPreset is described under ChConfig.

 

The function of the MinMaxCurPreset is described under MinMaxCurrent and MinMaxCurTimer. The value of MinMaxCurPreset should not exceed 2 seconds if the value of MaxCurrent exceeds 1 A.

 

 

RegNo. 9: ChConfig

The ChConfig variable is a record having the following structure:

 

Record

 

Enablebit:

Bit8;

 

 

Functions:

BYTE;

 

 

Notification:

Bit8;

 

 

ControlledbyChannel:

BYTE;

Only PD 621 ver. 1.11 or higher

End;

 

where each field is interpreted as follows:

 

Enablebit:

         

7

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0: InputSimulation

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1: Output controlled by other channel

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2: Not used

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3: Not used

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4: Not used

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5: UnderLoadAlarm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6: NoOverLoadAlarm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7: Not used

 

 

 

 

 

 

 

 

 

 

InputSimulation must be used with the utmost care because whenever simulation mode is deselected, the input will remain in the state the user left it, regardless of the actual signal level on the input. The real input level can only be detected again after a reset, or following a positive or negative input change, because the input state is based on edge detection.

 

Functions:

 

 

= 0

=> Input mode

 

 

= 1

=> Input hold mode

Only PD 621 ver. 1.11 or higher

 

= 2

=> Output mode

 

 

= 3

=> Follow mode

 

 

= 4

=> Toggle output

 

 

= 5

=> One shot output

 

 

= 6

=> Duty-Cycle output

 

 

= 7

=> Input delay mode

Only PD 621 ver. 1.11 or higher

 

= 8

=> Input edge detect mode

Only PD 621 ver. 1.11 or higher

 

 

Input mode.

InFlag and Control bits are controlled by the input detector, and show the logic level on the input terminals.

 

Input hold mode. (Only PD 621 ver. 1.11 or higher)

The IOTimer is preset from InputPreset on a rising edge at the input.

 

 

Output mode.

The output can be controlled by writing to OutFlag from P-NET.

 

Follow mode.

The output follows the Control flag.

 

Toggle output.

Precise Function description:

 

After reset:

FlagReg[Control]:= False; FlagReg[OutFlag]:= False;

 

 

IF FlagReg[Control] THEN

(* Write to Control flag from P-NET *)

 

FlagReg[OutFlag]:= NOT FlagReg[OutFlag]

ELSE

 

 

 

 

FlagReg[OutFlag]:= False;

 

END;

 

 

 

One shot output.

If the Control flag is set to True, the output will be set True for a period equal to the value of OutputPreset.OnPreset. The time can be varied by reloading the IOTimer. The Output is reset if the Control flag is set to False.

 

Precise Function description:

 

After reset: FlagReg[Control]:= False; FlagReg[OutFlag]:= False;

 

IF FlagReg[Control] THEN

(*Write to IOTimer from P-NET *)

 

BEGIN

 

 

 

IOTimer := OutputPreset.OnPreset;

 

 

IF IOTimer > 0 THEN

 

 

 

FlagReg[Outflag]:= True;

 

END;

 

 

 

 

IF FlagReg[Control] THEN

(*Write to IOTimer from P-NET *)

 

IF IOTimer < 0 THEN

 

 

 

FlagReg[OutFlag]:= False

 

ELSE

 

 

 

FlagReg[OutFlag]:= True;

 

 

 

 

 

LOOP

 

 

 

IF FlagReg[Control] THEN

 

 

 

IF IOTimer < 0 THEN

 

 

 

 

FlagReg[OutFlag]:= False;

END;

 

 

 

Duty-cycle Output.

This function can produce a variable duty-cycle output. The On time is specified in OutputPreset.OnPreset and the total period in OutputPreset.PTPreset.

 

Precise Function description:

 

After reset: FlagReg[Control]:= False; FlagReg[OutFlag]:= False;

 

IF FlagReg[Control] THEN

 (*Write to Control flag from P-NET *)

BEGIN

 

IOTimer := OutputPreset.OnPreset;

 

IF IOTimer > 0 THEN

 

FlagReg[Outflag]:= True;

END;

 

 

 

 

LOOP

 

 

 

IF (FlagReg[Control]) AND (IOTimer <= 0) THEN

 

BEGIN

 

 

 

IF FlagReg[OutFlag] THEN

 

 

BEGIN

 

 

 

FlagReg[OutFlag]:= False;

 

 

 

IOTimer := OutputPreset.PTPreset - OutputPreset.OnPreset;

 

 

END

 

 

ELSE

 

 

BEGIN

 

 

 

FlagReg[OutFlag]:= True;

 

 

 

IOTimer := OutputPreset.OnPreset;

 

 

END;

 

END;

 

END;

 

 

 

Input delay mode. (Only PD 621 ver. 1.11 or higher)

By using this function, it is possible to specify a time delay between when an input is detected on the input terminal and when the InFlag and Control flags are set True.

 

Input delay mode provides a filter on the input that ensures that the InFlag is only set True if the signal is stable during the entire period when the IOTimer is decrementing towards zero. This mode also avoids the counter being incremented if the input is ON for a shorter period of time than that specified in the InputPreset register.

 

Precise Function description:

 

 

 

Input edge detect mode. (Only PD 621 ver. 1.11 or higher)

This function will cause the IOTimer to be preset when a positive edge is detected on the input terminal. The IOTimer will decrement down to zero, and this can be used to trigger the output on another channel. As shown below, the IOTimer cannot be preset again until its value reaches zero or contains a negative value.

 

When InputPreset is <= 0, one or more outputs in the module that are pointing to this input can be activated immediately or delayed by a positive time specified in InputPreset.

 

 

Precise Function description:

 

 

 

Notification:

 

7

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0: ChangeInChErrorAct

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1: Not used

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2: FallingEdgeOnControl

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3: RisingEdgeOnControl

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4: FallingEdgeOnInFlag

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5: RisingEdgeOnInFlag

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6: FallingEdgeOnOutFlag

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7: RisingEdgeOnOutFlag

 

 

 

 

 

 

 

 

 

 

A bit in the Notification register in the Service Channel will be set if the condition described for any bit that is set in this Notification field has been met. The Notification bit number in the Service Channel register will correspond with the channel number that detected the condition.

 

ControlledbyChannel: (Only PD 621 ver. 1.11 or higher)

The value inserted in this field defines (points to) the channel number that is to control this channel when it is configured as an output.

 

The table below shows which output functions that can be controlled by other functions.

 

        Output

Input

Output

mode

Follow

mode

Toggle

output

One shot

output

Duty cycle output

Input mode

 

 

 

X

 

X

 

X

 

 

Input hold mode

 

 

X

 

X

 

X

 

Input delay mode

 

 

X

 

X

 

X

 

Input edge detect mode

 

 

 

X

 

X

 

 

 

 

 

 

 

Output

mode

 

 

X

 

 X

 

X

 

Follow

mode

 

 

X

 

 X

 

X

 

Toggle

output

 

 

X

 

 X

 

X

 

One shot

output

 

 

X

 

X

 

X

 

Duty cycle output

 

 

X

 

X

 

X

 

 

 

RegNo. 11:  MinMaxCurrent

This variable is a record having the following structure:

 

RECORD

(* Factory setting: *)

 

MinCurrent:

REAL;

(* 0.0 *)

 

MaxCurrent:

REAL;

(* 1.0 *)

END;


 

MinCurrent:

This variable defines the minimum permitted current in the load when the output is ON. If OutCurrent is less than MinCurrent when the output is ON and the MinMaxCurTimer < 0, an error can be generated. Error-code generation is enabled by setting ChConfig.­Enablebit[5] TRUE (underload alarm).

 

Precise Function description:

 

IF (OutCurrent < MinMaxCurrent.MinCurrent) AND (FlagReg[OutFlag])

 

AND (MinMaxCurTimer < 0) AND (ChConfig.EnableBit[5]) THEN

BEGIN

 

 

 

ChError.Act[UnderLoad] := True;

 

ChError.His[UnderLoad] := True;

END

 

 

ELSE

 

 

 

ChError.Act[UnderLoad] := False;

 

MaxCurrent:

If OutCurrent exceeds MaxCurrent and MinMaxCurTimer < 0, the output is switched off and an error is generated. For applications in which it is normal to let the max. cur­rent switch the output off, the error-code generation can be disabled, by setting ChConfig.­Enablebit[6] TRUE (no overload alarm). Any output current > 2 Amp switches the output off instantly.

 

Precise Function description:

 

IF ((OutCurrent>MinMaxCurrent.MaxCurrent) AND (FlagReg[OutFlag])

 

AND (MinMaxCurTimer < 0)) OR (OutCurrent > 2.0) THEN

BEGIN

 

 

 

FlagReg[OutFlag]:= False;

 

 

FlagReg[Control]:= False;

 

IF NOT ChConfig.EnableBit[6] THEN

 

BEGIN

 

 

 

ChError.Act[OverLoad] := True;

 

 

ChError.His[OverLoad] := True;

 

END;

 

END

 

ELSE

 

 

ChError.Act[OverLoad] := False;

 

 


RegNo. 13: Maintenance

The Maintenance variable is used for service management and maintenance purposes, and holds the last date of service (Date, Month, Year), and an indication of the type of service (Category).

 

Maintenance is a Record having the following structure:

 

RECORD;

 

Date:

BYTE;

 

 

Month:

BYTE;

 

 

Year:

BYTE;

 

 

Category:

BYTE;

 

End;

 

 

RegNo. 14: ChType

For the digital I/O channels, ChType is a record having the following structure:

 

RECORD

 

ChannelType:

WORD;

 

 

Exist:

Bit16;

 

 

Functions:

Bit16;

 

End;

 

ChType has the following value:

 

ChannelType = 15

 

Exist =

15

 

 

 

 

 

 

 

7

 

 

 

 

 

 

0

1

1

1

0

1

0

1

1

0

1

0

1

1

1

1

1

 

Functions =

15

 

 

 

 

 

 

 

7

 

 

 

 

 

 

0

 

 

0

0

0

0

0

0

0

1

1

1

1

1

1

1

1

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0: InputMode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1: InputHoldMode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2: OutputMode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3: FollowMode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4: ToggleOutput

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5: OneShotOutput

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6: DutyCycleOutput

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7: InputDelayMode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

8: InputEdgeDetectMode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RegNo. 15: CHError

 

Record

 

His:

Bit8;

 

 

Act:

Bit8;

 

End;

 

The 8 bits in Error.His and CHError.Act have the following meaning:

When an error occurs, the corresponding bit is set in both Error.His and Error.Act. When the error disappears, the bit is cleared in ChError.Act. The corresponding bit in ChError.His remains set until it is read, whereupon it is cleared automatically. See summary for how ChError.His can be cleared in particular M36 slave modules.

 

7

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0: Not used

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1: Not used

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2: InternalDisconnection

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3: InternalShortCirError

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4: ExternalShortCirError

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5: UnderLoad

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6: Overload

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7: ModuleError

 

 

 

 

 

 

 

 

 

 

 

Bit 7

ModuleError. If this bit is set, the rest of the bits have no meaning because a module error can cause random error codes on the individual channels (see also "Service channel").

Bit 6

OverLoad is set if the current in the output load exceeds MaxCurrent. The Overload alarm can be disabled (ChConfig.Enablebit[6]).

Bit 5

UnderLoad is set if the load is disconnected (OutCurrent < MinCurrent). The UnderLoad alarm can be enabled by setting ChConfig.Enablebit[5] TRUE.

Bit 4

ExternalShortcirError is set if an external short circuit error is detected (InFlag=1 and OutFlag=0). The error bit cannot be set on channels configured as input.

Bit 3

InternalShortCirError is set if the output transistor is short-circuited.

Bit 2

InternalDisconnection is set if the output transistor is disconnected (Out­Flag=1 and InFlag = 0 and NOT overload).