GetRightBusStatus: Returns the Status of the Expansion Bus

Function Description

This function returns the I/O Expansion Bus status in a bit field. Following the input parameter (Mask), the function returns a configuration diagnostic on the I/O expansion bus (I/O expansion bus configuration mismatch with plugged modules) or a detailed diagnostic of the requested expansion analog I/O module.

Graphical Representation

G-RU-0010344.2.gif-high.gif

 

 

IL and ST Representation

To see the general representation in IL or ST language, refer to the chapter Function and Function Block Representation.

I/O Variables Description

The following table describes the input parameter:

Input

Type

Comment

Mask

RIGHTBUS_GET_STATUS

Defines the type of I/O expansion bus diagnostic returned by the function: bus configuration or one of the 7 possible expansion modules.

NOTE: 16 I/O and 24 I/O controllers support a maximum of 4 expansion modules.

The following table describes the output variable:

Output

Type

Comment

GetRightBusStatus

WORD

I/O expansion bus diagnostic.

see details below

I/O Expansion Bus Configuration Diagnostic

The table below describes the bit field returned by the function GetRightBusStatus when the input parameter (Mask) is RIGHT_BUS_GET_GEN_STATUS for a configuration diagnostic of the expansion bus (0000 hex if no detected error):

Bit

Description

0

Reserved (always 0)

1

TRUE if the TM2/TM2...N module 1 configuration mismatches with plugged module.

2

TRUE if the TM2/TM2...N module 2 configuration mismatches with plugged module.

3

TRUE if the TM2/TM2...N module 3 configuration mismatches with plugged module.

4

TRUE if the TM2/TM2...N module 4 configuration mismatches with plugged module.

5

TRUE if the TM2/TM2...N module 5 configuration mismatches with plugged module.

6

TRUE if the TM2/TM2...N module 6 configuration mismatches with plugged module.

7

TRUE if the TM2/TM2...N module 7 configuration mismatches with plugged module.

8

TRUE if the right bus is blocked.

7...15

Reserved (always 0)

NOTE: Bits 5 to 7 do not apply to 16 I/O and 24 I/O controllers.

TM2...N Analog I/O Expansion Module Diagnostic

The table below describes the bit field returned by the function GetRightBusStatus when the input parameter (Mask) is RIGHTBUS_GET_STATUSx (where x=1 to 7) for a detailed diagnostic of the expansion module "x":

oTM2AMI2HTN

oTM2AMI4HTN

oTM2AMO2HTN

Bit

Description

Meaning

0

5 V power supply of an analog input expansion module

0: Power supply is normal

1: No power

1

5 V power supply of an analog output expansion module

0: Power supply is normal

1: No power

2

+15 V power supply of an analog output expansion module

0: Power supply is normal

1: No power

3

Output of channel 0 of an output expansion module

0: No error detected

1: Error detected

4

Output of channel 1 of an output expansion module

0: No error detected

1: Error detected

5

Analog output channel 1

0: Within range

1: Out of range

6

Analog output channel 2

0: Within range

1: Out of range

7

Reserved

 

TM2 Analog I/O Expansion Module Diagnostic

The tables below describe the bit field returned by the function GetRightBusStatus when the input parameter (Mask) is RIGHTBUS_GET_STATUSx (where x=1 to 7) for a detailed diagnostic of the expansion module "x".

NOTE: The detailed diagnostic is valid for analog I/O modules only and the bit field meaning depends on the type of the concerned analog module.

When the associated module is a standard analog I/O module (up to 2 input channels):

oTM2AMM3HT

oTM2ALM3LT

oTM2AMI2HT

oTM2AMI2LT

oTM2AVO2HT

oTM2AMO1HT

Bit

Description

0

All analog channels in normal state

1

Module in initialization state

2

Power supply not operating correctly

3

Incorrect configuration - analysis needed

4

Conversion process for input channel 0

5

Conversion process for input channel 1

6

Invalid parameter for input channel 0

7

Invalid parameter for input channel 1

8

Not used

9

Not used

10

Overflow value for input channel 0

11

Overflow value for input channel 1

12

Underflow value for input channel 0

13

Underflow value for input channel 1

14

Not used

15

Invalid parameter for output channel

When the associated module is one of the 4 or 8 analog input channels modules:

oTM2ARI8HT

oTM2AMI8HT

oTM2ARI8LT

oTM2ARI8LRJ

oTM2AMI4LT

oTM2AMM6HT

Bit

Description

Meaning

0, 1

Channel 0 state

00: Analog channel in normal state

01: Invalid parameter for input channel

10: Unavailable input value (module in initialization state, conversion process)

11: Invalid value for input channel (overflow or underflow value)

2, 3

Channel 1 state

see bit 0, 1

4, 5

Channel 2 state

see bit 0, 1

6, 7

Channel 3 state

see bit 0, 1

8, 9

Channel 4 state

see bit 0, 1 (for 8 input channels modules only)

10, 11

Channel 5 state

see bit 0, 1 (for 8 input channels modules only)

12, 13

Channel 6 state

see bit 0, 1 (for 8 input channels modules only)

14, 15

Channel 7 state

see bit 0, 1 (for 8 input channels modules only)

Example

The following example describes a method using GetRightBusStatus for I/O expansion bus and analog modules diagnostic:

VAR
  (*Modules 1 to 7 conf diag = MyRightBusStatus bits 1 to 7*)
  MyRightBusStatus: WORD;
  (*Modules 1 to 7 diag codes*)
  ModuleError:Array [1..7] of WORD;
END_VAR
 

(*Conf diagnostic on expansion bus*)
MyRightBusStatus:=GetRightBusStatus
(RIGHTBUS_GET_GEN_STATUS);
 

IF MyRightBusStatus<>0 THEN
(*Conf mismatch detected => set an alarm, check bit values...*)
END_IF;
 

(*Get modules diagnostic; detected error if diag <> 0*)
(*Limit the list to analog modules configured only*)
ModuleError[1]:=GetRightBusStatus(RIGHTBUS_GET_STATUS1);
ModuleError[2]:=GetRightBusStatus(RIGHTBUS_GET_STATUS2);
ModuleError[3]:=GetRightBusStatus(RIGHTBUS_GET_STATUS3);
ModuleError[4]:=GetRightBusStatus(RIGHTBUS_GET_STATUS4);
ModuleError[5]:=GetRightBusStatus(RIGHTBUS_GET_STATUS5);
ModuleError[6]:=GetRightBusStatus(RIGHTBUS_GET_STATUS6);
ModuleError[7]:=GetRightBusStatus(RIGHTBUS_GET_STATUS7);