last days I wondered if our Vaillant heating boiler is working efficiently. Even when it was very cold outside it did not run continously. The temp rised up to a maximum, not using the minimum power possible, stopping the burner and waiting for cool down of the water. Then starting again - and again... Sitting in front of the display and writing a protocol on paper for hours was not a solution for me. So I remembered that the system uses a eBus (twisted pair of wires) for communication between main control heater, temperature controller, outside temperature sensor and so on. And I have the AD2! So, I have built a small circuit on my bread board to convert the eBus signal in order to use it with the digital input of AD2.
Then I was forced to write my first JavaScript for the Protocol window of Waveforms.
After two nights of Analog Discovery I finally got some data in a readable way.
The fist night I spent for looking through the data flow coming out of the eBus lokking for some interesting information. I saved the UART window that had received for some 20 Minutes @ 2400 baud to file and filled the first Excel sheet column with the bytes (35000 rows). Most of the Bytes were decimal 170 or #aa that is the word SYN that is asking the eBus participants to start communications if they like to. By studying the data I found the places where the flow and flow return temperatures are hidden being sent every 10 s. I also found the date and time which is communicated about once a minute. So I decided to spend another night to write my first Script. Up to now I had some programming skills in FORTRAN, BASIC Assembler VB for (Excel and Access)) Here it is, my first Java script:
// This script receives data from Vaillant eBus (energy bus) and processes it
// Settings to 2400 Baud hexadecimal in Protocol window
clear()
if(!('Protocol' in this)) throw "Please open the Protocol instrument";
print("_____________")
print("receiving eBus data...")
do { // repeat infinite ** how can the user stop this? **
Protocol.Mode.text = "UART" // make sure UART tab is selected
Protocol.UART.Receiver(); // reset receiver - that is start receiving data
wait(9); // time to fill the buffer rx with some data
rx = Protocol.UART.ReceiveArray(); // put the data to array rx
// print ("test rx length = " + rx.length) ;
var e =""
var eWord = rx.shift(); // look in the array
eWord= eWord.toString(16); // use hex to compare and decide about the contents
do { var e = rx.shift(); // delete SYN words = #aa
eWord= e.toString(16); //
}
while ((eWord == "aa") && (rx.length > 10)) // check, still enough data in array?
In the image you can see the result. I find: The result is G R E AT so far!!!
My problem is, that I am not yet able to look through every Byte of the continuing data flow. I wait for 9 seconds filling the buffer rx and then I look through it and then start from the beginning - OK so far. But I could not manage to fill up my array rx with the next portion of data that was coming during the time after the first fill up. I also do not know how to manage console input during the time my script is running in order to influence the program without stopping the process of gathering and evaluating the incoming data.
Could anybody give me some help how to deal with this?
Question
Telemeter
last days I wondered if our Vaillant heating boiler is working efficiently. Even when it was very cold outside it did not run continously. The temp rised up to a maximum, not using the minimum power possible, stopping the burner and waiting for cool down of the water. Then starting again - and again... Sitting in front of the display and writing a protocol on paper for hours was not a solution for me. So I remembered that the system uses a eBus (twisted pair of wires) for communication between main control heater, temperature controller, outside temperature sensor and so on. And I have the AD2! So, I have built a small circuit on my bread board to convert the eBus signal in order to use it with the digital input of AD2.
Then I was forced to write my first JavaScript for the Protocol window of Waveforms.
After two nights of Analog Discovery I finally got some data in a readable way.
The fist night I spent for looking through the data flow coming out of the eBus lokking for some interesting information. I saved the UART window that had received for some 20 Minutes @ 2400 baud to file and filled the first Excel sheet column with the bytes (35000 rows). Most of the Bytes were decimal 170 or #aa that is the word SYN that is asking the eBus participants to start communications if they like to. By studying the data I found the places where the flow and flow return temperatures are hidden being sent every 10 s. I also found the date and time which is communicated about once a minute. So I decided to spend another night to write my first Script. Up to now I had some programming skills in FORTRAN, BASIC Assembler VB for (Excel and Access)) Here it is, my first Java script:
// This script receives data from Vaillant eBus (energy bus) and processes it
// Settings to 2400 Baud hexadecimal in Protocol window
clear()
if(!('Protocol' in this)) throw "Please open the Protocol instrument";
print("_____________")
print("receiving eBus data...")
do { // repeat infinite ** how can the user stop this? **
Protocol.Mode.text = "UART" // make sure UART tab is selected
Protocol.UART.Receiver(); // reset receiver - that is start receiving data
wait(9); // time to fill the buffer rx with some data
rx = Protocol.UART.ReceiveArray(); // put the data to array rx
// print ("test rx length = " + rx.length) ;
var e =""
var eWord = rx.shift(); // look in the array
eWord= eWord.toString(16); // use hex to compare and decide about the contents
do { var e = rx.shift(); // delete SYN words = #aa
eWord= e.toString(16); //
}
while ((eWord == "aa") && (rx.length > 10)) // check, still enough data in array?
if ((rx[1].toString(16) == "b5") && (rx[2].toString(16) == "11") && (rx[7].toString(16) == "9"))
{ // find the temperatures for displaying
print ("Temp 1: " + (rx[8]/2).toFixed(1) + " °C Temp 2: " + (rx[9]/2).toFixed(1) + " °C");
} // decimal data devided by 2 bring °Celsius
} while (1 == 1) // start from beginning
In the image you can see the result. I find: The result is G R E AT so far!!!
My problem is, that I am not yet able to look through every Byte of the continuing data flow. I wait for 9 seconds filling the buffer rx and then I look through it and then start from the beginning - OK so far. But I could not manage to fill up my array rx with the next portion of data that was coming during the time after the first fill up. I also do not know how to manage console input during the time my script is running in order to influence the program without stopping the process of gathering and evaluating the incoming data.
Could anybody give me some help how to deal with this?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.