[SOLVED] correct point var name for scripts...
-
Try true or false
if(p36.value == 'MANUAL') if(p36.value == MANUAL) if(p36.value == true) if(p36.value == false) same for p36.set(true) or p36.set(true)
-
ok I'll try that thanks, could you just confirm the cron operation for scripts..
Does the cron time execute the script say each minute for example then the script stop at the end of the script and it won't run again for another minute?
Just trying to get this script to run at a more regular interval and I don't think cron will support that.
Cheers
-
Yes the CRON pattern will run the script once at the time or times determined by the CRON.
-
Sorry for all the questions, is there a simple function within the scripting to either send an alert/email or raise an event from which I can then send an email from?
Cheers
Dan -
No, you would have to do that via a data point, event detector and event handler.
-
cool, thanks for that.
I'm not getting any debugging info in this script each time it runs (each minute)
apart from:-
administrator@water:~$ tail -f logs/scripting-10.log INFO 2014-08-08 13:59:58,063 - Data source started
I've tried having it in either trace or debug mode inside the script editing screen. I'm not sure it's even running the cron job, nothing in ma.log relating to it being triggered apart from the source restarting when I hit save..
INFO 2014-08-08 13:59:57,969 (com.serotonin.m2m2.rt.RuntimeManager.stopDataSource:322) - Data source 'Tank Automation' stopped INFO 2014-08-08 13:59:58,068 (com.serotonin.m2m2.rt.RuntimeManager.initializeDataSource:290) - Data source 'Tank Automation' initialized INFO 2014-08-08 13:59:58,069 (com.serotonin.m2m2.rt.RuntimeManager.initializeDataSource:295) - Data source 'Tank Automation' took 14.278909ms to start
-
This is the latest version of the script on the system, it just doesn't seem to be running at all. There are no more entries in the logs nor any errors, I have it in debug Log Level also.
// check if in auto mode AND tank level below 5000L AND pump not running if ((p31.value == 'AUTO') && (p7.value < 5000) && (p11.value == 'STOP')) { // open north solenoid p24.set('OPEN'); // close southern solenoid p22.set('CLOSED'); // close western solenoid p28.set('CLOSED'); // start pump p11.set('RUN'); } // check if in auto mode AND tank level above 22700L AND pump running AND northern solenoid OPEN if((p31.value == 'AUTO') && (p7.value > 22700) && (p11.value == 'RUN') && (p24.value == 'OPEN')) { // stop pump p11.set('STOP'); // close northern solenoid p24.set('CLOSED'); } // check if in auto mode at Driveway Tank AND tank level below 5000L AND pump not running else if((p36.value == 'AUTO') && (p23.value < 16000) && (p11.value == 'STOP')) { // open southern solenoid p22.set('OPEN'); // close northern solenoid p24.set('CLOSED'); // close western solenoid p28.set('CLOSED'); // start pump p11.set('RUN'); } // check if in auto mode at Driveway Tank AND tank level above 22700L AND pump running AND southern solenoid OPEN if((p36.value == 'AUTO') && (p23.value > p38.value) && (p11.value == 'RUN') && (p22.value == 'OPEN')) { // stop pump p11.set('STOP'); // close southern solenoid p22.set('CLOSED'); }
I'm just going through and updating the fill points and low points to be dynamic from settable data points, but still the script doesn't appear to be running?
-
I've been looking through logs etc, it's like the cron scripts aren't even running at all.
Nothing appears in the logs apart from
INFO 2014-08-08 22:09:06,934 - Data source started
That kind of thing. Nothing more.
Is there somewhere I need to maybe set the path to the systems cron bin? Or is it using a java version of cron?
Mango appears to be running as root, should that be ok?
The timing for every minute just seems to be ignored and the cron job never appears to run?
Cheers
Dan -
SOLVED!!
I mucked around with this for a few hours and found if I changed all the labelled set points from say 'AUTO' and 'MANUAL' to just true and false it now works, brilliantly!!
Thanks Joel and team for all your assistance!
Although I do still notice nothing in the trace log for the script other than the Data source started line.
Cheers
Dan