Cicode Programming Reference > Cicode Function Categories > Device Functions Introduction > DevDisable

DevDisable

Disables (and re-enables) a device from all access, and discards any data written to the device. When a device is disabled, it cannot be opened, and data cannot be read from the device. Use this function to disable logging to a database or printer.

The State argument is a toggle. A State of 1 disables the device(s), but you can then re-enable the device(s) by repeating the function with State = 0.

Syntax

DevDisable(sName, State)

sName:

The device name, or * (asterisk) for all devices.

State:

The disable state:

0 - Enable the device.

1 - Disable the device.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

DevOpen

Example

! Disable the AlarmLog device.
DevDisable("AlarmLog",1);
:
DevDisable("AlarmLog",0); ! Re-enable the device.

See Also

Device Functions