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.

TableFile block out Measurement


Hans Feb 10, 2012 08:48 AM

Hi,

I have faced a problem on a CR800 with OS 24:
I am measuring 12 pF probes and 4 FDR every 30 min. Twice a day I want to create a file on the USR drive and store the data in it. When I activate the TableFile command only pF probe no. 8 is measured. If I comment the TableFile line in the programme all probes are measured.

I attached some lines of code which could help to find the problem.

Any help is appreciated. Thanks in advance.
Hans

Code snippet:

...
'******Declare Public Variables
Public PTemp, Batt_Volt
Public OutStat As Boolean
Public LastFileName As String *40
Public StationID As String * 16
'---------------------------------------------------------------------------------------------
'******Messgroessen
'---------------------------------------------------------------------------------------------
'******12 pF Sonden, pF_1 bis pF_12
'******pF_1
Public pF_1_I As String * 32 'SDI-Adresse & Seriennummer der pF-Sonde als String
Public pF_1_M As String * 32 'Temperatur & pF-Wert der pF-Sonde als String
Public pF_1_SN As String * 32 'Seriennummer der pF-Sonde
Public pF_1_Adr As String * 32 'SDI-Adresse der pF-Sonde
'******pF_2
... (up to 12)


DataTable(CT-2011-Block_1_res,True,-1)
DataInterval(0,30,Min,0)
TableFile("USR:CT2011Block1res",8,50,10,720,min,OutStat,LastFileName)
Sample(1,StationID,String)
Sample(1,Batt_Volt,FP2)
Sample (1,PTemp,FP2)
'---------------------------------------------------------------------------------------------
Sample(1,pF_1_SN,String)
Sample(1,pF_1_Adr,String)
Sample(1,pF_1_M,String)
'---------------------------------------------------------------------------------------------
Sample(1,pF_2_SN,String)
... (up tp 12)


BeginProg
'******Messung alle 30 Minuten, sequentiell pF1 bis pF12 und FDR1 bis FDR4
Scan (30,Min,1,0)
'******Default Datalogger Battery Voltage measurement Batt_Volt:
PanelTemp (PTemp,250)
Battery (Batt_volt)
StationID="CT2011-Block 1"
'******Turn Logger switched 12 volt output ON
SW12 (1)
Delay (0,2,Sec)
'******Turn AM416 Multiplexer On, AM416 RES-port via Logger C2-port
PortSet(2,1)
Delay (0,20,mSec)
'------------------------------------------------------------------------------------------------
'*****Switch to AM416 Multiplexer channel 1 (H1), AM416 RES via Logger C4, Verbindung mit pF-Sensor 1
PulsePort(4,10000)
Delay (0,20,mSec)
'******Messung pF-Sensor 1, SDI-Adresse 0, Daten via C1
SDI12Recorder (pF_1_I,1,0,"I!",1.0,0)
pF_1_SN=Mid(pF_1_I,21,6)
pF_1_Adr=Mid(pF_1_I,1,1)
Delay (0,1,Sec)
SDI12Recorder (pF_1_M,1,0,"M!",1.0,0)
Delay (0,2,Sec)
'------------------------------------------------------------------------------------------------
'*****Switch to AM416 Multiplexer channel 2 (H1), AM416 RES via Logger C4, Verbindung mit pF-Sensor 2
PulsePort(4,10000)
Delay (0,20,mSec)
'******Messung pF-Sensor 2, SDI-Adresse 1, Daten via C1
SDI12Recorder (pF_2_I,1,1,"I!",1.0,0)
pF_2_SN=Mid(pF_2_I,21,6)
pF_2_Adr=Mid(pF_2_I,1,1)
Delay (0,1,Sec)
SDI12Recorder (pF_2_M,1,1,"M!",1.0,0)
Delay (0,2,Sec)
... (up to 12)

* Last updated by: Hans on 2/10/2012 @ 1:49 AM *


aps Feb 10, 2012 10:19 AM

The Tablefile command should not have any influence on the measurements. However, it is spawned off as a background task in recent operating systems so some processing for it will be going on in the background during the measurements, for the time it takes to write a file. This might subtley change the timing of your program.

To get to the bottom of this can you confirm whether the program compiles in Pipeline mode OR Sequential mode (I would force sequential mode if the logger is not using this because of the delays in you program).

Can you also explain what you mean by only one probe being measured. Do the multiplexers stop switching? Are the values for all the others zero or NAN. Also is there any evident clues in the status table of the logger when this is happening - like skipped scans or the watchdog errors count incrementing.

One intriguing thing I note about your program excert is you are reading the data back from your SDI-12 sensor into one long string. This is not the normal mode of operation as SDI-12 sensors are normally supposed to return a specific number of delimited data values. The logger counts up the values it reads to check it has the correct number and ask for more if necessary. I am not sure we would expect nor have done extensive testing where the entire response is written to one string.

It is also interesting you are using a multiplexer with SDI-12 sensors as this is not normally necessary (as they are addressable and it is a multidrop system). I guess you are only switching the data line to the sensors?


Hans Feb 10, 2012 04:25 PM

Thanks, Andrew, for your reply.

The program compiles in sequential mode. Therefore I would not expect any affect on writing the table. I have tried to write the table with a delay of 15 minutes (TimeIntoInterval) without any success.

With the tablefile command only probe no 8 gives back measurements. All others return NAN.

Concerning the SDI sensors: yes, you are right, it is a weird way to measure those sensors. I am not happy neither with the procedure nor with the data format in the table. But I took it over from somebody else and before I change everything I want to check if I can read the files ;-)

Is it worth to create a slow sequence only for the data table call? This would separate both processes. How can I check that the multiplexer is switching?

regards
Hans


aps Feb 10, 2012 04:46 PM

I think someone will have to have a more detailed look at your whole program to solve the problem remotely but if you want to check out if the multiplexer is switching, with an AM416 you can here it click, quite clearly, every time it changes to the next channel.

It is still a mystery to me why a multiplexer is being used with the SDI12 sensors that have independent addresses. If the multiplexer is not being reset properly or misses a clock pulse you will of course get NaN for the measurements as the wrong sensor will be connected to the logger when the SDI12 request is sent.


Sam Feb 15, 2012 11:34 PM

I've recreated the above scenario.

A CR1000 reading twelve SDI-12 sensors, addresses 0-B, through a AM416. I've tried it with and without the TableFile() instruction. Everything looks fine.

Using the "W" mode of the CR1000 terminal, I verified that the CR1000 does issue the aI! and aM!/aDx! commands. It also allowed me to verify that the SDI-12 sensors responded correctly.

Additionally, all Public string variables are populated with data, you have some customer string manipulation in the program that I just left alone. All fields in CT-2011-Block_1_res are populated as expected also.


Sam Feb 23, 2012 08:14 PM

Hans,
No luck here. I've let my CR800 run for over a week and have not been able to reproduce the symptom. If there is anything else you can tell us that might help, just give us or your local CSI office a shout.

Sam

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