beautypg.com

7 fieldbus data – Rice Lake iRite IDE User Manual

Page 67

background image

920i

Programming Reference - API Reference

63

SysCode values returned:

SysInvalidRequest

The slot and bit assignment specified is not a valid digital input.

SysOK

The function completed successfully.

Example:
DIGINS0B3 : Integer;

GetDigin (0, 3, DIGINS0B3);

WriteLn (Port1, "Digin S0B3 status is", DIGINS0B3);

GetDigout

Sets V to the value of the digital output assigned to slot S, bit D. GetDigout sets the value of V to 0 if the output is
on, to 1 if the output is off. Note that the values returned are the reverse of those used when setting an output with
the SetDigout function.

Method Signature:
function GetDigout (S : Integer; D : Integer; VAR V : Integer) : SysCode;

Parameters:

[in]

S

Slot number

[in]

D

Bit number

[out]

D

Digital output status

SysCode values returned:

SysInvalidRequest

The slot and bit assignment specified is not a valid digital output.

SysOK

The function completed successfully.

Example:
DIGOUTS0B2 : Integer;

GetDigout (0, 2, DIGOUTS0B2);

WriteLn (Port1, "Digout S0B2 status is", DIGOUTS0B2);

SetDigout

Sets value of the digital output assigned to slot S, bit D, to the value specified by V. Set V to 1 to turn the
specified output on; set V to 0 to turn the output off.

Method Signature:
function SetDigout (S : Integer; D : Integer; V : Integer) : SysCode;

Parameters:

[in]

S

Slot number

[in]

D

Bit number

[in]

D

Digital output status

SysCode values returned:

SysInvalidRequest

The slot and bit assignment specified is not a valid digital output.

SysOutOfRange

The value

V

must be 0 (inactive) or 1 (active).

SysOK

The function completed successfully.

Example:
DIGOUTS0B2 : Integer;

DIGOUTS0B2 := 0;

SetDigout (0, 2, DIGOUTS0B2);

5.7

Fieldbus Data

BusImage

BusImage is a data type to allow a user program to pass integer data to and from a fieldbus.

Method Signature:
type BusImage is array[32] of integer;

This manual is related to the following products: