Unit_AnalogInput_FP0_A80

Function block to read from an FP0-A80 unit.

This function block reads converted digital values from the analog input channels of the analog unit. The converted digital values are stored per channel in the output variables iInChannel0 to iInChannel7.

Parameters

Input

iIOWordOffset (INT)

Set the offset of the first WX/WY address of the analog unit according to its installation position.

For analog expansion units connected directly to the CPU (without adapter): Use ExpansionUnitToIOWordOffset_FP0 or make the following settings: 2 (WX2/WY2) for unit number 1, 4 (WX4/WY4) for unit number 2, 6 (WX6/WY6) for unit number 3

For analog expansion units connected to the CPU via an adapter: Use ExpansionUnitToIOWordOffset_FPX_FP0 or select the offset from the table.

Unit position relative to the adapter

Adapter position relative to the CPU

1st unit

2nd unit

3rd unit

4th unit

5th unit

6th unit

7th unit

8th unit

1st unit

30

40

50

60

70

80

90

100

2nd unit

32

42

52

62

72

82

92

102

3rd unit

34

44

54

64

74

84

94

104

Output

iInChannel0 to iInChannel7 (INT)

Returns the converted digital data from the analog unit by channel.

Values:
  • For 0 to 5V, 0 to 20mA : 0 to 4000 (depending on wiring method)
  • For -10 to +10V, -100 to +100mV: -2000 to +2000

DIP switch settings

The DIP switch settings will become effective when the power is turned from OFF to ON.

Input range:
 

0 to 5V, 0 to 20mA

-10 to +10V

-100 to +100mV

Number of channels:
 

2 (0 and 1)

4 (0 to 3)

6 (0 to 5)

8 (0 to 7)

Input averaging:

No averaging: Conversion data is set for the specified input contact point area for each A/D conversion, on each channel.

Averaging: On each channel, for each A/D conversion, the maximum and minimum values from the data of the last ten times are excluded, the data from the other eight times is averaged and the result is set.

 

No averaging

Averaging

Input wiring

Voltage input

Current input

Connect the input instrument between the V and the COM terminals.

Connect the V and the I terminals. Connect the input instrument between the bridge and the COM terminal.

Conversion characteristics

-10V to +10V DC input

0V to 5V DC input

-100mV to +100mV DC input

0mA to 20mA input

Digital value (INT)

Analog value

Digital value (INT)

Analog value

Digital value (INT)

Analog value

Digital value (INT)

Analog value

-2000

-10.0V

0

0.0V

-2000

-100.0mV

0

0.0mA

-1500

-7.5V

400

0.5V

-1500

-75.0mV

800

4.0mA

-1000

-5.0V

800

1.0V

-1000

-50.0mV

1600

8.0mA

-500

-2.5V

1200

1.5V

-500

-25.0mV

2400

12.0mA

0

0.0V

1600

2.0V

0

0.0mV

3200

16.0mA

+500

+2.5V

2000

2.5V

+500

+25.0mV

4000

20.0mA

+1000

+5.0V

2400

3.0V

+1000

+50.0mV

 

+1500

+7.5V

2800

3.5V

+1500

+75.0mV

+2000

+10.0V

3200

4.0V

+2000

+100.0mV

 

3600

4.5V

 

40000

5.0V

Tip

This command description provides basic hardware documentation only. For detailed technical information, consult the manual:

FP0 A/D Converter Unit Technical Manual

Example

POU header

All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.

VAR
	Inst_FP0_A80: Unit_AnalogInput_FP0_A80;
	iInChannel0: INT:=0;
	iInChannel1: INT:=0;
	iInChannel2: INT:=0;
	iInChannel3: INT:=0;
	iInChannel4: INT:=0;
	iInChannel5: INT:=0;
	iInChannel6: INT:=0;
	iInChannel7: INT:=0;
END_VAR

LD body

Use ExpansionUnitNumberToIOWordOffset_FP0 or ExpansionUnitNumberToIOWordOffset_FPX_FP0 to calculate the word offset of the analog unit connected to the CPU.

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 11 ;
        NETWORK_BODY
B(B_FB,Unit_AnalogInput_FP0_A80!,Unit_AnalogInput_FP0_A80_FB,25,1,38,11,,?BiIOWordOffset?AiInChannel0?AiInChannel1?AiInChannel2?AiInChannel3?AiInChannel4?AiInChannel5?AiInChannel6?AiInChannel7);
B(B_VARIN,,1,3,2,5,4,);
B(B_VAROUT,,iInChannel0,38,2,40,4,);
B(B_VAROUT,,iInChannel1,38,3,40,5,);
B(B_VAROUT,,iInChannel2,38,4,40,6,);
B(B_VAROUT,,iInChannel3,38,5,40,7,);
B(B_VAROUT,,iInChannel4,38,6,40,8,);
B(B_VAROUT,,iInChannel5,38,7,40,9,);
B(B_VAROUT,,iInChannel6,38,8,40,10,);
B(B_VAROUT,,iInChannel7,38,9,40,11,);
B(B_F,ExpansionUnitNumberToIOWordOffset_FP0!,,5,1,25,4,,?DiExpansionUnitNumber?C);
L(1,0,1,11);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

Inst_FP0_A80(iIOWordOffset := 2,
	iInChannel0 => iInChannel0,
	iInChannel1 => iInChannel1,
	iInChannel2 => iInChannel2,
	iInChannel3 => iInChannel3,
	iInChannel4 => iInChannel4,
	iInChannel5 => iInChannel5,
	iInChannel6 => iInChannel6,
	iInChannel7 => iInChannel7);

Modified on: 2024-06-21Feedback on this pagePanasonic hotline