Instruction manual

AM16/32 Relay Analog Multiplexer
20
'CR5000 Example Program to measure 16 100 ohm Platinum Resistance Thermometers ‘connected to an
AM16/32 multiplexer used in the 4x16 configuration. The program also ‘measures 6 copper constantan
'thermocouples.
'The Thermocouples are connected to differential channels 1-6.
'Declare Variables:
Public TRef, TCTemp(6), PRTResist(16), PRTTemp(16)
Dim I 'Counter for setting Array element to correct value for mux measurement
'Declare Output Table for 15 minute averages:
DataTable (Avg15Min,1,-1)
DataInterval (0,5,Min,10)
Average (1,TRef,IEEE4,0)
Average (6,TCTemp(),IEEE4,0)
Average (16,PRTTemp(),IEEE4,0)
EndTable
BeginProg
Scan (60,Sec,3,0)
PanelTemp (TRef,250)
TCDiff (TCTemp(),6,mV20C ,1,TypeT,TRef,True ,0,250,1.0,0)
Portset (1 ,1) 'Set C1 high to Enable Multiplexer
I=0
SubScan(0,sec,16)
'Pulse C2 (Set High, Delay, Set Low) to clock multiplexer
Portset (2,1 )
Delay (0,20,mSec)
Portset (2,0)
I=I+1
'The Resistance measurement measures the PRT resistance:
Resistance (PRTResist(I),1,mV50,7,Ix1,1,500,True ,True ,0,250,0.01,0)
'With a multiplier of 0.01 (1/100) the value returned is R/Ro (Resist/Resist @ 0 deg)
'the required input for the PRT temperature calculation instruction.
NextSubScan
Portset (1 ,0) 'Set C1 Low to disable Multiplexer
‘Calculate the Temperature from R/Ro:
PRT (PRTTemp(1),16,PRTResist(1),1.0,0)
CallTable Avg15Min‘Call the DataTable
NextScan
EndProg
5.3.2 CR1000 Programming
The following CR1000 program uses the AM16/32 to measure 48
CS616 probes connected in the 4x16 configuration. The program also
measures datalogger battery voltage and temperature.