Reading Modbus and Writing to Database

I am getting the data in this format but I can't write this data format to a database. I must split these datas for writing to database as 1 or 0 format. Which function code should i use to format data and write it to database.

Welcome to the forum @Seymi

Is this a college assignment?

No I am an intern in a factory this is my assignment.

Are you sure that you just need to send a set of true/false values to the database?
If so, then what database type is it and what are the fields of the table it has to be written to?

Those values are indicators for the machine status. If first bit is 1 then machine 1 is ON. If second bit is 0 then machine 2 is OFF.

OK, so what is the answer to my other question?

The table has DT (DateTime), SENSOR(Int) and SENSOR_VALUE(Int) fields. The database is MariaDB.

Is the sensor the index into the array?
So is that one row in the table for each element in the array?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.