Applies To:
  • CitectSCADA 3.x, 4.x

Summary:
How do I configure an SQL device in Citect to point to a MS access database (.mdb file) 

Solution:
Before using an SQL device its important that the ODBC driver has been installed in the PC.
  • Citect Version 3 - 16 bit ODBC Drivers
  • Citect Version 4 - 32 bit ODBC Drivers

Following is an example on how to configure the devices form in the project editor:

Comments
Name: Recipe Any name.
Format: {name}{quantity} Don't need to put the column width (but advisable - See Note1 below)
Header: DSN=Recipefile The ODBC connetion string (add UID and PWD if required).
File Name: tblRecipeIngredients See Note2 & Note3 below.
Type: SQL_DEV

Note1: Its advisable to put the field lengths. The field lengths will avoid problems if the table is written to from Citect, because Citect will truncate fields of unknow length to 8 characters when they are written via an SQL device.

Note2: Its important that the MS access database should also contain a table named tblRecipeIngredients (and not RecipeIngredients !). This specifies the table in MS access database.

Note3: If logging alarms directly to an SQL device - The table must have fields of the same name as Citect

eg :
{Tag}{Name}{Deviation}
not {Tag}{Name}{Dev}

Note4: Reports can be logged directly to an SQL Device if they are simply one line

eg : {IngredientUsed:8}{QuantityUsed:4.3}
could be a report to log ingredient usage to an SQL device

Only the following Dev functions can be used on a SQL device: DevOpen(), DevClose(), DevFind(), DevGetField() and DevWrite()

When using the DevWrite() function, you must add a new record and write to all fields in the new record. No data is written to the database if you do not write to all fields.

 

Keywords:
 

Attachments