VisionBox .NET Library  1.7.10.0 (2024-04-16)
VIB_NET::RS422 Class Reference
+ Inheritance diagram for VIB_NET::RS422:

Detailed Description

This class controls the RS-422 interface.


See class VIB::Rs422 in the VisionBox Interface Library for a detailed description.

Examples

Public Types

enum  eOUT_SOURCE
 Source definitions for the RS-422 output signals, used by SetSource() More...
 

Public Member Functions

Boolean GetBit (UInt32 BitIndex)
 Reads the state of one input. More...
 
void Reset ()
 Resets the device to default settings. More...
 
 RS422 ()
 Default constructor for the device object More...
 
void SetBit (UInt32 BitIndex, Boolean OnOff)
 Sets the state of one output. More...
 
void SetSource (UInt32 BitIndex, eOUT_SOURCE Source, bool InvertOutput)
 Sets the source for an output signal. More...
 
- Public Member Functions inherited from VIB_NET::iDevice
void Close ()
 Closes a device More...
 
bool isOpen ()
 Returns the open state of a device object More...
 
void Open ()
 Opens a device More...
 
void Open (unsigned int Index)
 Opens a device More...
 

Properties

UInt32 Input [get]
 Reads the state of the input signals. More...
 
UInt32 NumberOfInputs [get]
 Contains the number of input signals. More...
 
UInt32 NumberOfOutputs [get]
 Contains the number of output signals. More...
 
UInt32 Output [set]
 Sets the state of the output signals. More...
 
virtual VIB_NET::eDEVICE_TYPE Type [get]
 Returns the device type for the current instance, see eDEVICE_TYPE More...
 
- Properties inherited from VIB_NET::iDevice
virtual VIB_NET::eDEVICE_TYPE Type [get]
 Returns the device type for the current instance, see eDEVICE_TYPE More...
 

Member Enumeration Documentation

◆ eOUT_SOURCE

Source definitions for the RS-422 output signals, used by SetSource()

Enumerator
REGISTER 

Controlled with Output / SetBit() (default)

MUX_OUT0 

Multiplexer Output 0.

MUX_OUT1 

Multiplexer Output 1.

MUX_OUT2 

Multiplexer Output 2.

MUX_OUT3 

Multiplexer Output 3.

MUX_OUT4 

Multiplexer Output 4.

MUX_OUT5 

Multiplexer Output 5.

MUX_OUT6 

Multiplexer Output 6.

MUX_OUT7 

Multiplexer Output 7.

MUX_OUT8 

Multiplexer Output 8.

MUX_OUT9 

Multiplexer Output 9.

MUX_OUT10 

Multiplexer Output 10.

MUX_OUT11 

Multiplexer Output 11.

MUX_OUT12 

Multiplexer Output 12.

MUX_OUT13 

Multiplexer Output 13.

MUX_OUT14 

Multiplexer Output 14.

MUX_OUT15 

Multiplexer Output 15.

MUX_OUT16 

Multiplexer Output 16.

MUX_OUT17 

Multiplexer Output 17.

MUX_OUT18 

Multiplexer Output 18.

MUX_OUT19 

Multiplexer Output 19.

MUX_OUT20 

Multiplexer Output 20.

MUX_OUT21 

Multiplexer Output 21.

MUX_OUT22 

Multiplexer Output 22.

MUX_OUT23 

Multiplexer Output 23.

Constructor & Destructor Documentation

◆ RS422()

VIB_NET::RS422::RS422 ( )

Default constructor for the device object

The device must be opened with Open() before it can be used.

Member Function Documentation

◆ GetBit()

Boolean VIB_NET::RS422::GetBit ( UInt32  BitIndex)

Reads the state of one input.

Parameters
BitIndexInput signal index, 0 ... (NumberOfInputs - 1)
Returns
State of the input
Example:
C#: Rs422_Example.cs
Visual Basic: Rs422_Example.vb

◆ Reset()

void VIB_NET::RS422::Reset ( )

Resets the device to default settings.

See also VIB::Rs422::Reset().

◆ SetBit()

void VIB_NET::RS422::SetBit ( UInt32  BitIndex,
Boolean  OnOff 
)

Sets the state of one output.

Parameters
BitIndexOutput signal index, 0 ... (NumberOfOutputs - 1)
OnOffOutput value: on or off
Example:
C#: Rs422_Example.cs
Visual Basic: Rs422_Example.vb

◆ SetSource()

void VIB_NET::RS422::SetSource ( UInt32  BitIndex,
RS422::eOUT_SOURCE  Source,
bool  InvertOutput 
)

Sets the source for an output signal.

For setting the output value manually with Output or SetBit(), the source eOUT_SOURCE::REGISTER has to be selected (default).

Note
The VisionBox AGE-X1 doesn't have a Multiplexer and therefore doesn't support this function
Parameters
BitIndexOutput signal index, 0 ... (NumberOfOutputs - 1)
Sourcesource for the line
InvertOutputtrue = invert line

Property Documentation

◆ Input

VIB_NET::RS422::Input
get

Reads the state of the input signals.

The value is the binary representation of the signals, LSB is BIT0.

Example:
C#: Rs422_Example.cs
Visual Basic: Rs422_Example.vb

◆ NumberOfInputs

VIB_NET::RS422::NumberOfInputs
get

Contains the number of input signals.

◆ NumberOfOutputs

VIB_NET::RS422::NumberOfOutputs
get

Contains the number of output signals.

◆ Output

VIB_NET::RS422::Output
set

Sets the state of the output signals.

Parameters
ValBits 0..15: Binary representation of outputs. The actual number of available outputs is hardware dependent.
Bits 16..31: Mask bits can be used to change only certain outputs. This is particularly useful to control certain outputs by different threads.
If the upper 16 bits of Val are set to zero, all outputs will be set.
Example:
C#: Rs422_Example.cs
Visual Basic: Rs422_Example.vb
Example:
//change BIT0 & BIT1 to on, all other to off
pRS422.Output = (0x3)
//turn BIT1 off, BIT0 stays on
pRS422.Output = ((1<<(16+1)) | 0x00)

◆ Type

VIB_NET::RS422::Type
get

Returns the device type for the current instance, see eDEVICE_TYPE