User's Manual

PMAC2 User Manual
84 PMAC2 General Purpose I/O Use
PMAC2 Address X Word
Upper 12 Bits
X Word
Lower 12 Bits
Y Word
Upper 12 Bits
Y Word
Lower 12 Bits
$0708 0 0 ANAI08 ANAI00
$0709 1 1 ANAI09 ANAI01
$070A 2 2 ANAI10 ANAI02
$070B 3 3 ANAI11 ANAI03
$070C 4 4 ANAI12 ANAI04
$070D 5 5 ANAI13 ANAI05
$070E 6 6 ANAI14 ANAI06
$070F 7 7 ANAI15 ANAI07
Suggested M-variable definitions for the configuration words are:
M990->X:$0708,0,24,U ; 1st CONFIG_W1 and CONFIG_W2
M991->X:$0709,0,24,U ; 2nd CONFIG_W1 and CONFIG_W2
M992->X:$070A,0,24,U ; 3rd CONFIG_W1 and CONFIG_W2
M993->X:$070B,0,24,U ; 4th CONFIG_W1 and CONFIG_W2
M994->X:$070C,0,24,U ; 5th CONFIG_W1 and CONFIG_W2
M995->X:$070D,0,24,U ; 6th CONFIG_W1 and CONFIG_W2
M996->X:$070E,0,24,U ; 7th CONFIG_W1 and CONFIG_W2
M997->X:$070F,0,24,U ; 8th CONFIG_W1 and CONFIG_W2
Typically, the configuration words are written once, on power up/reset. A good way to do this is in a
PLC program that executes one scan disabling itself. It could look like this:
OPEN PLC 1 CLEAR ; PLC 1 is first to run after power-up/reset
M990=$000000 ; Select ANAI00 and ANAI08 (if present) single-ended
M991=$001001 ; Select ANAI01 and ANAI09 (if present) single-ended
M992=$002002 ; Select ANAI02 and ANAI10 (if present) single-ended
M993=$003003 ; Select ANAI03 and ANAI08 (if present) single-ended
M994=$004004 ; Select ANAI04 and ANAI08 (if present) single-ended
M995=$005005 ; Select ANAI05 and ANAI08 (if present) single-ended
M996=$006006 ; Select ANAI06 and ANAI08 (if present) single-ended
M997=$007007 ; Select ANAI07 and ANAI08 (if present) single-ended
DISABLE PLC 1 ; So will not run again
CLOSE
To set up the configuration words for bipolar analog inputs, the PLC could look like this:
OPEN PLC 1 CLEAR ; PLC 1 is first to run after power-up/reset
M990=$008008 ; Select ANAI00 and ANAI08 (if present) bipolar
M991=$009009 ; Select ANAI01 and ANAI09 (if present) bipolar
M992=$00A00A ; Select ANAI02 and ANAI10 (if present) bipolar
M993=$00B00B ; Select ANAI03 and ANAI08 (if present) bipolar
M994=$00C00C ; Select ANAI04 and ANAI08 (if present) bipolar
M995=$00D00D ; Select ANAI05 and ANAI08 (if present) bipolar
M996=$00E00E ; Select ANAI06 and ANAI08 (if present) bipolar
M997=$00F00F ; Select ANAI07 and ANAI08 (if present) bipolar
DISABLE PLC 1 ; So will not run again
CLOSE
Once this setup has been made, PMAC2 will automatically cycle through the analog inputs, copying the
converted digital values into RAM. These image registers can then be read as if they were the actual A/D
converters. For user program use, the image registers would be accessed with M-variables. Suggested
definitions are: