Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Writing separate data files with CR6 after external trigger


msageng Jul 22, 2015 05:36 AM

I am trying to use a CR6 to take a large number of voltage measurements (about 25) using an AMT25 multiplexer. My measurement process is pretty straighforward:
1. Use external trigger to start
2. Take measurements for one minute
3. Write these measurements to a separate file
4. Wait one minute
5. Repeat steps 2 through 4 for a total of three separate datasets and files.
6. Make logger ready to receive another start trigger

The logger and multiplexer are working fine, as I can record data in a simple program generated with ShortCut without issue.

I have included my code below (sans data table sample and voltage measurement statements for brevity). I can't seem to get the CR6 to write the required 60 records to separate files. My code yields one file with three lines of data. I'm not sure how to proceed to get the proper result. Any insight is greatly appreciated.


DataTable (Test,1,9999) 'Set table size to # of records, or -1 to autoallocate.
TableFile ("CRD:Test",8,-1,60,0,Sec,OutStat,LastFileName)
'list all the variables that are stored here
EndTable

'Main Program
BeginProg

'Wait for remote control signal
WaitDigTrig(C1,0)

'Start loop for three consecutive measurement periods
For I = 1 To 3 Step 1
'Turn on external indicator
PortSet(C2,1)

'Re-set voltage measurement loop counter
J = 0
Do
'Take voltage measurements here

'Increment counter for voltage measurement loop
J=J+1

'When 60 measurements (one minute) of data is collected
'write that data to a file
If J = 60 Then
CallTable Test
Exit Do
EndIf

'Set sample interval to one second
Delay(1,1000,mSec)

Loop

Wait one minute before starting the next set of measurements
Delay(1,1,min)
Next J

EndProg


JDavis Jul 22, 2015 04:28 PM

You should take CallTable out from the If statement.

Log in or register to post/reply in the forum.