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.

rewrite
#1
Hello,
I use scripts to read or write BACNET values.
I would like to know if there is an easy way to rewrite this script more clearly and not send the values every time (If the value read on the BACNET is the same as the previous one then we do not rewrite it) :


Code:
require('bacnet')


--CASSETTE 2
value2 = bacnet.readvalue(16002, 'binary value', 8) -- Prise du statut Fenetre

grp.write('5/3/2', value2)

--CASSETTE 3
value3 = bacnet.readvalue(16003, 'binary value', 8) -- Prise du statut Fenetre

grp.write('5/3/3', value3)

--CASSETTE 4
value4 = bacnet.readvalue(16004, 'binary value', 8) -- Prise du statut Fenetre

grp.write('5/3/4', value4)

--CASSETTE 5
value5 = bacnet.readvalue(16005, 'binary value', 8) -- Prise du statut Fenetre

grp.write('5/3/5', value5)

--CASSETTE 6
value6 = bacnet.readvalue(16006, 'binary value', 8) -- Prise du statut Fenetre

grp.write('5/3/6', value6)

--CASSETTE 7
value7 = bacnet.readvalue(16007, 'binary value', 8) -- Prise du statut Fenetre

grp.write('5/3/7', value7)

--CASSETTE 8
value8 = bacnet.readvalue(16008, 'binary value', 8) -- Prise du statut Fenetre

grp.write('5/3/8', value8)

--CASSETTE 9
value9 = bacnet.readvalue(16009, 'binary value', 8) -- Prise du statut Fenetre

grp.write('5/3/9', value9)

--CASSETTE 10
value10 = bacnet.readvalue(16010, 'binary value', 8) -- Prise du statut Fenetre

grp.write('5/3/10', value10)

--CASSETTE 11
value11 = bacnet.readvalue(16011, 'binary value', 8) -- Prise du statut Fenetre

grp.write('5/3/11', value11)

This script is one of the resident scripts for reading values I have many and some are for writing.
B.R.
Reply


Messages In This Thread
rewrite - by Gadjoken - 09.08.2019, 06:27
RE: rewrite - by admin - 09.08.2019, 06:34
RE: rewrite - by Gadjoken - 09.08.2019, 07:42

Forum Jump: