Sign in to follow this  
Followers 0
Carlo

CITECT- wanna log data to *.dbf/excel/Ms Acces

14 posts in this topic

Hi all, i'm new with citect. i want to log current recipe value of a machine with citect. I try to log the data to a *.dbf file but i only cloud log 8 tags and not more. do somebody have a idea how to expand this or a better idea to log data. i have like 30 tags that i wanna log Thanks in advance

Share this post


Link to post
Share on other sites
Make an device, and just keep on going the {Col} it will make a column for every tag then.

Share this post


Link to post
Share on other sites
Then just make activate a Cicode that looks like this. Col1 = Your tag that you whant to logg FUNCTION db() INT hDEV; !! Open!!! hDev = DevOpen("Database1"); !! Write !! DevWrite(hDev,Col1); DevWrite(hDev,Col2); DevWrite(hDev,Col3); !! Close !! DevClose(hDev); END i think this will write your tags to diffrent colums on a *.dbf file everytime you activate the script! It will make a new row for every time, test and try!

Share this post


Link to post
Share on other sites
yep this work thanks, but only you can write 13 tags in excel sheet not more :s. do you know i kan expand that. Becaus in the device format you can't fill more then {col13}

Share this post


Link to post
Share on other sites
Write a script to combine a lot of values in one {Col}, or just multiple Devices? Otherwise i guess SQL vould be better, but then you need to setup an server for that! :)

Share this post


Link to post
Share on other sites
argggg never work with SQL before........... do you need the full program or can you use expression edition

Share this post


Link to post
Share on other sites
You can use MySQL - it's free, and it works!

Share this post


Link to post
Share on other sites
aa thanks i will try to set up a server

Share this post


Link to post
Share on other sites
If you use the MySQL ODBC driver, communication with Citect should be just as easy as writing to a DBF... Let me know if you need any more help, I've just finished a project with Citect and MySQL myself

Share this post


Link to post
Share on other sites
if you could give a start how to set up the communication between the MySQL and Citect i'm using citect v7.2

Share this post


Link to post
Share on other sites
First you must configure the database and add the required tables and users, you may use HeidiSQL to do this: http://www.heidisql.com/ Let me know if you need help with the initial setup of the server/database. Then you must download and install the MySQL ODBC Connector: http://dev.mysql.com/downloads/connector/odbc/ The ODBC configuration is usually located in Administrative Tools in Control Panel, you may find various examples here: http://dev.mysql.com/doc/refman/5.1/en/connector-odbc-examples.html I may post a screenshot of my ODBC setup tomorrow In Citect we then use SQLConnect and SQLExec to interact with the database, I can post some examples when I get back to work tomorrow
1 person likes this

Share this post


Link to post
Share on other sites
thanks for the help i setup a datebase i can log to it. Only 1 problem the maximum (parameter) of the total lenght cicode expression is 255 characters i will never going to reach the 30 colums :(

Share this post


Link to post
Share on other sites
I use SqlAppend, just as described in the KnowledgeBase (Q3773) SQLSet(hSQL, "SELECT *") SQLAppend(hSQL, " FROM EMP"); SQLAppend(hSQL, " ORDER BY last_name"); SQLExec(hSQL, ""); Edited by Fredrix

Share this post


Link to post
Share on other sites
Hi, Could anyone help me doing this step by step since i have a little knowledge in sql database.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0