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

Example Programs, 7.1 AVW200() Instruction (no multiplexers)

Page 53 highlights

AVW200-series 2-Channel Vibrating Wire Spectrum Analyzer Modules 7. Example Programs This section includes several program examples for our CR1000 datalogger. Although the examples are for the CR1000, programming for the CR800 and CR3000 is similar. Appendix G, CR10X Programming Example, has a programming example for the retired CR10X. More complex programming examples are provided in Appendix H, Additional Programming Examples. 7.1 AVW200() Instruction (no multiplexers) 7.1.1 Direct RS-232 Connection (two sensors) TABLE 7-1 shows wiring used for this example. TABLE 7-1. Wiring for Example 7.1.1 Datalogger Port for Cable Attachment COM1 (control port pairs C1/C2) Cable Needed to AVW200 Port or connect to AVW200 Model 17855 Cable (pigtail to RS-232 DB9 male cable) 'CR1000 Series Datalogger 'This program measures 2 sensors on the AVW200, 1 on channel 1 and 1 on 'channel 2 Public PTemp, batt_volt Public Dst(2,6) Public result DataTable (AVW200,1,-1) DataInterval (0,10,Sec,10) Sample (6,Dst(1,1),IEEE4) Sample (6,Dst(2,1),IEEE4) EndTable 'stores data from both sensors into a table named AVW200 'The CardOut instruction is used to create a new DataTable that will be saved on a compact flash card. DataTable (AVWcard,1,-1) CardOut (0 ,-1) DataInterval (0,10,Sec,10) Sample (6,Dst(1,1),IEEE4) Sample (6,Dst(2,1),IEEE4) EndTable BeginProg SerialOpen (Com1,38400,0,0,0) Scan (10,Sec,0,0) PanelTemp (PTemp,250) Battery (Batt_volt) 'Result,comport,neighbor,PBA,Dst,chan,muxchan,reps,begFreq,endFreq,Vx, 'IntegrationTime,Mult,Offset 'sensor 1, channel 1 AVW200(Result,Com1,200,200,Dst(1,1),1,1,1,1000,3500,2,_60HZ,1,0) 'sensor 2, channel 2 AVW200(Result,Com1,200,200,Dst(2,1),2,1,1,1000,3500,2,_60HZ,1,0) 45

  • 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
7.
Example Programs
This section includes several program examples for our CR1000 datalogger.
Although the examples are for the CR1000, programming for the CR800 and
CR3000 is similar.
Appendix G,
CR10X Programming Example
, has a
programming example for the retired CR10X.
More complex programming
examples are provided in Appendix H,
Additional Programming Examples
.
7.1
AVW200() Instruction (no multiplexers)
7.1.1 Direct RS-232 Connection (two sensors)
TABLE 7-1 shows wiring used for this example.
TABLE 7-1.
Wiring for Example 7.1.1
Datalogger Port for
Cable Attachment
Cable Needed to
connect to AVW200
AVW200 Port or
Model
COM1 (control port
pairs C1/C2)
17855 Cable (pigtail to
DB9 male cable)
RS-232
'CR1000 Series Datalogger
'This program measures 2 sensors on the AVW200, 1 on channel 1 and 1 on ‘channel 2
Public PTemp, batt_volt
Public Dst(2,6)
Public result
DataTable (AVW200,1,-1)
'stores data from both sensors into a table named AVW200
DataInterval (0,10,Sec,10)
Sample (6,Dst(1,1),IEEE4)
Sample (6,Dst(2,1),IEEE4)
EndTable
'The CardOut instruction is used to create a new DataTable that will be saved on a compact flash card.
DataTable (AVWcard,1,-1)
CardOut (0 ,-1)
DataInterval (0,10,Sec,10)
Sample (6,Dst(1,1),IEEE4)
Sample (6,Dst(2,1),IEEE4)
EndTable
BeginProg
SerialOpen (Com1,38400,0,0,0)
Scan (10,Sec,0,0)
PanelTemp (PTemp,250)
Battery (Batt_volt)
'Result,comport,neighbor,PBA,Dst,chan,muxchan,reps,begFreq,endFreq,Vx,
'IntegrationTime,Mult,Offset
'sensor 1, channel 1
AVW200(Result,Com1,200,200,Dst(1,1),1,1,1,1000,3500,2,_60HZ,1,0)
'sensor 2, channel 2
AVW200(Result,Com1,200,200,Dst(2,1),2,1,1,1000,3500,2,_60HZ,1,0)
45