I plan to control power to a modem with the SW12 output of a CR1000. So far, SW12 seems to reset to off if the power to the logger is interrupted, but stays on when I send a new program. Are there any situations where the CR1000 might turn off SW12 on its own initiative?
In my experience the SW12 output turns off when a new program is loaded, which is different than you mention. As far as I know it behaves as the program makes it, so you might just need to turn it on explicitly in the program.
A very useful feature is the default.cr1 program which can be loaded into the CR1000 loggers after OS17 or so, and which will run if an uploaded program fails to run. It can be used to turn on SW12 or do other things, and has saved us at least once.
Good idea about the default.cr1!
I checked again and see that SW12 does indeed turn off when a new program is loaded. Is there any way to change that behaviour?
After loading a new program and losing communications, the CRBASIC editor now gives me the message: "The attempt to change the file attributes has failed." What attributes should I set after the communications are restored?
You may also want to look at specifying a program in the Include File setting in the datalogger. This points to program code that will basically be appended to any other program when it is compiled in the datalogger. Read the CRBasic help file on the use of the Include File setting and how it behaves under various conditions (e.g., when no program is specified for running, when a default program is used, etc). For this information, search for Include File in the help's index. Include File setting is a good way to leave a datalogger in a known state if "all else fails" (for instance, setting SW12 high).
Note that the Include File Setting is different than using the Include function in the datalogger.
Dana W.
I came across the include file settings when looking up the default.cr. I may not have understood everything, but I did not see any advantage over the default.cr for this purpose. Is there an advantage with the include file?
I have trouble imagining all the things that might go wrong, since I've never had the CR1000 refuse to compile or run a program that was checked by CRBASIC...
I have put up a CR1000 with an GPRS modem powered from SW12.
By accident I remotely uploaded an old program that didn't set the SW12 on in the program. Therefor my modem is now permanently off. The modem and logger is positioned in a tower about 400 km away. It is very hard to get to because it is often very windy and sometimes flooded.
Luckily I had the chance to ask someone nearby to go there when the weather was OK (yesterday). By my instructions he changed the SW12V parameter via the KeyboardDisplay and then he went again. Apparently the SW12V parameter only stayed on for about 20 minutes. And in that time frame I didn't upload a new program.
THE QUESTIONS:
Why does the logger turn SW12V to False automatically after a while when there is no SW12V command in my program?
Which other setting should I ask my colleague to do via the KeyboardDisplay when he goes there again to make the SW12V stay on?
Thank you
* Last updated by: Bo on 5/10/2011 @ 3:37 AM *
Is there an advantage with the include file?
The default program runs if another program will not. The include file contains code that will run on its own, or be appended to whatever other program is running.
It's a great way to keep a datalogger in a known state (for instance, communication always turned on), if all else should fail.
Dana W.
THE QUESTIONS:
Why does the logger turn SW12V to False automatically after a while when there is no SW12V command in my program?
Which other setting should I ask my colleague to do via the KeyboardDisplay when he goes there again to make the SW12V stay on?
The datalogger will not reset the SW12, unless it is done under program control OR the datalogger compiles or recompiles a program. That is one of the reasons to use the Include File setting in the datalogger's settings table -- a simple program that turns on SW12.
Dana W.
Perhaps there is a low battery situation here as well?
The Status table has a "Low12VCount" field and a "Low5VCount" field. These fields are counters that will increment each time 12V or 5V power drops below a threshold.
Dana