Communication setup with Cicode/CitectVBA

F

Thread Starter

fahid

Dear List Members,

Can we create/manage I/O servers, I/O devices, tags using CiCode or CitectVBA? i.e. in the Citect scada there is one express communication wizard with which we can easily configure the communication part. I would like to know whether we can do the same thing using Cicode or CitectVBA. I have one more doubt. Is it possible to create genies and super genies using CiCode or CitectVBA. Can any one help me please?
 
F

Fredrik Bamsrud

Hi,

Most of the communication settings, boards, tags, ports etc is listed in .dbf files in the Citect project folder. This information can be changed with Cicode. However, there is one disadvantage. After changing these settings, the system needs to be recompiled and restarted. However, if this is ok in you application, the .dbf files can be accessed by:

1. Add the spesific .dbf file to your project, as a dBase_dev.

2. Write a Cicode - script that:

a. Opens the device using the DevOpen() function

b. Selects the first line in the .dbf file using the DevFirst() function

c. Scans trough the .dbf file using DevGetField() to compare against the value you are serching for, and DevNext() to jump to next line. Example:

DevFirst(iHnd_dbf);
WHILE NOT DevEOF(iHnd_dbf) AND NOT iFound DO
sName = DevGetField(iHnd_dbf, "ColumnName");
IF sName = sCorrectName THEN
iFound = 1;
ELSE
DevNext(iHnd_dbf);
END
END

3. Change the wanted parameter by using the DevSetField() function

4. Close the .dbf file using the DevClose() function.

5. Application must be recompiled and restarted.

Hope this can help you.

Regards,

Fredrik
 
Top