Section 2
–
MultiMux Operation and Installation
9
2.6 CR1000 Program Example
'Enable our multiplexer
PortSet (1,1)
'Wait 100mSec for multiplexer to power up
Delay(0,100,MSEC)
'Cycle through 16 channels
For Channel = 1 TO 16
'Set Clock port high to advance mux channel
PortSet(8,1)
'Wait 10mSec for 50% duty cycle
Delay(0,10,MSEC)
'Set Clock port low
PortSet(8,0)
'Wait 10mSec for channel to settle
Delay(0,10,MSEC)
'Read our vibrating wire gage
VibratingWire(MuxChannel(),1,mV7_5,2,VX1,600,3600,500,-1,20000,500,0,1,0)
'Read our YSI44005 type thermistor
BrHalf(ScratchLoc(1),1,mV2500,2,VX1,1,2500,0,1000,250,2.5,0.0)
ScratchLoc(2) = ScratchLoc(1) / 5000
ScratchLoc(3) = (2.5 - (ScratchLoc(2)*1000) - ScratchLoc(1))/ScratchLoc(2)
MuxChannelTemp() = 1/(.0 (.0002369*Log(ScratchLoc(3))) +
(.0000001019*(Log(ScratchLoc(3))^3))) - 273.2
'End of measurement loop
Next
'Disable our multiplexer
PortSet (1,0)
2.7 CR1000 Program Example with VWDSP
See our Application Note #11 for more information on using the VWDSP Interface. This can be found in
the Support area of our website at
www.canarysystems.com
The VWDSP can also originate clocking pulses using it
’
s own port
–
the example below uses C8 of the
control module to provide clocking pulses.
'Enable our VWDSP
PortSet (7,1)
'Wait 125mSec for VWDSP to power up
Delay(0,125,MSEC)
'Open our serial port for VWDSP Communication
SerialOpen (8,1200,0,1000,255)
'Enable multiplexer
SerialOut (8,"M1"+CHR(13),"",0,0)
'Wait 125mSec for multiplexer to power up
Delay(0,125,MSEC)
'Cycle through 16 channels
For Channel = 1 TO 16
'Set Clock port high to advance mux channel
PortSet(8,1)
'Wait 10mSec for 50% duty cycle
Delay(0,10,MSEC)
'Set Clock port low
PortSet(8,0)
'Wait 10mSec for channel to settle
Delay(0,10,MSEC)
'Read our vibrating wire gage using VWDSP
'Short delay
Delay (0,100,mSec)
'Send P configuration command