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.

First try at a program for a CR200X with CS655


John_P Apr 13, 2016 08:54 PM

I have a CR200X that will be connected to 6 CS655s. The CS655s will be split into groups of 3, so to speak. One group will be in one plot and the other group will be in an adjacent plot. Each group has a sensor at 5, 25, and 50 cm. I've never written a program before. I'd like to set up two tables, one for each plot. Here is my attempt at the program based on Shortcut and my own tweaks for multiple sensors and tables. I would appreciate feedback.

---------

Public BattV

Public CS65X(18)

Alias CS65X(1)=VWC_1

Alias CS65X(2)=EC_1

Alias CS65X(3)=T_1

Alias CS65X(4)=VWC_2

Alias CS65X(5)=EC_2

Alias CS65X(6)=T_2

Alias CS65X(7)=VWC_3

Alias CS65X(8)=EC_3

Alias CS65X(9)=T_3

Alias CS65X(10)=VWC_4

Alias CS65X(11)=EC_4

Alias CS65X(12)=T_4

Alias CS65X(13)=VWC_5

Alias CS65X(14)=EC_5

Alias CS65X(15)=T_5

Alias CS65X(16)=VWC_6

Alias CS65X(17)=EC_6

Alias CS65X(18)=T_6

Units BattV=Volts

Units VWC=m^3/m^3

Units EC=dS/m

Units T=Deg C

'Define Data Tables

DataTable(Table1,True,-1)

   DataInterval(0,30,Min)

   Sample(1,VWC_1)

   Sample(1,EC_1)

   Sample(1,T_1)

   Sample(1,VWC_2)

   Sample(1,EC_2)

   Sample(1,T_2)

   Sample(1,VWC_3)

   Sample(1,EC_3)

   Sample(1,T_3)

   Sample(1,VWC_4)

EndTable

DataTable(Table2,True,-1)

   DataInterval(0,30,Min)

   Sample(1,EC_4)

   Sample(1,T_4)

   Sample(1,VWC_5)

   Sample(1,EC_5)

   Sample(1,T_5)

   Sample(1,VWC_6)

   Sample(1,EC_6)

   Sample(1,T_6)

EndTable

DataTable(Table3,True,-1)

   DataInterval(0,1440,Min)

   Minimum(1,BattV,False,False)

EndTable

BeginProg

   Scan(30,Min)

      Battery(BattV)

      SDI12Recorder(CS65X(1),"XXM!",1,0) 'XX - sensor address. this is at xx cm

      SDI12Recorder(CS65X(4),"XXM!",1,0) 'XX - sensor address. this is at xx cm

      SDI12Recorder(CS65X(7),"XXM!",1,0) 'XX - sensor address. this is at xx cm

      SDI12Recorder(CS65X(10),"XXM!",1,0) 'XX - sensor address. this is at xx cm

      SDI12Recorder(CS65X(13),"XXM!",1,0) 'XX - sensor address. this is at xx cm

      SDI12Recorder(CS65X(16),"XXM!",1,0) 'XX - sensor address. this is at xx cm

      CallTable Table1

      CallTable Table2

      CallTable Table3

   NextScan

EndProg


Chod Apr 27, 2016 05:10 PM

Just to clarify, do you plan to change the XX in the SDI12Recorder()instruction to match the SDI12 address of each particular sensor at a given depth? If so, the program looks very similar to that created by ShortCut and should work. You may consider placing each sensor in its own table or seperating VWC, EC, and Temp in their own tables. The way you have the tables configured currently splits sensor #4 into table 1 and table 2.


John_P Apr 29, 2016 03:32 PM

Yes, you're right, I did type the program in wrong here on the forum. I checked what I have in the editor and sensor 4 is in one table, not split. It would help if the forum would let you copy and paste. I had to retype the whole program for this forum post. I plan to change the XX to match address of the sensor. Thanks for the feedback.


Terri May 3, 2016 03:17 PM

I talked to John off of the message board. He was trying to use right-click functions. I will let the website team know that is missing. For now, you can use Ctrl+C for copy and Ctrl+V for paste and that should work.


John_P Jul 14, 2016 02:42 PM

I installed the dataloggers. The program as written above does not work. When I retrieved the data from the loggers after a week, it looked like this:

2016-07-13 12:00:00    0    "NAN"    0    0    "NAN"    0    0    "NAN"    0    0
2016-07-13 12:01:00    1    "NAN"    0    0    "NAN"    0    0    "NAN"    0    0

The logger wasn't recording anything and I figured it was because there was something wrong with the program. The first problem was that the SDI12Recorder command had quotes around the command. In this case

"XXM!".

This needs to be literally

XXM!

where XX is actually a single number that refers to the sensor address, so an example would be

4M!

not

"4M!"

as I had it in there. In this example, 4 is the sensor's address.

These loggers are in remote locations and about 4 hours away from me, so getting out to them is a little bit of work. As well, there is no phone service out there, so I can't contact anyone for help.

I pondered the program and changed this part, after looking at the manual for CS650 and my program.

SDI12Recorder(CS65X(1),"XXM!",1,0) 'XX - sensor address. this is at xx cm

SDI12Recorder(CS65X(4),"XXM!",1,0) 'XX - sensor address. this is at xx cm

I dropped the number in the CS65X() command. I did not realize this was a command, I thought it was a variable/alias. Now this part of my program looks like this:

SDI12Recorder(CS65X(),4M!,1,0) '4sensor address. this is at 5 cm

SDI12Recorder(CS65X(),2M!,1,0) '2sensor address. this is at xx cm

Now, the data look like this:

2016-07-13 13:09:00 0 "NAN" 0 0 0 0 0 0 0 0
2016-07-13 13:10:00 1 "NAN" 0 0 0 0 0 0 0 0

So, it looks like the CS65X() is a command and needs to have empty (). I'm still not sure why the first sensor was returned NAN, but the other sensors were reading something or at least showed a change. I don't know what needs to be corrected and am open to suggestions.


JDavis Jul 14, 2016 02:53 PM

ShortCut does allow adding multiple CS655 sensors. You will need to individually change the addresses on the sensors themselves. If you have two sensors attached with the same internal address, both measurements will fail(NAN).


John_P Jul 14, 2016 03:07 PM

I had no way to confirm the addresses of the sensors at the time. I know an A200 will tell me, but I forgot a cable for that. I went with the serial numbers on the white label bands on the cables. It seemed a fair assumption, since it worked in some cases, but I suppose that the serial numbers could have not matched the actual internal address.


JDavis Jul 14, 2016 03:14 PM

When you order the sensors, you can specify that you want the SDI-12 address set to the last digit of the serial number.

Section D.2 of the CS655 manual explains how to use a datalogger to check the sensor address and change if needed.


John_P Jul 14, 2016 03:52 PM

I inherited this project and the sensors and am not sure how the sensors were ordered with respect to the addresses.

Thanks for pointing out that section of the manual. I will look that over more closely.


jra Jul 14, 2016 03:59 PM

We also have a video tutorial that shows checking and changing the SDI-12 address via terminal mode. 


John_P Jul 14, 2016 06:07 PM

That video looked very useful. Thanks for the link.

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