Campbell Scientific AVW200 AVW200-series Vibrating Wire Interfaces - Page 57

AVW200( ) Instruction Running in the Sequential Mode, 12p-p Volt Excite

Page 57 highlights

AVW200-series 2-Channel Vibrating Wire Spectrum Analyzer Modules ' Example Program running in the PipeLine mode ' The clock and reset lines of both muxes are connected to the clk and rst 'lines of the AVW200. PipeLineMode Public PTemp, batt_volt Public Result, AVWDst(32,6) Const Chan1 = 1 Const Chan2 = 2 Const MuxChan = 1 Const Reps = 16 Const BFreq = 450 Const EFreq = 6000 Const Xvolt = 2 ' AVW200 channel 1 ' AVW200 channel 2 ' Starting Mux Channel ' Number of Reps ' Begin Frequency ' End Frequency ' 12p-p Volt Excite BeginProg SerialOpen (Com1,38400,0,0,0) Scan (64,Sec,0,0) ' (2 * 32 measurement) = 64 seconds PanelTemp (PTemp,250) Battery (Batt_volt) AVW200(Result,Com1,200,200,AVWDst(1,1),Chan1,MuxChan,Reps,Bfreq,Efreq,Xvolt,_60Hz,1,0) AVW200(Result,Com1,200,200,AVWDst(17,1),Chan2,MuxChan,Reps,Bfreq,Efreq,Xvolt,_60Hz,1,0) NextScan EndProg 7.4 AVW200( ) Instruction Running in the Sequential Mode Examples 7.4.1 and 7.4.2 run the AVW200 with a CR1000 using multiple AVW200( ) instructions in a sequential mode of operation. In these example programs, the first AVW200( ) instruction communicates with the attached AVW200 interface module using Com1 and PakBus address 200, and tells the AVW200 to make sixteen measurements. The CR1000 will wait at the AVW200( ) instruction until the 16 measurements are returned from first instruction, or until the instruction times out (time out is two times the number of reps). If an instruction times out, it will try up to three more times before advancing to the next instruction. The next AVW200 instruction on channel 2 is then executed and repeats the process. Each AVW200() instruction in the examples uses a different result code variable. In sequential mode, it is a good idea to have different result code variables for each AVW200( ) instruction. NOTES (1) When running in the sequential mode, programs that contain multiple AVW200 instructions using the same COM port should have different "Result" variables for each AVW200 instruction (e.g. "Result1" and "Result2") in order to detect and isolate any communications errors for a given AVW200. (2) If the AVW200( ) instruction is in a slowsequence, the mode of operation is always forced to sequential mode. 49

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112

AVW200-series 2-Channel Vibrating Wire Spectrum Analyzer Modules
' Example Program running in the PipeLine mode
' The clock and reset lines of both muxes are connected to the clk and rst ‘lines of the AVW200.
PipeLineMode
Public PTemp, batt_volt
Public Result, AVWDst(32,6)
Const Chan1 = 1
' AVW200 channel 1
Const Chan2 = 2
' AVW200 channel 2
Const MuxChan = 1
' Starting Mux Channel
Const Reps = 16
' Number of Reps
Const BFreq = 450
' Begin Frequency
Const EFreq = 6000
' End Frequency
Const Xvolt = 2
' 12p-p Volt Excite
BeginProg
SerialOpen (Com1,38400,0,0,0)
Scan (64,Sec,0,0)
' (2 * 32 measurement) = 64 seconds
PanelTemp (PTemp,250)
Battery (Batt_volt)
AVW200(Result,Com1,200,200,AVWDst(1,1),Chan1,MuxChan,Reps,Bfreq,Efreq,Xvolt,_60Hz,1,0)
AVW200(Result,Com1,200,200,AVWDst(17,1),Chan2,MuxChan,Reps,Bfreq,Efreq,Xvolt,_60Hz,1,0)
NextScan
EndProg
7.4
AVW200( ) Instruction Running in the Sequential Mode
Examples 7.4.1 and 7.4.2 run the AVW200 with a CR1000 using multiple
AVW200( ) instructions in a sequential mode of operation. In these example
programs, the first AVW200( ) instruction communicates with the attached
AVW200 interface module using Com1 and PakBus address 200, and tells the
AVW200 to make sixteen measurements. The CR1000 will wait at the
AVW200( ) instruction until the 16 measurements are returned from first
instruction, or until the instruction times out (time out is two times the number
of reps). If an instruction times out, it will try up to three more times before
advancing to the next instruction. The next AVW200 instruction on channel 2
is then executed and repeats the process.
Each AVW200() instruction in the examples uses a different result code
variable.
In sequential mode, it is a good idea to have different result code
variables for each AVW200( ) instruction.
(1) When running in the sequential mode, programs that contain
multiple AVW200 instructions using the same COM port should
have different “Result” variables for each AVW200 instruction
(e.g. “Result1” and “Result2”) in order to detect and isolate any
communications errors for a given AVW200.
(2) If the AVW200( ) instruction is in a slowsequence, the mode
of operation is always forced to sequential mode.
NOTES
49