# Ignition to read Citect dbf file

**URL:** <https://forum.inductiveautomation.com/t/ignition-to-read-citect-dbf-file/79505>\
**Category:** Ignition\
**Created:** [September 22, 2023, 1:43pm UTC](https://forum.inductiveautomation.com/t/ignition-to-read-citect-dbf-file/79505 "2023-09-22T13:43:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [September 22, 2023, 1:43pm UTC](https://forum.inductiveautomation.com/t/ignition-to-read-citect-dbf-file/79505/1 "2023-09-22T13:43:46Z")

</div>

The citect SCADA is using DBF files to store some data.  
Is it possible to use ignition to read the DBF files.

There is a python module that can read the file. It works by importing the module and call it in the script.  
[https://dbfread.readthedocs.io/en/latest/](https://dbfread.readthedocs.io/en/latest/)

Not sure whether there's an ignition device module that can be used to read the file directly.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 22, 2023, 2:01pm UTC](https://forum.inductiveautomation.com/t/ignition-to-read-citect-dbf-file/79505/2 "2023-09-22T14:01:51Z")

</div>

Not a device driver, a database driver:

> [@JDBC Driver for DBF files (Sesame Software)](https://forum.inductiveautomation.com/t/jdbc-driver-for-dbf-files-sesame-software/22311):
>
> Hi All, Life has a way of repeating itself… 8 years ago I started a thread about a DBF driver that helped me and a few others connect to a FoxPro database. [http://forum.inductiveautomation.com/t/connecting-to-visual-foxpro-database-dbc-file/2531](http://forum.inductiveautomation.com/t/connecting-to-visual-foxpro-database-dbc-file/2531) Now, 2200 miles away, 8 years older (but only a couple years wiser), I am doing a project where I need to connect to a 20-year old extruder running a dBase database on board. Guess what I needed again? A JDBC driver for DBF. Turns out the old one I us…

---

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [September 22, 2023, 11:39pm UTC](https://forum.inductiveautomation.com/t/ignition-to-read-citect-dbf-file/79505/3 "2023-09-22T23:39:05Z")

</div>

I see. It is not considered as a device but a db.  
Citect has another file called cdk, it looks like no way to reas this file except from using cicode.

---

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [October 1, 2023, 7:38am UTC](https://forum.inductiveautomation.com/t/ignition-to-read-citect-dbf-file/79505/4 "2023-10-01T07:38:52Z")

</div>

I found the following solution works well.

1. Using pycharm or vscode to write and test the script.
2. using dbf module.  
[dbf · PyPI](https://pypi.org/project/dbf/)
3. write and test script to read/write dbf module.
4. using python 3 to call the script from ignition, the script does not work if directly calling from ignition.  
[https://support.inductiveautomation.com/hc/en-us/articles/360056397252-Python-In-Ignition](https://support.inductiveautomation.com/hc/en-us/articles/360056397252-Python-In-Ignition)

refer to the other post for a bit more details about the issue if using ignition directly to call the dbf module.

> [@Issue with Read/Write DBF datafile using dbf module](https://forum.inductiveautomation.com/t/issue-with-read-write-dbf-datafile-using-dbf-module/79722/3):
>
> Spent 2 days troubleshooting the issue and went down to the module details. I found the table write function is not working under ignition, but working using python 3.x. Not sure whether it's the issue with Jython2.7. Anyway, instead of troubleshooting it further, I went alternative way, to call the external python 3 to run the script instead. Issue resolved. Here's the link for calling python3 from ignition.

---

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [October 1, 2023, 7:43am UTC](https://forum.inductiveautomation.com/t/ignition-to-read-citect-dbf-file/79505/5 "2023-10-01T07:43:44Z")

</div>

You can still call the dbf read function from ignition directly.  
Only the write function is not working well, at least to me.
