AGG Software Forums

Online Help Center => Data loggers and plug-ins => Topic started by: Transistor on April 15, 2014, 11:12:19 PM



Title: TCP/IP Logger SQL errors - passing ":P0, :P1, etc." instead of values.
Post by: Transistor on April 15, 2014, 11:12:19 PM
App: Advanced TCP/IP Logger.
Data export module: odbcexport.dll
The problem: "Data have been processed with errors." / "Writing to database temporarily disabled."
ODBC: Connection to SQL Server on a local server.

I've used the OPC data logger in a previous application so I know the basics. I'd say I'm very close to getting this app to work.

I have error logging configured as below:
Configure -> Modules -> Data Export -> odbcexport.dll -> Setup -> Errors Handling -> Reconnect and write a message to log file.

Here's what shows up in my log:

5/04/14 21:29:11 [192.168.31.151:9000,192.168.31.131:9000] SQLSVR. SQL:
INSERT INTO "Results" ("Date", "Time", "MachineID", "Product", "Weight")
VALUES (:P0, :P1, :P2, :P3, :P4)

Where are all the ":Px" values coming from? They should be the parsed data that I can see on the main window.

Many thanks.


Title: Re: TCP/IP Logger SQL errors - passing ":P0, :P1, etc." instead of values.
Post by: Arthur Grasin on April 16, 2014, 06:28:00 AM
You should bind your columns with the parser variables on the "Binding" page. In the OPC logger the parser is built-in and you don't need to configure it. In the TCP logger you may configure the ASCII Data Parser. Please, visit the Tutorials section:
http://www.aggsoft.com/tcpip-data-logger/tutorials.htm


Title: Re: TCP/IP Logger SQL errors - passing ":P0, :P1, etc." instead of values.
Post by: Transistor on April 16, 2014, 06:17:01 PM
Thanks for the reply. I had completed the bind but seemed to have an error in the Date and Time fields. For some reason these caused the error message but when I removed these fields it works OK.

As it turns out I don't need Date and Time as I'm have another field in the database called InsertTime which defaults to GETDATE(). This is better in my application as the server clock is much more likely to be accurate than my weigh scales!