0

I have serial communication with the device

Every second when a port is opened ,pc is receiving data (value & time)

I wrote the code to store these values ​​in "Test.db".

If comlog or Test.db right away in Notepad, i could see the value

However, when I quit the program and opened "Test.db" using the db browser, I could not see anything.

Do I have to set the data value separately in order to check it in the db browser?

The code below implements the part that receives and save the data

    port.on('data', function(data) {            
     converted_data = parseFloat(data);
     console.log(converted_data);
    var secondsElapsed = (new Date().getTime()-stamp)/1000;
     console.log(secondsElapsed);
       fs.appendFile('Test.db',converted_data + 
                       '\r\n'+secondsElapsed+',',function(err) {        
       if(err) 
             console.log(err);
       else
             console.log('data->db');       
       });
    });

0 Answers0