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.

Get Variables Command


AJG Nov 6, 2015 04:12 PM

Hello,
I have recently built a data acquisition system for my PhD project that has two CR-1000 dataloggers, three SDMCD16AC relays which are controlling 12vDC solenoid valves on an irrigation system, and seven AM1632B multiplexers which have three different types of soil moisture sensors on them.

I have a fairly simple program that collects soil moisture data from 4 depths in large PVC growth columns, and I want to use data from one depth of each of the columns (being collected on CR1000-1) and use it to switch on a channel on one of the SDMCD16AC relays (on CR1000-2).

This is the command that I am using to make the decision to irrigate, the only thing I am not sure of is how to move the VWC variable from CR1000-1 to CR1000-2.

IfTime (360, 1440, Min) AND VWC(1)<31.0 Then ValveCtrl(1)=1
IfTime(370, 1440, Min) Then ValveCtrl(1)=0
SDMCD16AC(ValveCtrl(), 1, 0


I have a cable to connect the two and available COM ports, but the programming has me confused. I am self taught in CR Basic with help from the folks at Campbell, but I have not been able to see a sample code which would help me with this. I am a plant breeder/agronomist by training, so I am new to all things programming with this project.

Is there anyone that can point me to where I could understand how to use the GetVariables command? Alternatively, is there a better way of doing this? All I have been able to learn is from the CR1000 manual and some Pakbus literature about this command. Any help would be greatly appreciated!

* Last updated by: AJG on 11/6/2015 @ 9:13 AM *


jra Nov 6, 2015 05:10 PM

AJG your CRBasic Help has working example programs for every instruction. https://www.campbellsci.com/videos?video=42

About your cabled connection, TX from CR1000-1 should connect to RX on CR1000-2. It is a common mistake to connect tx to tx and rx to rx.


JDavis Nov 9, 2015 05:24 PM

You will also need to configure the com port used for the connection between the two datalogger. The easiest way to configure the port is using the ComPorts Settings in Device Config. Just set the same baud rate on the appropriate port on both dataloggers. Setting a baud rate this way without changing anything else will by default have the port ready for Pakbus.

If not using twisted pair cable, you might have to use 9600 baud.


AJG Nov 11, 2015 09:46 PM

Thank you for the suggestions. Upon trying to configure the Com Port for the datalogger, I am unable to connect and it says that there is no response from the data logger. This is in the Device Configuration Utility main screen. What are potential causes of this problem?


jra Nov 12, 2015 03:17 PM

AJG, First check your power supply and communications cable. If that is all in order, in the Device Configuration Utility, go to the bottom of the device list on the left side and select Unknown. Click the Identify Datalogger Type button. Be patient, the Device Configuration Utility will try all combinations until it finds the right one. You may have changed the baud rate of the CR1000's RS-232 port.


AJG Nov 12, 2015 05:37 PM

I am fairly certain that there is a problem in the setup of the datalogger, although I don't know what the issue is. I keep trying to connect using the configuration utility and it takes a long time to respond, then comes back with "no pak bus device found" and "no datalogger response". The first CR1000 (the source datalogger) has no problems connecting, but the second datalogger (the one with the 'Get Variables' program that needs the data from the first CR1000, also the newer of the two) will not respond. The communication test works fine, it has power, and it can be programmed and run a data collection program, on its own. However, it will not respond in the Device Configuration.

I wrote a program to try, and the Result Code that it kicked back was -20, Out of Comms Memory. It was then that I got the suggestion from JDavis and tried to go back into the Device Configuration Utility.

I am sure what I am missing is fairly straightforward. Any thoughts?

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