Accessory 27
8 Accessory 27 Test Setup
ACCESSORY 27 TEST SETUP
This test demonstrates how to write and read to from PMAC via Accessory 27.
Following the typical set of M-variable definitions given in the manual, we have:
M200->Y:$FFC1,0,1 ;Thumbwheel Port Input Bit 0
M201->Y:$FFC1,1,1 ;Thumbwheel Port Input Bit 1
M202->Y:$FFC1,2,1 ;Thumbwheel Port Input Bit 2
M203->Y:$FFC1,3,1 ;Thumbwheel Port Input Bit 3
M204->Y:$FFC1,4,1 ;Thumbwheel Port Input Bit 4
M205->Y:$FFC1,5,1 ;Thumbwheel Port Input Bit 5
M206->Y:$FFC1,6,1 ;Thumbwheel Port Input Bit 6
M207->Y:$FFC1,7,1 ;Thumbwheel Port Input Bit 7
M208->Y:$FFC1,8,1 ;Thumbwheel Port Output Bit 0
M209->Y:$FFC1,9,1 ;Thumbwheel Port Output Bit 1
M210->Y:$FFC1,10,1 ;Thumbwheel Port Output Bit 2
M211->Y:$FFC1,11,1 ;Thumbwheel Port Output Bit 3
M212->Y:$FFC1,12,1 ;Thumbwheel Port Output Bit 4
M213->Y:$FFC1,13,1 ;Thumbwheel Port Output Bit 5
M214->Y:$FFC1,14,1 ;Thumbwheel Port Output Bit 6
M215->Y:$FFC1,15,1 ;Thumbwheel Port Output Bit 7
Next, write the following PLC and download to PMAC.
PLC with Logic Statement
open plc1 clear
if (m200=1 and m201=1) ; if input to m200 & m201 set to 1 (or dip switches
m208=0 ; to TB1 pin 1 and TB1 pin 2 set high), outport TB5
m209=0 ; pin 1 & pin 2 set to zero.
else
m208=1 ; if input to m200 & m201 set to 0 (or dip switches
m209=1 ; to TB1 pin 1 and TB1 pin 2 set low), outport TB5
endif ; pin 9 and pin 10 set high
close
Next, make sure the PLC is enabled by typing I5=2.
Accessory 27 I/O Test