My Sql Table Update?


Davarius

Recommended Posts

I have setup DF to Log with MySQL and I am having problems figuring out why the table does not update

when adding a new channel to the log set. I am not familiar with SQL Databases or logging to them. I followed along the lines posted in some of the forum topics. The logging does work and i dont get any errors but if I were to add a new channel and then add that channel to the log set I do not see it in the table of the MySQL query browser and it also seems that all of the other data stops updating or logging for that matter(still no errors in DF). However if I write a new table name in daqfactory the new table is created and updates as expected(including the newly added channel) until I repeate the process and add a new channel to the set.

-Is there something I missed or that I am doing wrong?

-Is there some configuration needed to allow daqfactory to add channels to the current table without having to create a new table just to add a channel or two.

-Also why does DF "silently" stop writting the data until I "set the new table".

Link to comment
Share on other sites

ODBC logging through the logging set does not add new fields to the table. It creates the table initially, but then expects the channels to remain the same. If it changes, the SQL command sent internally will fail and logging will essentially stop. It stops silently because otherwise it would generate a huge stream of errors since its failing rapidly and consistantly retrying. Remember, many users of DAQFactory run unattended and 24x7, so a constant stream of error messages would be a significant issue.

If you add new channels to an ODBC logging set you have three choices:

1) add the field manually to the table in your database (from outside DAQFactory). Just make sure and use the same data types DAQFactory did for your other channels and make sure the field name matches up

2) delete the existing table and DAQFactory will recreate it with the new channel

3) write to a different table (as you did).

Link to comment
Share on other sites

  • 2 months later...

I am back to dealing with the MySQL database and I am finding that after I set a database up for logging I get a random number of days of actual values and then filled with Null for each entry after that, until I create a new table to try again. DAQ applications are for customer use and I log in remotely at times to check up on things, so they may have closed and restarted DAQ any time after initial setup. I think closing the application might be throwing things off seeing as one customer may have gotten 5 days of data with no Null's and another 3 days of data. My settings are to only take a snapshot -fixed interval -120 seconds. SQL settings are default with the exception of Date field changed to "DOUBLE". Has any one else encountered this problem? Any suggestions or possible causes?

Link to comment
Share on other sites

I think I found the problem. After trying some things out, I see that my data doesn't always come in at a fast rate. I created a new table and set DAQ to log every 10 seconds but still got null values. I added a value manually in DAQ to a channel since it was updating kind of slow and then saw that particular channel no longer had null starting from the time I did the manual add. The rest of the channels that had not updated yet still contained null values. I remember seeing that DAQ logs when a new value comes in. In my case it seems as DAQ begins to log, no new data comes in either at all or within the interval I set for logging which makes that snapshot null, so could that be it?

Link to comment
Share on other sites

Yes the system just starts sending lots of nulls. Essentially what I get is a window of data with the rest of the data filled with nulls.

In addition:

On Friday I started a new table of data where the same thing happened again. I checked to see if data was being logged to the table with the Mysql query tool and it was. I checked again this morning (Monday) and get a table of nulls after some scattered values shortly after starting the set on Friday. This time I noticed that the time column stops 20 minutes after i created the set, so guess there was an error or something and the log set just stopped. I am having a hard time figuring this one out. I tried taking the daq application as is and running here locally on my pc. I Created the same Mysql Environment and watched the log grow no matter what snapshot interval I used or on the fly changes I made. However, the difference is that I was using a test sequence to stuff values into the channels rather than the actual method. At the customers pc, if I query or change the interval with DAQ running it seems like the log quits putting data in the table, although there may be no relation what so ever to me doing so.

Link to comment
Share on other sites

  • 2 weeks later...

Yup, pretty weird. Try seeing if just restarting DAQFactory is what triggers the problem. I'd also consider NOT using excel time since you are logging to MySQL, not excel or access.

The weird part is that it appears the time is logged, but nothing else. DF uses a single query to log all the columns and MySQL isn't going to know the difference between the first column and other columns. Try looking in the MySQL log files and see if it is showing an errors.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.