<< Click to Display Table of Contents > 

Client Control Interface Manual > Inputs and Outputs

Inputs and Outputs
Previous pageReturn to chapter overviewNext page

The following commands can be used to directly control inputs and outputs.

Get Inputs

Get Outputs

IO Control Object (ScWaitForInput and ScSetOutput) Properties

Set Outputs

Get Output Inversions

Set Output Inversions

 

Get Inputs

Set

Get

DLL Function

int Input_States = ScGetLongValue(int Value_Type)

ASCII Function

int Input_States = ScCciGetLongValue(int Value_Type)

Description

This function is used to get the input states of the Opto_Ins and Digi_Ins.

Value_Type

Type: int

ID:

Location: ScComSAMLightClientCtrlValueTypes

scComSAMLightClientCtrlLongValueTypeOptoIO

4

Input_States

Type: int

Unit: none

Input_States is a decimal number that is best understood binary:

The bits represent an input state (blue), inactive (0) or active (1). Some bits are undefined (gray). Which bit represents which input depends on the hardware and is shown below.

 

USC-1:

0000_0000_0000_0000_0000_0000_0010_0000

                               |     ╰Opto_In_0

                               ╰Opto_In_5

 

USC-2/-3:

0000_0000_0000_0000_0000_0000_0010_0000

               | | |          ||     ╰Opto_In_0

               | | |          |╰Opto_In_5

               | | |          ╰Digi_In_0

               | | ╰Digi_In_9

               | ╰Stepper_In_0

               ╰Stepper_In_2

 

RTC3/4/5/6:

0000_0000_0000_0000_0000_0000_0010_0000

                   |                 ╰Digi_In_0

                   ╰Digi_In_15

 

Alternative mathematical representation of unsigned Input_States:

 

 

 

Notes

Should be called >100ms after Outputs have been set.

An programming example to get a single input can be found here.

C# Example: Get input states:

 

int Input_States = cci.ScGetLongValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeOptoIO);

Example: Interpret USC input states 32:

(32)dec = (0000 0000 0010 0000)bin → Opto_In_5 is active, all other inputs are inactive.

Table 253: Get Inputs

Get Outputs

Set

Get

DLL Function

int Output_States = ScGetLongValue(int Value_Type)

ASCII Function

int Output_States = ScCciGetLongValue(int Value_Type)

Description

This function is used to get the output states of the Opto_Outs and Digi_Outs.

Output_States

Type: int

Unit: none

Output_States is a decimal number that is best understood binary:

The bits represent an output state (blue), inactive (0) or active (1). Some bits are undefined (gray). Which bit represents which output depends on the hardware and is shown below.

 

USC-1:

0000_0000_0000_0000_0000_0000_0000_1000

                               |     ╰Opto_Out_0

                               ╰Opto_Out_5

 

USC-2/-3:

0000_0000_0000_0000_0000_0000_0000_1000

|       |   |     | |          ||     ╰Opto_Out_0

|       |   |     | |          |╰Opto_Out_5

|       |   |     | |          ╰Digi_Out_0

|       |   |     | ╰Digi_Out_9

|       |   |     ╰Stepper_Out_0

|       |   ╰Stepper_Out_5

|       ╰Laser_Port_0

╰Laser_Port_7

Alternative mathematical representation of unsigned Ouput_States:

 

 

 

Value_Type

Type: int

ID:

Location: ScComSAMLightClientCtrlValueTypes

scComSAMLightClientCtrlLongValueTypeGetOptoOut

31

Notes

USC cards only.

USC-1 does not have Digi_Outs.

Should be called >100ms after Outputs have been set.

Do not misunderstand the name of the command, you can also get Digi_Outs.

An programming example to get a single output can be found here.

C# Example: Get output states:
 
int Output_States = cci.ScGetLongValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeGetOptoOut);

Example: Interpret USC output states 16:

(16)dec = (0000 0000 0001 0000)bin → Opto_Out_4 is active, all other outputs are inactive.

Table 254: Get Outputs

Set Outputs

Set

Get

DLL Function

int CCI_Return = ScSetLongValue(int Value_Type, int Output_States)

ASCII Function

int CCI_Return = ScCciSetLongValue(int Value_Type, int Output_States)

Description

This function is used to set the output states of the Opto_Outs and Digi_Outs.

Value_Type

Type: int

ID:

Location: ScComSAMLightClientCtrlValueTypes

scComSAMLightClientCtrlLongValueTypeOptoIO

4

Output_States

Type: int

Unit: none

Output_States is a 32 bit signed integer that is best understood binary:

The first 16 bits represent a mask of the outputs (red), telling which output should be changed (0) or unchanged (1). The last 16 bits represent the desired state of the output (blue), inactive (0) or active (1). Some bits are undefined (gray). Which bit represents which output depends on the hardware and is shown below.

 

USC-1:

1111_1111_1111_0111_0000_0000_0000_1000

           |     |             |     ╰State Opto_Out_0

           |     |             ╰State Opto_Out_5

           |     ╰Mask Opto_Out_0

           ╰Mask Opto_Out_5

 

