Campbell Scientific CR9000X Measurement and Control System User Manual

Page 337

Advertising
background image

Section 9. Program Control Instructions

If the same data file was converted with the FileMarks processed, three data
files would be created as follows:

File = TempConv.000
"1999-04-15 10:52:57.5",90.5
"1999-04-15 10:52:58",90.6
"1999-04-15 10:52:58.5",89.3
"1999-04-15 10:52:59",88

"1999-04-15 10:52:59.5",87.5

'Record containing the FileMark

File = TempConv.001
"1999-04-15 10:53:13.5",90.5
"1999-04-15 10:53:14",90.5
"1999-04-15 10:53:14.5",89.6
"1999-04-15 10:53:15",88.5

"1999-04-15 10:53:15.5",87.7

'Record containing the FileMark

File = TempConv.002
"1999-04-15 10:53:28",90
"1999-04-15 10:53:28.5",90
"1999-04-15 10:53:29",88.9
"1999-04-15 10:53:29.5",88.1

"1999-04-15 10:53:30",87.6

'Record containing the FileMark

'This example uses the

FileMark

command.

Public TBlk1(1) : Units TBlk1 = Deg_F

'Block1 dimensioned source

Dim TRef(1)

'Declare Reference Temp variable

Public Flag(8), Count

DataTable(TEMP,True,-1)

'Trigger, auto size


CardOut (0 ,1000)

'Write data to PC Card

DataInterval(0,0,0,50)

'Synchronous, 50 lapses, autosize

Sample

(1,TBlk1(),FP2)

'1 Reps,Source,Res

EndTable

'End of table TEMP

BeginProg

'Program begins here

Scan

,0)

'Scan once every 10mSecs, non-burst

(500,1,0

ModuleTemp(TRef(),1,5,20)

'RefTemp,CardCount,StartCard,Integrate

TCDiff(TBlk1(),1,mV50,5,1,TYPET,TRef(1),True,30,40,1.8,32)

'___________________

___ Output Table Control ______________________

IF TBlk1(1)>90 then Flag(1)=1

'Set Flag1 high when Temp>90

If Flag(1) = 1 then

Count = Count +1

'Increment Counter

If Count = 5 then

FILEMARK

(Temp)

'Set a FileMark on last record of set

CallTable TEMP

'Go up and run Table TEMP

Endif

If Count = 5

'When Count =5 then do

Count = 0

'Set counter back to 0

Flag(1)

Endif

= 0

'Set Flag(1) low

Next

Scan

'Loop up for the next scan

EndProg

'Program ends here

9-7

Advertising