Scripts not working, setup? - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Scripts not working, setup? (/showthread.php?tid=732) |
Scripts not working, setup? - 02dag - 11.04.2017 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? RE: Scripts not working, setup? - admin - 11.04.2017 Do you actually have this object in Objects tab? If not, grp.write will only work if you pass datatype as third argument. RE: Scripts not working, setup? - 02dag - 11.04.2017 (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" RE: Scripts not working, setup? - PassivPluss - 11.04.2017 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 parameters RE: Scripts not working, setup? - 02dag - 13.04.2017 (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 parameters 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? RE: Scripts not working, setup? - admin - 13.04.2017 You probably forgot quotes around 1/1/5 in grp.write. Without quotes 1/1/5 evaluates as 0.2 RE: Scripts not working, setup? - 02dag - 13.04.2017 (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 Sorry about that, the script actually says grp.write('1/1/5',1) RE: Scripts not working, setup? - Erwin van der Zwart - 13.04.2017 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 RE: Scripts not working, setup? - admin - 13.04.2017 either will work, but you can try grp.write('1/1/5', true, dt.bool) RE: Scripts not working, setup? - PassivPluss - 13.04.2017 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 wrong RE: Scripts not working, setup? - 02dag - 22.04.2017 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. 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. RE: Scripts not working, setup? - Jørn - 22.04.2017 You can control this object in the objects overview by sending 0/1 to it`? Is the scheduled script set to active`? Jørn RE: Scripts not working, setup? - 02dag - 22.04.2017 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? RE: Scripts not working, setup? - FatMax - 22.04.2017 Nothing in your error log? RE: Scripts not working, setup? - Jørn - 23.04.2017 (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. As you can see on this screenshot the top script is activated, the one below is not. RE: Scripts not working, setup? - 02dag - 29.04.2017 (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? 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? RE: Scripts not working, setup? - Erwin van der Zwart - 30.04.2017 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 RE: Scripts not working, setup? - admin - 30.04.2017 Which FW are you running, have you tried installing the latest RC1? RE: Scripts not working, setup? - 02dag - 04.05.2017 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 |