USC-2/-3:

1111_1111_1111_0111_0000_0000_0000_1000

|          ||     | |          ||     ╰State Opto_Out_0

|          ||     | |          |╰State Opto_Out_5

|          ||     | |          ╰State Digi_Out_0

|          ||     | ╰State Digi_Out_9

|          ||     ╰Mask Opto_Out_0

|          |╰Mask Opto_Out_5

|          ╰Mask Digi_Out_0

╰Mask Digi_Out_9

 

RTC3/4/5/6:

1111_1111_1111_0111_0000_0000_0000_1000

|                 | |                 ╰State Digi_Out_0

|                 | ╰State Digi_Out_15

|                 ╰Mask Digi_Out_0

╰Mask Digi_Out_15

 

Alternative mathematical representation of unsigned Output_States:

 

 

 

 

CCI_Return

Type: int

CCI return number, see error list.

Notes

Opto_Out 0 can not be influenced by this command, since it is reserved for the mark in progress flag.

An programming example to set a single output can be found here.

Only output states where the associated mask is 0 have an effect.

If a output is used somewhere else (like status outputs, red pointer, stepper motion, etc.) the output will be overwritten when the event occurs.

C# Example: Set USC Opto_Out_3 active and keep all other outputs in their current state:

uint Output_States = 0b_1111_1111_1111_0111_0000_0000_0000_1000;

// Decimal 4294377480 as uint32 and -589816 as int32.

int CCI_Return = cci.ScSetLongValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeOptoIO, (int) Output_States);

Table 255: Set Outputs

Get Output Inversions

Set

Get

DLL Function

int Output_Inversions = ScGetLongValue(int Value_Type)

ASCII Function

int Output_Inversions = ScCciGetLongValue(int Value_Type)

Description

Get the inversion states of outputs on USC-2/-3 cards.

Value_Type

Type: int

ID:

Location: ScComSAMLightClientCtrlValueTypes

scComSAMLightClientCtrlLongValueTypeOptoOutInvert

124

Output_Inversions

Type: int

Unit: none

Output_Inversions is a decimal number that is best understood binary:

The bits represent an output inversion state (blue), normal (0) or inverted (1). Some bits are undefined (gray). Which bit represents which output inversion is shown below.

 

USC-2/-3:

0000_0000_0000_0000_0000_0000_0000_0101

           |     | |          ||     ╰Inversion State Opto_Out_0

           |     | |          |╰Inversion State Opto_Out_5

           |     | |          ╰Inversion State Digi_Out_0

           |     | ╰Inversion State Digi_Out_9

           |     ╰Inversion State Stepper_Out_0

           ╰Inversion State Stepper_Out_5

 

Alternative mathematical representation of unsigned Ouput_Inversions:

 

 

 

 

CCI_Return

Type: int

CCI return number, see error list.

Notes

-

C# Example: Get output inversion states:

 

int Output_Inversion = cci.ScGetLongValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeOptoOutInvert);

Example: Interpret USC output inversion states 5:

(5)dec = (0000 0000 0000 0101)bin → Inversion states of Opto_Out_0 and Opto_Out_2 are active, all other inversion states are inactive.

Table 256: Get Output Inversions

Set Output Inversions

Set

Get

DLL Function

int CCI_Return = ScSetLongValue(int Value_Type, int Output_Inversions)

ASCII Function

int CCI_Return = ScCciSetLongValue(int Value_Type, int Output_Inversions)

Description

Set or get the inversion states of outputs on USC-2/-3 cards.

Value_Type

Type: int

ID:

Location: ScComSAMLightClientCtrlValueTypes

scComSAMLightClientCtrlLongValueTypeOptoOutInvert

124

Output_Inversions

Type: int

Unit: none

Output_Inversions is a 32 bit signed integer that is best understood binary:

The first 16 bits represent a mask of the output inversions (red), telling which output inversion should be changed (0) or unchanged (1). The last 16 bits represent the desired state of the output inversion (blue), normal (0) or inverted (1).

 

USC-2/-3:

1111_1111_1100_0000_0000_0000_0011_1111

|          ||     | |          ||     ╰Inversion State Opto_Out_0

|          ||     | |          |╰Inversion State Opto_Out_5

|          ||     | |          ╰Inversion State Digi_Out_0

|          ||     | ╰Inversion State Digi_Out_9

|          ||     ╰Mask Opto_Out_0

|          |╰Mask Opto_Out_5

|          ╰Mask Digi_Out_0

╰Mask Digi_Out_9

 

Alternative mathematical representation of unsigned Ouput_Inversions:

 

 

 

 

CCI_Return

Type: int

CCI return number, see error list.

Notes

-

C# Example: Invert all Opto_Outs and keep the inversion states of the Digi_Outs in their current state:

 

uint Output_Inversion = 0b_1111_1111_1100_0000_0000_0000_0011_1111;

// Decimal 4290773055 as uint32 and -4194241 as int32.

int CCI_Return = cci.ScSetLongValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeOptoOutInvert, (int)Output_Inversion);

Table 257: Set Output Inversions