willsonrobert Posted December 16, 2013 Posted December 16, 2013 I am logging data from daqfactory on an XP to a MS SQL 2005 server on a 2008R2. The table is formatted correctly, and sometimes the data is actually logged. However, most of the time I get the following message: C1011 Could not create table for logging. Msg: There is already an object named 'xxxxxxxxx' in the database. Any help appreciated.
AzeoTech Posted December 16, 2013 Posted December 16, 2013 Any time DAQFactory logging gets an error back from the SQL request, it assumes the reason is that the table doesn't exist, so it tries to create the table. Since the table already exists, you end up seeing the error you mentioned. My guess is that you are logging strings in at least one field? And that sometimes those strings have the quote character in it (single or double).
willsonrobert Posted December 16, 2013 Author Posted December 16, 2013 Any time DAQFactory logging gets an error back from the SQL request, it assumes the reason is that the table doesn't exist, so it tries to create the table. Since the table already exists, you end up seeing the error you mentioned. My guess is that you are logging strings in at least one field? And that sometimes those strings have the quote character in it (single or double). I was trying to log a string data, but using a channel of type "Test". I fixed it, but now it would be nice to know how to log a string. I have a sequence that asks for user input: strlot_number = system.EntryDialog("Lot Number") LOT.AddValue(strlot_number) So, LOT is a channel that is type "Test", and when strings are entered, daqfactory displays the string fine, but I understand it really should only be numeric data. How can I get a channel that is designed for strings and can be logged as a string?
AzeoTech Posted December 16, 2013 Posted December 16, 2013 DAQFactory will log a string just fine. However, if that string has " or ' in it, it throws off the SQL query. You said it works sometimes. What values don't work? And I assume you have a Test String channel, not a Test A to D or other type.
willsonrobert Posted December 17, 2013 Author Posted December 17, 2013 DAQFactory will log a string just fine. However, if that string has " or ' in it, it throws off the SQL query. You said it works sometimes. What values don't work? And I assume you have a Test String channel, not a Test A to D or other type. Yes, that was it. Test String value now input strings to the database. Thank you!
AzeoTech Posted December 17, 2013 Posted December 17, 2013 Which was it? A quote in the string, or the I/O type for the Test channel wasn't set to "String"? Just want it clear in case someone else runs into the same problem.
willsonrobert Posted December 17, 2013 Author Posted December 17, 2013 Which was it? A quote in the string, or the I/O type for the Test channel wasn't set to "String"? Just want it clear in case someone else runs into the same problem. I/O type was set to Test - A to D. I changed it to Test - String and it worked fine. None of the strings I use have quotes in them, so that won't be a problem for me.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.