State.ReaStatusStd



ReaStatusStd() As Long
ED
avaliable
RT
read only

Remarks

The ReaStatusStd DWORD specifiecs which state bits are set.

e.g. ReaStatusStd = &H40000 (Hex-Value) means that the I-BIT is set TRUE.

Hint: Depending on the ReaStatusMaskeStd the bits will be checked or ignored.

In order to use state driven trigger (no triggering on edges) for the MultiBinary Rema, the ReaStatusFlankeStd has to be set to &h0.

To set more than one state bit, ORing (logical OR) have to be applied.

e.g. ReaStatusStd = &H100 Or &H4 'SELEC + ST_M3 are set TRUE

State bits

The following table gives an overview of common state bits.
Name Description
Bit number
Hex value
ST_M1 User status bit 1
0
0x00000001
ST_M2 User status bit 2
1
0x00000002
ST_M3 User status bit 3
2
0x00000004
ST_M4 User status bit 4
3
0x00000008
ST_M5 User status bit 5
4
0x00000010
ST_M6 User status bit 6
5
0x00000020
ST_M7 User status bit 7
6
0x00000040
ST_M8 User status bit 8
7
0x00000080
SELEC Select bit
8
0x00000100
REV Revision bit
9
0x00000200
DIREC Desired direction bit
10
0x00000400
RTE Runtime exceeded bit
11
0x00000800
I-BIT Invalid bit
18
0x00040000
N_UPD Switched off bit
20
0x00800000
DM_TR Default message trafo value bit
24
0x01000000
RM_TR Run message trafo value bit
25
0x02000000
AVALUE Alternative value bit
27
0x08000000

Sample


Sub zenOn_CreateAnalogRema()
	Dim zRema As Rema
	Dim zState As State

	'Create a new analog Rema
	Set zRema = MyWorkspace.ActiveDocument.Remas.Create(tpAnalog, "zenOn_TestRema")
	'Create a new state
	Set zState = zRema.CreateState

	'***************************************************************
	'* Set the I-Bit TRUE										*
	'* I-Bit Bit18												 *
	'* Hint: I-Bit TRUE  -> Hex-Value 0x00|04|0000				 *
	'*								 /	\					*
	'*					Binary  ..0|00000100|0..			 *
	'*															 *
	'*	 I-Bit FALSE -> Hex-Value 0x00000000				 *
	'***************************************************************

	'Set the I-Bit TRUE
	zState.ReaStatusStd = &H40000
	'Set the StateMask for the I-Bit
	'Hint: Hex-Value: 0x00040000 -> only I-Bit will be checked
	zState.ReaStatusMaskeStd = &H40000

	'***************************************************************
	'* Check if the ST_M1 is FALSE								 *
	'* ST_M1 Bit0												*
	'* Hint: ST_M1 TRUE  -> Hex-Value 0x000000| 01				 *
	'*									 /	 \			 *
	'*					Binary	 ..0|00000001			*
	'*	 ST_M1 FALSE -> Hex-Value 0x00000000				 *
	'***************************************************************

	'Set the ST_M1 FALSE
	zState.ReaStatusStd = &H0

	'Set the StateMask for the ST_M1 bit
	'Hint: Hex-Value: 0x00000001 -> only ST_M1 will be checked
	zState.ReaStatusMaskeStd = &H1

	'***************************************************************
	'* Check both state bits									 *
	'* Combining with ORing (logical OR)						 *
	'***************************************************************

	'Set the I-Bit TRUE + the ST_M1 bit FALSE
	zState.ReaStatusStd = &H40000 Or &H0
	'zState.ReaStatusStd = &H40000 // because ORing with &H0 will not change any bits

	'Check the I-Bit + the ST_M1 bit, ignore all other bits
	zState.ReaStatusMaskeStd = &H40000 Or &H1 '=&H40001

End Sub






See Also

State