This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Scripts not working, setup?
#1
Photo 
Hi, first post on the forum. We have recently moved into our new house, and most of the cardboard boxes have been emptied. So I have changed attention towards the ReactorV3 that is sitting there nicely along with the rest of the electrical equipment. Thought I should start with a simple script just to see if something happened, but it doesnt.

My script is a simple scheduled one planned to start at a given time let us say 1900 every night

Code:
grp.write('1/1/5',100)

But nothing happens. The address is an exterior light and I have another script that turns it off at 2330


Code:
grp.write('1/1/5',0)


Is there something basic I have missed? I have not imported any ETS file yet, because my electrician havent sent me the file yet.
The reactor is set to auto update but have not been able to find more than 6 objects. There are also no logs whatsoever, no error logs, no object logs, no trend logs, nothing

When the reactor is placed on the bus, it should be able to send messages on the bus directly to switches and actuators right?
Reply
#2
Do you actually have this object in Objects tab? If not, grp.write will only work if you pass datatype as third argument.
Reply
#3
(11.04.2017, 17:33)admin Wrote: Do you actually have this object in Objects tab? If not, grp.write will only work if you pass datatype as third argument.

There is an object called 1/1/1 in the objects tab and it says universal input/output with a lots of data types.

I also have a printout of groupaddresses, but there it says "exterior lights entree dim 1/1/1"
Reply
#4
The best way is to import opc file from ets program in ultillities tab. But if you know that the adress is a boolean (on/off) you can add it manual in the object list. Press add on the bottom left and fill in the parametersSmile
Reply
#5
(11.04.2017, 20:41)PassivPluss Wrote: The best way is to import opc file from ets program in ultillities tab. But if you know that the adress is a boolean (on/off) you can add it manual in the object list. Press add on the bottom left and fill in the parametersSmile

I have made an object called "Veranda" with group address 1/1/5 and datatype boolean. I am not sure if this is correct but in my printed version of "overview of group addresses" it says "1/1/5 exterior light veranda On/off type 1 bit"

Trying to do a scheduled write to this address with grp.write(1/1/5,1) but this is still not working. I am pretty sure it has something to do with addressing. But could it have something to do with setup. Like if the reactor has not been set up as an IP gateway in the ETS project?
Reply
#6
You probably forgot quotes around 1/1/5 in grp.write. Without quotes 1/1/5 evaluates as 0.2 Smile
Reply
#7
(13.04.2017, 11:14)admin Wrote: You probably forgot quotes around 1/1/5 in grp.write. Without quotes 1/1/5 evaluates as 0.2 Smile

Sorry about that, the script actually says grp.write('1/1/5',1)
Reply
#8
Hi,

Is your object a bit object? If yes use boolean as value instead of 0 or 1.

grp.write('1/1/5', true) -- or false

BR,

Erwin
Reply
#9
either will work, but you can try grp.write('1/1/5', true, dt.bool)
Reply
#10
The thing you should do first is in the objects tab, push the manual value and try to write 1 or 0 there to se if it responds. If not the group adress is wrongSmile
Reply
#11
I have let this rest for a while and did a new try today. Found out that the connection to the bus was wrong. Had accidentally managed to choose EIBnet/IP routing instead of TP/UART. Saw this while reading the manual for the nth time. Rolleyes

So now the objects are pouring in to the objects overview, and I can manually turn off and on all lights. 

Tried to start a scheduled script but that still doesnt work. Here is my script

grp.write('1/1/20',false)

This is set up in scripting under scheduled to start at 15 23 * * *

I also tried to do this in scheduler where you actually set up a scheduled event against a group address, and at a certain time change a value. This should be quite similar to changing the object manually directly. No success.
Reply
#12
You can control this object in the objects overview by sending 0/1 to it`?
Is the scheduled script set to active`?

Jørn

Best regards, Jørn.
Reply
#13
Yes to both questions. i think that there must be something missing here. Do I need to enable the script or turn on scripting somewhere?
Reply
#14
Nothing in your error log?
Reply
#15
(22.04.2017, 20:13)02dag Wrote: Yes to both questions. i think that there must be something missing here. Do I need to enable the script or turn on scripting somewhere?

New scripts are not set to active by default.

[Image: screenshot.png]

As you can see on this screenshot the top script is activated, the one below is not.

Best regards, Jørn.
Reply
#16
(23.04.2017, 01:29)joskilb Wrote:
(22.04.2017, 20:13)02dag Wrote: Yes to both questions. i think that there must be something missing here. Do I need to enable the script or turn on scripting somewhere?

New scripts are not set to active by default.

[Image: screenshot.png]

As you can see on this screenshot the top script is activated, the one below is not.

My scripts are active and it is till not working, but anyway, I have been able to write scripts now, event based. This is working flawlessly. But the scheduling will not work at all.

Is there a way to start an event based script that triggers on a certain time? Is the cron job not started?
Reply
#17
Hi,

Scheduled scripts are working always so there must be a reason why it doesn't in your case..

The most common mistake i see is that the time settings are wrong when there is a incorrect timezone selected. When your controller is using a NTP server there could be a time shift due to this and the schedulers are working but not switching on the expected moments what makes it seems to not working correct. Please check this and you could check this by adding a log command log(os.time()) in the start of the scheduler script so you at least know it starts at some point.

BR,

Erwin
Reply
#18
Which FW are you running, have you tried installing the latest RC1?
Reply
#19
I did what you said and the script worked, although two hours later than expected. I have entered 0-3.no.pool.ntp.org in the different NTP-client settings. I will look into the time zone settings.

Regarding the firmware, I will try to download this and install it.

Thanks to everybody involved helping me to solve this problem. Script writing will commence from here on, although I wish it was powershell  Cool
Reply


Forum Jump: