<< Click to Display Table of Contents > Application |
![]() ![]() ![]() |
The following commands can be used to check the global state of the system. There is a subchapter for:
The following commands are described in this chapter: •Mode
|
---|
☒ Set ☐ Get |
||
---|---|---|
DLL Function |
int CCI_Return = ScExecCommand(int Cmd_ID) |
|
ASCII Function |
int CCI_Return = ScCciExecCommand(int Cmd_ID) |
|
Description |
Change the position and zoom level of the View2D. |
|
Cmd_ID |
Type: int |
ID: |
Location: ScComSAMLightClientCtrlExecCommandConstants |
||
scComSAMLightClientCtrlExecCommandFitViewToWorkingArea |
4 |
|
Fit the view to the working area. |
||
scComSAMLightClientCtrlExecCommandFitViewToAllEntities |
5 |
|
Fit the view to all entities. |
||
scComSAMLightClientCtrlExecCommandFitViewToSelectedEntities |
6 |
|
Fit the view only to selected entities. |
||
CCI_Return |
Type: int |
|
CCI return number, see error list. |
||
Notes |
- |
|
C# Example: Fit the view to the working area:
int CCI_Return = cci.ScExecCommand( ( int )ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandFitViewToWorkingArea ); |
Table 9: Change View2D
☒ Set ☐ Get |
||
---|---|---|
DLL Function |
int CCI_Return = ScExecCommand(int Cmd_ID) |
|
ASCII Function |
int CCI_Return = ScCciExecCommand(int Cmd_ID) |
|
Description |
SAMLight pops up a test message box to check the communication between the CCI application and SAMLight. |
|
Cmd_ID |
Type: int |
ID: |
Location: ScComSAMLightClientCtrlExecCommandConstants |
||
scComSAMLightClientCtrlExecCommandTest |
1 |
|
CCI_Return |
Type: int |
|
CCI return number, see error list. |
||
Notes |
•The message box that has to be closed manually. •The command returns after the message box is closed. |
|
C# Example: Check communication: int CCI_Return = cci.ScExecCommand( ( int )ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandTest ); |
Table 10: Check Communication
☒ Set ☐ Get |
|||
---|---|---|---|
DLL Function |
- |
||
ASCII Function |
int CCI_Return = ScCciTest(string Message) |
||
Description |
SAMLight pops up a cci test message box to check the communication between the CCI application and SAMLight. |
||
Message |
Type: string |
Unit: none |
|
This string will be part of the message in the message box. |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
•The command returns immediately. •The message box that has to be closed manually. |
||
ASCII Example: Send a test message to SAMLight:
ScCciTest("Test message.")<LF> |
Table 11: Connection Status
|
☒ Set ☒ Get |
||
---|---|---|---|
DLL Function |
int CCI_Return = ScSetLongValue(int Value_Type, int Value) int Value = ScGetLongValue(int Value_Type) |
||
ASCII Function |
int CCI_Return = ScCciSetLongValue(int Value_Type, int Value) int Value = ScCciGetLongValue(int Value_Type) |
||
Description |
Set or get the status of the entity list or property sheet in SAMLight. |
||
Value_Type |
Type: int |
ID: |
|
Location: ScComSAMLightClientCtrlValueTypes |
|||
scComSAMLightClientCtrlLongValueTypeShowEntityList |
99 |
||
Hide or show the Entity List. |
|||
scComSAMLightClientCtrlLongValueTypeShowPropSheet |
100 |
||
Hide or show the Property Sheet. |
|||
Value |
Type: int |
Unit: none |
|
•0: hide •1: show |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
- |
||
C# Example: Show entity list: |
|||
C# Example: Check if entity list is shown: int Entity_List_Status = cci.ScGetLongValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeShowEntityList ); |
Table 12: Entity List / Property Sheet
☒ Set ☒ Get |
|||
---|---|---|---|
DLL Function |
int CCI_Return = ScSetLongValue(int Value_Type, int Mode) int Mode = ScGetLongValue(int Value_Type) |
||
ASCII Function |
- |
||
Description |
Activates the extended error mode. |
||
Value_Type |
Type: int |
ID: |
|
Location: ScComSAMLightClientCtrlValueTypes |
|||
scComSAMLightClientCtrlLongValueTypeNewCciErrorReturn |
105 |
||
Mode |
Type: int |
Unit: none |
|
•0: Disable extended error mode. •1: Enable extended error mode. |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
•This only works for OCX and not for ASCII or COM. |
||
C# Example: Enable the extended error mode: |
|||
C# Example: Check the state of the extended error mode:
int Extended_Error_Mode = cci.ScGetLongValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeNewCciErrorReturn ); |
Table 13: Extended Error Mode
☒ Set ☐ Get |
||
---|---|---|
DLL Function |
int CCI_Return = ScExecCommand(int Cmd_ID) |
|
ASCII Function |
int CCI_Return = ScCciExecCommand(int Cmd_ID) |
|
Description |
Generate a Backup-Zip and save in <scaps>\intermed. |
|
Cmd_ID |
Type: int |
ID: |
Location: ScComSAMLightClientCtrlExecCommandConstants |
||
scComSAMLightClientCtrlExecCommandGenerateBackupZip |
76 |
|
CCI_Return |
Type: int |
|
CCI return number, see error list. |
||
Notes |
- |
|
C# Example: Generate Backup-Zip.
int CCI_Return = cci.ScExecCommand( ( int )ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandGenerateBackupZip ); |
Table 14: Generate Backup-Zip
☒ Set ☒ Get |
||
---|---|---|
DLL Function |
int CCI_Return = ScSetMode(int Mode) int CCI_Return = ScGetMode(ref int Mode) |
|
ASCII Function |
int CCI_Return = ScCciSetMode(int Mode) int Mode = ScCciGetMode() |
|
Description |
Set or get global SAMLight parameters by combining following flags. |
|
Mode |
Type: int |
Flag: |
Location: ScComSAMLightClientCtrlFlags |
||
- |
0x0 |
|
Disable the mode. |
||
scComSAMLightClientCtrlModeFlagTopLevelOnly |
0x1 |
|
The next calls only search for objects in the top level of the job. This can be helpful to increase the performance. |
||
scComSAMLightClientCtrlModeFlagDontUpdateView |
0x2 |
|
Suppress drawing of entities in the view or in the entity list. This can be helpful to increase the performance. |
||
scComSAMLightClientCtrlModeFlagDisableFileCompression |
0x10 |
|
Checks the check box Disable file compression in Settings → System → General. |
||
scComSAMLightClientCtrlModeFlagEntityNamesSeparatedBySemicolon |
0x20 |
|
Enabling this flag allows the ScSetEntityStringData() function to be used to set the string data of multiple entities in a single command. Entity_Names are separated by a semicolon (";" or 0x3B). Parameters are separated by a vertical tab (0x0B). The maximum size of individual strings via CCI TCP is 511 characters. |
||
scComSAMLightClientCtrlModeFlagDisableUndo |
0x4000 |
|
Checks the checkbox Disable Undo in Settings → System → General, which disables Undo function. |
||
scComSAMLightClientCtrlModeFlagArrayCopyAdapt |
0x8000 |
|
ArrayCopy of a serial number results in an array of serial numbers where the copies are enumerated from the number of the original one up to n. If not checked all copies will get the same number as the original one. |
||
scComSAMLightClientCtrlModeFlagArrayCopyAssociate |
0x10000 |
|
This function is useful for creating multiple serial numbers with a complex sequence. If checked the ArrayCopy of two and more different serial numbers results in one serial so that no serial number gets repeated. This check button is only enabled if Adapt is selected and association is possible. Creating one serial after an array copy is only possible if the actual values of the current serial differ in a constant step. |
||
scComSAMLightClientCtrlModeFlagArrayPolarCopyAdapt |
0x20000 |
|
ArrayPolarCopy of a serial number results in an array of serial numbers where the copies are enumerated from the number of the original one up to n. If not checked all copies will get the same number as the original one. |
||
scComSAMLightClientCtrlModeFlagArrayPolarCopyRotate |
0x40000 |
|
This function is useful to align the copies aligned radially. If not checked all copies will be aligned identically to the original entity. |
||
CCI_Return |
Type: int |
|
CCI return number, see error list. |
||
Notes |
•To prevent incorrect operation please read chapter How to work with flags •For more information about Performance optimization under usage of these flags, please refer to Optimize Performance chapter. |
|
C# Example: Enable Don't Update View and don't change all other flags:
int Mode = 0; int CCI_Return_01 = cci.ScGetMode( ref Mode ); Mode = Mode | ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlModeFlagDontUpdateView; int CCI_Return_02 = cci.ScSetMode( Mode ); |
||
C# Example: Disable Don't Update View and don't change all other flags:
int Mode = 0; int CCI_Return_01 = cci.ScGetMode( ref Mode ); Mode = Mode & ~( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlModeFlagDontUpdateView; int CCI_Return_02 = cci.ScSetMode( Mode ); |
Table 15: Mode
☒ Set ☐ Get |
||
---|---|---|
DLL Function |
int CCI_Return = ScShutDown() |
|
ASCII Function |
int CCI_Return = ScCciShutDown() |
|
Description |
Terminates SAMLight. |
|
CCI_Return |
Type: int |
|
CCI return number, see error list. |
||
Notes |
•After that no further commands should be given. |
|
C# Example: Shut down SAMLight:
int CCI_Return = cci.ScShutDown(); |
Table 16: SAMLight Shutdown
☐ Set ☒ Get |
|||
---|---|---|---|
DLL Function |
int Is_Running = ScIsRunning() |
||
ASCII Function |
- |
||
Description |
Can be used for checking whether the scanner application software is running or not. |
||
Is_Running |
Type: int |
Unit: none |
|
•0: SAMLight doesn't run or is not found. •1: SAMLight runs. |
|||
Notes |
•This function can be used to check whether SAMLight is ready to receive other CCI commands. •If this function returns 0, it makes no sense to use any other CCI commands and an error will occur when a command is sent. •This command will not be listed within sc_cci_debug.txt |
||
C# Example: Check SAMLight status: |
Table 17: SAMLight Status
☒ Set ☐ Get |
|||
---|---|---|---|
DLL Function |
int CCI_Return = ScShowApp(int Window_Properties) |
||
ASCII Function |
int CCI_Return = ScCciShowApp(int Window_Properties) |
||
Description |
Set SAMLight into one of the common show states of Windows. |
||
Window_Properties |
Type: int |
Unit: none |
|
•0: Hide SAMLight. •2: Minimize SAMLight. •3: Maximize SAMLight. •5: Show SAMLight and display it in its current size and position. •9: Show SAMLight and restore its original size and position, if it is minimized or maximized. |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
•You can set only one index simultaneously. |
||
C# Example: Hide the SAMLight window:
int CCI_Return = cci.ScShowApp( 0 ); |
Table 18: SAMLight Window
☒ Set ☒ Get |
|||
---|---|---|---|
DLL Function |
int CCI_Return = ScSetLongValue(int Value_Type, int Mode) int Mode = ScGetLongValue(int Value_Type) |
||
ASCII Function |
int CCI_Return = ScCciSetLongValue(int Value_Type, int Mode) int Mode = ScCciGetLongValue(int Value_Type) |
||
Description |
Set or get the status of the SAMLight simulation mode. |
||
Value_Type |
Type: int |
ID: |
|
Location: ScComSAMLightClientCtrlValueTypes |
|||
scComSAMLightClientCtrlLongValueTypeDisableSimulationMode |
109 |
||
Mode |
Type: int |
Unit: none |
|
•0: Simulation mode •1: Normal mode |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
- |
||
C# Example: Enable simulation mode: |
|||
C# Example: Check state of simulation mode:
int Mode = cci.ScGetLongValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeDisableSimulationMode ); |
Table 19: Simulation Mode
☒ Set ☐ Get |
|||
---|---|---|---|
DLL Function |
int CCI_Return = ScSetLongValue(int Value_Type, int Sleep_Time) |
||
ASCII Function |
int CCI_Return = ScCciSetLongValue(int Value_Type, int Sleep_Time) |
||
Description |
This function can be used to set a Sleep Timer in your program. |
||
Value_Type |
Type: int |
ID: |
|
Location: ScComSAMLightClientCtrlValueTypes |
|||
scComSAMLightClientCtrlLongValueTypeSleep |
165 |
||
Delay_Time |
Type: int |
Unit: [ms] |
|
Sleep Duration |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
•The added delay will be slightly larger than specified, since sending the command also takes some time. |
||
C# Example: Add a Sleep Timer of 200ms:
int CCI_Return = cci.ScSetLongValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeSleep, 200); |
Table 20: Sleep
☒ Set ☐ Get |
||
---|---|---|
DLL Function |
int CCI_Return = ScExecCommand(int Cmd_ID) |
|
ASCII Function |
int CCI_Return = ScCciExecCommand(int Cmd_ID) |
|
Description |
Update the View2D now. |
|
Cmd_ID |
Type: int |
ID: |
Location: ScComSAMLightClientCtrlExecCommandConstants |
||
scComSAMLightClientCtrlExecCommandUpdateViewNow |
22 |
|
CCI_Return |
Type: int |
|
CCI return number, see error list. |
||
Notes |
- |
|
C# Example: Update the View2D:
int CCI_Return = cci.ScExecCommand( ( int )ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandUpdateViewNow ); |
Table 21: Update View2D
☒ Set ☐ Get |
|||
---|---|---|---|
DLL Function |
int CCI_Return = ScSetStringValue(int Value_Type, string Text) |
||
ASCII Function |
int CCI_Return = ScCciSetStringValue(int Value_Type, string Text) |
||
Description |
Set a entry in the Sam2DThreadsafeDebugWrite.txt if activated. |
||
Value_Type |
Type: int |
||
Location: ScComSAMLightClientCtrlValueTypes |
|||
scComSAMLightClientCtrlStringValueTypeTrail |
31 |
||
Text |
Type: string |
Unit: none |
|
Write the wanted text. |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
- |
||
C# Example: Write trail entry:
int CCI_Return = cci.ScSetStringValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlStringValueTypeTrail, "Test" ); |
Table 22: Write Trail