Applies To:
  • CitectSCADA 5.xx, 6.00, 6.00 Service Pack A

Summary:
I have set up a group of Devices in my CitectSCADA project and I want to be able to open these Devices using Cicode. What is the best way of doing this?
 

Solution:
DevOpenGrp(hGrp,nMode) can be used to open a group of Devices. The first argument to the function is a handle to a database containing a group of Devices. The second argument is the mode of the write. The possible values for mode are identical to that of DevOpen():

0 - Open the Device in shared mode - the default mode when opening a Device.
1 - Open the Device in exclusive mode. In this mode only one user can have the Device open at any given time. Opening the Device will fail if another user has the Device open in shared or exclusive mode.
2 - Open the Device in indexed mode. In this mode the Device will be accessed in index order. This mode is only valid if the Device is a database device and has an index configured in the Header field in the Devices form.
4 - Open the Device in 'SQL not select' mode. If opened in this mode, you must not attempt to read from an SQL device.
8 - Open the Device in logging mode. In this mode, history files will be created automatically.
16 - Open the Device in read only mode. In this mode data can be viewed, but not written. This mode is supported only by DBF and ASCII files - it is ignored by printers and SQL/ODBC databases.

The function returns 0 if successful, and -1 if the function was provided a bad handle and failed.

Please refer to Knowledge Base article Q2140 for an example of how this function can be used. 

Keywords:
Devices, Group  

Attachments