The text of a manual · part 6 of 9
SYSMAC C200H-AD001/DA001 Analog I/O Units Operation Guide: SECTION 2 - C200H-AD001 Analog Input Unit, pages 29 to 35
Pages 29 to 35 of 61, from SYSMAC C200H-AD001/DA001 Analog I/O Units Operation Guide
The original document is the PDF (608 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Omron C500-AD001
Page 29
Functions and Programming Example
Section 2-3
An example is shown below. Input signal range: 0 to 10 V Lower limit: 1000 Upper limit: 9000 Scaled data Normal data
0V
5V Input signal
10 V
If a 5-V input is received, it would be converted to 2000 (5/10 x 4000) and then scaled as shown below. Scaling data = Note
Resolution
2000 × (9000 – 1000) 4000
+ 1000 = 5000
1. Scaling will not be performed and unscaled (normal) data will be output if the contents of DM words allocated to the Unit is not BCD or if a lower limit is greater than the corresponding upper limit. 2. The Setting Error Flag (bit 00 in IR 1n5, where n is the unit number) will be turned ON if the contents of DM m to DM m+7 is not BCD. 3. The Setting Error Flag will turn ON whenever DM area data is not BCD regardless of whether an input is being used and regardless of whether or not scaling is set. Operation, however, will be normal in these cases. If the difference between an upper limit and the corresponding lower limit (upper limit – lower limit) is 4000 or greater, the resolution is fixed at 1/4000. If the differences is less than 4000, the resolution will be reduced proportionately. For example, if the upper limit minus the lower limit is 2000, the resolution is 1/2000.
2-3-4 Mean Value
Bit 10
09
08
07
Input 4
Input 3
Input 2
Input 1
The mean value function sums a specified number of terms of converted input data and divides by the number of terms preset the DM area. If the Mean ON Bit for an input is ON (bits 07 to 10 of word n), the mean value will be output to the corresponding word in the PC. The desired number of terms must be set in the corresponding word in the DM area between DM m+8 and DM m+11. The setting can be between 0002 and 9999 (BCD).
Word n
21
Page 30
Functions and Programming
Section 2-3
The mean value functions can be used in combination with any of the other functions. Set the mean data for each input with the Programming Console. This data cannot be changed from the user’s program. Set the mean data for all 4 inputs even when using only one input. If there is a mistake in the data for even 1 input, the Setting Error Flag will be activated, though operation will continue. The mean value is calculated using the formula below. When the Mean Enable Bit turns ON, the converted data will read “0000” until the mean value is calculated for the first time.
Mean value =
Sum of converted input values Number of terms (mean data)
The maximum mean function conversion time = 2.5 ms × the sum of the number of terms for all inputs Note
1. Mean value calculation will not be performed and normal data will be output if the number of terms set in the DM area is 0000 or is not BCD. 2. The Setting Error Flag (bit 00 in IR 1n5, where n is the unit number) will be turned ON if the number of terms set in the DM area is 0000 or is not BCD. 3. The Setting Error Flag will turn ON whenever the number of terms set in the DM area is 0000 or is not BCD regardless of whether an input is being used and regardless of whether or not scaling is set. Operation, however, will be normal in these cases.
2-3-5 Peak Value The peak value function holds the maximum output value for every input. This function can be used at the same time an any or all of the other functions. The output value that will be held is one of the following depending on what other functions are set: converted input value, scaled value, mean value, and square root. Data will be processed in the following sequence and the maximum value of the final results will be output to words n+1 to n+4: analog-to-digital conversion → square root → scaling → mean value → peak value. The peak value function is activated for all 4 inputs when the Peak Value ON Bit (IR 1n011, where n is the unit number) is turned ON and reset when it is turned OFF. Note If the Peak Value ON Bit (IR 1n011, where n is the unit number) is turned ON, the peak value will be held for all inputs.
22
Page 31
Functions and Programming Mean and Peak Values
Mean value
Section 2-3
Data will be output as illustrated below when both the mean value and the peak value functions are used. In this example, mean value #2 will be output as the first peak value even if mean value #1 is larger because the Peak Value ON Bit was turned ON after mean value #1 was output.
Mean value #1
Mean value #2
Results #1
Mean value #3
Results #2
Mean value #4
Results #3
Mean value #5
Results #4
ON Peak Value ON Bit
Output value
OFF
Previous mean value
Mean value #1
Mean value #2 (1st peak value)
Larger of mean values #2 and #3
Largest of mean values #2 to #4
2-3-6 Input Disconnection Detection The Input Disconnect Flags will be turned ON when an the input signal level is less than 0.5 V/2 mA and the input signal range is set at 1 to 5 V/4 to 20 mA. These flags will not turn ON when the input signal range is set at 0 to 10 V.
Bit 04
03
02
01
Input 4
Input 3
Input 2
Input 1
The Input Disconnect Flags are contained in in word IR n+5, as shown below.
Word n +5
The BROKEN WIRE indicator on the Analog Input Unit will light whenever any of the Input Disconnect Flags turn ON. Note
1. The Input Disconnect Flags will operate only when the Conversion Inhibit Bit (bit 00 of IR n) is OFF. 2. Input disconnection is detected for all input set on pins 1 and 2 of the backpanel DIP switch. If an input that is not being used (i.e., not connected) is specified on the DIP switch, the Input Disconnect Flag will turn ON. 3. The current peak value will be held even if a disconnected input is detected.
2-3-7 Data Setting Example and Programming Concepts Data Settings The following settings are used in this example. Data in the DM area is set using the SSS, a Programming Console, or another Peripheral Device. Basic Settings
Turn power to the PC off then then back on or turn ON the Special I/O Unit Restart Bit allocated to the Unit (AR 0100 to AR 0109) after setting the data so that the data is read into the Analog Input Unit. Item
Setting
Unit number
0 (allocated words: IR 100 to IR 109 and DM 1000 to DM 1011)
Inputs used
Inputs 1 to 4
23
Page 32
Functions and Programming
Section 2-3
Details Item
Input 4
Input signal range Scaling Lower limit Upper limit Number of terms for mean value calculation
Input 3
Input 2
Input 1
1 to 5 V
4 to 20 mA
1 to 5 V
1 to 5 V
––– ––– –––
0400 1000 50
1000 5000 –––
1000 5000 10
DM Area Data DM word
Contents
Data
DM 1000
1000
Input 1 lower limit for scaling
DM 1001
5000
Input 1 upper limit for scaling
DM 1002
1000
Input 2 lower limit for scaling
DM 1003
5000
Input 2 upper limit for scaling
DM 1004
0400
Input 3 lower limit for scaling
DM 1005
1000
Input 3 upper limit for scaling
DM 1006
0000
Input 4 lower limit for scaling
DM 1007
0000
Input 4 upper limit for scaling
DM 1008
0010
Input 1 number of terms for mean value
DM 1009
0000
Input 2 number of terms for mean value
DM 1010
0050
Input 3 number of terms for mean value
DM 1011
0000
Input 4 number of terms for mean value
Programming The types of programming required to use an Analog Input Unit are described in this section. Refer to the operation manual for the C200H/C200HS/C200HX/ HG/HE for details on programming. Reading Output Data
The converted input value (or the results of calculations performed on it) can be read from the output words IR n+1 to IR n+4, and moved to other words in memory using MOV(21) and/or XFER(70). MOV(21) is used to move one word at a time and XFER(70) is used to move more than one word at a time.
Input condition MOV(21) 101
Moves the output data from IR 101 (input 1) to DM 0001.
DM 0001
Input condition XFER(70) #0004 101 DM 0001
Scaling
24
Moves the output data from IR 101 to IR 104 (inputs 1 to 4) to DM 0001 to DM 0004.
Set 4-digit BCD values for the lower and upper limits for scaling in DM m to DM m+7. These words cannot be written from the program and must be written using a Peripheral Device, such as a Programming Console.
Page 33
Functions and Programming
Section 2-3
For example, use the following procedure to set scaling between 1000 and 5000 for input 1.
1, 2, 3...
1. Set the lower and upper limits in DM 1000 and DM 1001. DM word
Contents
DM 1000
1000
Input 1 lower limit for scaling
Data
DM 1001
5000
Input 1 upper limit for scaling
2. Turn ON IR 10002 (Scaling ON Bit for input 1). Scaling will begin for input 1 as soon as this bit is turned ON. This bit can be changed from the program using the following type of programming. Input condition 10002
Mean Value
Set the 4-digit BCD value for the number of terms for mean value calculation in DM m+8 to DM m+11. The number of terms can be between 2 and 9999. These words cannot be written from the program and must be written using a Peripheral Device, such as a Programming Console. For example, use the following procedure to set mean value calculation for every 10 inputs for input 1.
1, 2, 3...
1. Set the number of terms (10) in DM 1008. DM word
Contents
Data
DM 1008
0010
Number of terms for mean value calculation for input 1
2. Turn ON IR 10007 (Mean Value ON Bit for input 1). Mean value calculations will begin for input 1 as soon as this bit is turned ON. This bit can be changed from the program using the following type of programming. Input condition 10007
Peak Value
The peak value function can be used to hold the maximum output value for all outputs by turn ON the Peak Value ON Bit (IR10011). The peak value will be held individually for all inputs when this bit is turned ON. This bit can be changed from the program using the following type of programming. Input condition 10011
Square Root
The square root function can be used to convert quadratic data to linear data by turn ON the Square Root ON Bit (IR10012). The square root will be calculated individually for all inputs when this bit is turned ON. This bit can be changed from the program using the following type of programming. Input condition 10012
25
Page 34
Troubleshooting
2-4
Section 2-4
Troubleshooting
Detection When Errors Occur
When an error occurs, the contents are output to the SR and HR areas. The following tables show the various errors that may occur, along with their probable causes and remedies.
Unit error
Probable causes and operations
Disconnection error
• Causes of error • Input signal wire is disconnected.
Possible remedies Check the input signal wires, terminal block, and input voltage.
• Input signal range is set to “1 to 5V” but input is 0.5 V or less. • Input signal range is set to “4 to 20 mA” but input is 2 mA or less. • Disconnect indications • BROKEN WIRE indicator is lit. • The Input Disconnect Flag (IR n+5, bits 01 to 04) that corresponds to the erroneous input signal is turned ON (except when the input range is 0 to 10 V). Setting error
The data set in the DM area is wrong. In this case, the Setting Error Flag (IR n+5, bit 00) will be ON.
Check the contents of the data.
Output disabled
The converted data is unstable, as, for example, when the power is first turned on. In this case, the Output Disabled Flag (IR n+5, bit 08) will be ON.
–––
RUN indicator not lit
The RUN indicator on the Unit is not lit even though Replace the Unit. power is turned on to the PC, and none of the errors described in this table are applicable.
CPU error
Probable causes and operations
CPU waiting
Possible remedies
• The Special I/O Unit is defective.
• Replace the Special I/O Unit.
• The PC will not run.
• The defective Unit should appear as $ signs only in the I/O table read operation.
Duplicated unit number One number is assigned to more than one Special I/O Unit. In this case the PC will not run and SR25415 will turn ON.
Do not assign the same number to more than one Unit. Use the I/O table read operation to display unit numbers.
Special I/O Unit error
Check AR 0000 to AR 0009 for the unit number of the Unit in error. After correcting the error, set restart (OFF →ON →OFF) in AR 0100 to AR 0109. If the error does not clear after initialization, replace the Unit.
An error has occurred in the refresh signal between the CPU and the Special I/O Unit. In this case, only the Special I/O Unit stops. SR 25415 is turned ON.
Special I/O Unit Error Detection Bit (SR)
26
Bit
Error
Explanation
Operation status
SR 25415
Duplicated unit number
The same number is assigned to more than one Special I/O Unit.
PC operation stops.
Special I/O Unit error
An error has occurred in the refresh signal between the CPU and the Special I/O Unit
Operation stops only for the faulty Unit.
Page 35
Troubleshooting
Section 2-4
Special I/O Unit Error Flags (AR) Bit
Item
AR 0000 AR 0001 AR 0002 AR 0003 AR 0004 AR 0005 AR 0006 AR 0007 AR 0008 AR 0009
Unit #0 Error Flag Unit #1 Error Flag Unit #2 Error Flag Unit #3 Error Flag Unit #4 Error Flag Unit #5 Error Flag Unit #6 Error Flag Unit #7 Error Flag Unit #8 Error Flag Unit #9 Error Flag
Function When one of the CPU errors described above occurs, the AR bit turns ON for the Unit where the error occurred.
Special I/O Unit Restart Bits (AR) Turn ON the Special I/O Unit Restart Bits in the following circumstances: • After DM data has been set or replaced. • To restart Unit operation after clearing an error. The same effect can be achieved by turning off the power to the PC and then turning it on again. Bit
Item
AR 0100 AR 0101 AR 0102 AR 0103 AR 0104 AR 0105 AR 0106 AR 0107 AR 0108 AR 0109
Unit #0 Restart Bit Unit #1 Restart Bit Unit #2 Restart Bit Unit #3 Restart Bit Unit #4 Restart Bit Unit #5 Restart Bit Unit #6 Restart Bit Unit #7 Restart Bit Unit #8 Restart Bit Unit #9 Restart Bit
Function Special I/O Units can be restarted by turning the corresponding bits ON.
27