Posts: 347
	Threads: 79
	Joined: Jan 2021
	
Reputation: 
0
	 
	
	
		hello 
I used grp.checkwrite command in a resident script to write a true/false value on a switch actuator  
but some times due to power issue or other issues the command value is true while the F/B value is false (real Status), so the grp.checkwrite command will not write true on this value, while it should.
what is the best solution for this issue
	
	
	
Best Regards,
	
		
	
 
 
	
	
	
		
	Posts: 5284
	Threads: 29
	Joined: Aug 2017
	
Reputation: 
237
	 
	
	
		You can set some periodical pooling on this object. There is parameter like this on the object.
	
	
	
------------------------------
Ctrl+F5
	
		
	
 
 
	
	
	
		
	Posts: 1807
	Threads: 7
	Joined: Jul 2015
	
Reputation: 
121
	 
	
		
		
		16.11.2021, 18:41 
(This post was last modified: 16.11.2021, 18:45 by Erwin van der Zwart.)
		
	 
	
		That is logical behavior, if you write to the switch object for example 1/1/1 and your feedback is 1/2/1 then you need to know the value of 1/2/1 before writing to 1/1/1..  
grp.checkwrite checks in this case the internal value of the controller of 1/1/1 so the last sended value and this does not check the actual value of the feedback object 1/2/1.. the same counts for Daniels solution, this will get the value of 1/2/1 but writing to 1/1/1 does not change by it.
What you might want to do is send write always to the bus and use grp.write.
If you want to make the write depending on the feedback you need to send the feedback cyclic from the actuator, and make in your script a condition where you compare 1/2/1 with the new value you want to write to 1/1/1.
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 347
	Threads: 79
	Joined: Jan 2021
	
Reputation: 
0
	 
	
	
		Thank you all 
Danial, Erwin, Admin
great feature I also missed it 
if I want to execute the command regardless delta 
I use this: grp.checkupdate('32/1/1',true,_,'32/1/2') !
	
	
	
Best Regards,
	
		
	
 
 
	
	
	
		
	Posts: 8413
	Threads: 45
	Joined: Jun 2015
	
Reputation: 
481
	 
	
	
		Better use nil because if _ is defined as a global variable somewhere then the code might not work. But it only matters for numeric values, for boolean values delta is not used so it can be anything.