Power PMAC Clipper User Manual
Connections and Software Setup
34
Note
The explicit address register(s) can be found by subtracting
Sys.piom
from
Clipper[0].Chan[0].AdcEnc[n].a
(n=0-3).
Note
The ADC input data must be in the “unpacked” format to be read
properly;
Clipper[0].Chan[0].PackInData = 0
.
Raw ADC Data (in bits)
Sys.WpKey = $AAAAAAAA;
// Disable Write-Protection
Clipper[
0
].Chan[
0
].PackInData =
0
;
// Unpack Input Data all ADCs J3, J7
PTR
ADCIN_1->S.
IO
:$900030.20.12;
// ADCIN_1 J3 [bits]
PTR
ADCIN_2->S.
IO
:$900034.20.12;
// ADCIN_2 J3 [bits]
PTR
ADCIN_3->S.
IO
:$900038.20.12;
// ADCIN_3 J7 [bits]
PTR
ADCIN_4->S.
IO
:$90003C.20.12;
// ADCIN_4 J7 [bits]
Alternately use of bit shifting in PLC and Program with the structure,
Clipper[0].Chan[0].AdcEnc[n]
, as in:
Bit shifting example
// This method is most efficient and uses the least PMAC resources
GLOBAL
MyAnalog1 = 0;
// Global variable for shifted analog value initialized to zero
OPEN
PLC
ExamplePLC
. . .
MyAnalog1 = Clipper[
0
].Chan[
0
].AdcEnc[0] >> 20;
// shift right by 20 bits before assignment
. . .
CLOSE
Since the analog inputs have 12 bits of resolution (4,096 software counts) spanning over the full range of
the input voltage, wiring a ±10V voltage produces the following counts in software:
Single-Ended
[VDC]
Software
Counts
-10
-2048
0
0
10
+2048
Scaled ADC Data (in volts)
For general purpose usage, the ADC data (reported in bits) can be easily scaled and converted into “user”
voltage. In the example PLC below:
The global parameter
ADCnZeroOffset
represents the voltage offset with a zero volt input. This
is user adjustable.
The pointer
ADCIN_n
reports the raw ADC data in software counts, units of 12-bit (±2048).
Содержание Power PMAC Clipper
Страница 5: ......
Страница 30: ...Power PMAC Clipper User Manual Connections and Software Setup 30...