Option Strict Off
Option Explicit On

Module CndexLinkUserVB6
    ' OSAI S.p.A. Barone Canavese (Torino) Italy
    '
    ' file:     CndexLinkUser.BAS
    ' version:  3.0
    '
    '
    ' Errors management
    '
    ' The DLL CndexLink uses the return code of the function and two double words
    ' for the error management. The double words are the class of the error and
    ' the error code.
    ' The return code of the functions is always a boolean. True means that the
    ' function has been executed without error, False means error during function
    ' execution.
    ' When the return code is False the parameters ErrClass and ErrNum report the
    ' codes related to the error
    '
    ' The errors has been organized using classes to avoid error codes overlap
    ' Each class identify a level in the hierarchy of the modules used to
    ' communicate with the CNC
    ' For the error classes and error codes error definition please refer to the
    ' Cndex server interface documentation.
    ' The following codes could be not updated to last Cndex server version.
    '
    '
    ' The classes are the following:
    '
    ' COM Class               (class 1)
    ' The errors belonging to this class are generated by the COM interface
    ' that is used to carry out the calls to Cndex server.
    '
    ' CNDEX SERVER Class      (class 2)
    ' The errors belonging to this class can be generated either by the preliminary
    ' checks done by Cndex server on the called functions parameters or by internal
    ' errors of the server.
    '
    ' NETBIOS Class           (class 3)
    ' The errors belonging to this class depend by anomalies or errors during
    ' data exchange between Cndex server and the managed CNC connected through
    ' local network.
    '
    ' CNC Class               (class 4)
    ' The errors belonging to this class are generated by the elaboration of the
    ' commads by the CNC connected to Cndex.
    '
    ' CNDEX INTERFACE Class    (class 10)
    ' The errors belonging to this class are generated by CndexInterface DLL that
    ' is used to interface Cndex server.
    '
    '
    ' Error codes for COM classe (class 1)
    '
    ' Questo e ' un elenco degli errori COM piu' comuni
    '
    ' CO_E_SERVER_EXEC_FAILURE    0x80080005
    ' Su Windows 95/98 il server non puo' essere lanciato automaticamente ma bisogna
    ' metterlo in esecuzione manualmente, ricordando che quando non c'e' piu' nessuna
    ' applicazione attiva il server viene terminato automaticamente.
    '
    ' RPC_S_SERVER_UNAVAILABLE    0x800706ba
    ' · assicurarsi che nel registry il valore del parametro <enableremoteconnect> sia Y
    ' · aggiungere o attivare il protocollo TCP/IP nella configurazione di rete
    '
    ' E_ACCESSDENIED     0x80070005
    ' Su Windows NT/2000 lanciare l'utility dcomcnfg.exe e selezionare
    ' <the interactive user> o <this user> nella sezione identity dell'applicazione cndex,
    ' ed <everyone> nella sezione di launch permission
    '
    ' REGDB_E_CLASSNOTREG      0x80040154
    ' Il server Cndex non e' stato registrato nel registry di Windows. Registrarlo con
    ' questo comando da eseguire in un DOS shell : cndex.exe /regserver
    '
    ' CO_S_NOTALLINTERFACES    0x00080012
    ' La DLL proxy del server Cndex non e' stata registrata nel registry di Windows.
    ' Registrarla con questo comando da eseguire in un DOS shell : regsvr32 cndexps.dll
    '
    '
    '
    ' Error codes for CNDEX SERVER classe (class 2)
    '
    '  1  No memory for dynamic memory allocation
    '  2  Error creating syncronization events
    '  3  Session aborted. It can not be used anymore.
    '  4  Session not opened
    '  5  It is not possible to allocate a network channel
    '  6  It has been activated a function for an unexisting CNC process.
    '  7  Broadcasting command aborted
    '  8  User output buffer too small
    '  9  Session already opened
    ' 10  Broadcasting list not valid
    ' 11  Realtime command aborted
    ' 12  The function is already active
    ' 13  The function is not active yet
    ' 14  Reciving thread terminated
    ' 15  Time-out. No answer (after an establish time) to the command sent to CNC.
    ' 16  The software release of the connected CNC is not compatible with the Cndex server protocol
    ' 17  The given session identifier is not valid
    ' 18  It is not possible to create the real-time thread
    ' 19  No network session channels available anymore
    ' 20  Error loading CNC symbols
    ' 23  It is not possible to create an instance of the session object
    ' 24  It is not possible to create the broadcasting thread
    ' 25  The function can not be executed during this phase of the CNC boot
    ' 26  Wrong parameter
    ' 27  Buffer not valid
    ' 29  The UserSession parameter is not valid (there is not a correspondig session)
    ' 31  The UserSession parameter is either not valid or the corrisponding session has
    '     automatically been closed by Cndex server.
    '
    '
    ' Error codes for NETBIOS class (class 3)
    '
    ' 0x0001  Illegal buffer length
    ' 0x0003  Illegal command
    ' 0x0005  Command timed out
    ' 0x0006  Message incomplete, issue another command
    ' 0x0007  Illegal buffer address
    ' 0x0008  Session number out of range
    ' 0x0009  No resource available
    ' 0x000a  Session closed
    ' 0x000b  Command cancelled
    ' 0x000d  Duplicate name
    ' 0x000e  Name table full
    ' 0x000f  No deletions, name has active sessions
    ' 0x0011  Local session table full
    ' 0x0012  Remote session table full
    ' 0x0013  Illegal name number
    ' 0x0014  No callname
    ' 0x0015  Cannot put * in NCB_NAME
    ' 0x0016  Name in use on remote adapter
    ' 0x0017  Name deleted
    ' 0x0018  Session ended abnormally
    ' 0x0019  Name conflict detected
    ' 0x0021  Interface busy, IRET before retrying
    ' 0x0022  Too many commands outstanding, retry later
    ' 0x0023  Ncb_lana_num field invalid
    ' 0x0024  Command completed while cancel occurring
    ' 0x0026  Command not valid to cancel
    ' 0x0030  Name defined by anther local process
    ' 0x0034  Environment undefined. RESET required
    ' 0x0035  Required OS resources exhausted
    ' 0x0036  Max number of applications exceeded
    ' 0x0037  No saps available for netbios
    ' 0x0038  Requested resources are not available
    ' 0x0039  Invalid ncb address or length > segment
    ' 0x003B  Invalid NCB DDID
    ' 0x003C  Lock of user area failed
    ' 0x003f  NETBIOS not loaded
    ' 0x0040  System error
    '
    '
    '
    ' Error codes for CNC class (class 4)
    '
    ' For the error codes related to this class please refer to
    ' "MINI-DNC ETHERNET Functions Library" and "USER MANUAL" of the
    ' 10/Series CNC
    '
    '
    '
    ' Error codes for CNDEX INTERFACE class (class 10)
    '
    ' 1  ERR_SERVER_ALREADY_CREATED  CNDEX server already created
    ' 2  ERR_CREATING_SERVER_OBJECT  Error creating CNDEX server
    ' 3  ERR_SERVER_NOT_CREATED      CNDEX server never created or already released
    ' 4  ERR_INVALID_PARAMETER       Invalid value for one or more parameters
    ' 5  ERR_OPTION_NOT_ENABLED      The COMMUNICATION option is not enabled for connected CNC

    Public Const ON_ As Short = 1
    Public Const OFF_ As Short = 0

    'Boot phase
    Public Const EMERG_SWITCH_PHASE As Short = 1
    Public Const HW_BOOT_PHASE As Short = 2
    Public Const SW_BOOT_PHASE As Short = 3
    Public Const SYSTEM_UP_PHASE As Short = 4
    Public Const SERVER_MODE_PHASE As Short = 5
    Public Const REMOTE_SETUP_PHASE As Short = 6

    ' Classes of the Process Variables
    Public Const E_VAR_CLASS As Short = 1
    Public Const SN_VAR_CLASS As Short = 2
    Public Const SC_VAR_CLASS As Short = 255

    ' 10 Series modes
    Public Const MDI As Short = 1
    'UPGRADE_NOTE: AUTO è stato aggiornato a AUTO_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    Public Const AUTO_Renamed As Short = 2
    Public Const SEMI As Short = 3
    Public Const MANJOG As Short = 4
    Public Const INCJOG As Short = 5
    Public Const PROFILE As Short = 6
    Public Const HOME As Short = 7

    ' 10 Series Status
    Public Const IDLE_ As Short = 1
    Public Const CYCLE_ As Short = 2
    Public Const HOLDA_ As Short = 3
    Public Const RUNH_ As Short = 4
    Public Const HRUN_ As Short = 5
    Public Const ERRO_ As Short = 6
    Public Const WAIT_ As Short = 7
    Public Const RESET_ As Short = 8
    Public Const EMERG_ As Short = 9
    Public Const INPUT_ As Short = 10

    ' 10 Series SubStatus
    Public Const MAS As Short = 6
    Public Const MBR As Short = 4

    Public Const NUM_ELEM_SEL_AXI As Short = 9

    ' Axes Position type selector
    Public Const PROGPOS As Short = 1 ' Programmed positions
    Public Const IntPos As Short = 2 ' Interpolated positions
    Public Const TRANSDPOS As Short = 3 ' Transducer Position
    Public Const ERRPOS As Short = 4 ' Following Errors

    Public Const MAIN_PROGR_NAME_LEN As Short = 55

    ' Logic variables identifier
    ' boolean variables
    Public Const I_CODE As Short = 0
    Public Const O_CODE As Short = 1
    Public Const M_CODE As Short = 2
    Public Const G_CODE As Short = 3
    Public Const S_CODE As Short = 4
    Public Const P_CODE As Short = 7
    Public Const U_CODE As Short = 8
    ' WORD variables
    Public Const MW_CODE As Short = 20
    Public Const GW_CODE As Short = 21
    Public Const SW_CODE As Short = 22
    Public Const PW_CODE As Short = 62
    Public Const UW_CODE As Short = 63
    'DOUBLE variables
    Public Const MD_CODE As Short = 40
    Public Const GD_CODE As Short = 41
    Public Const PD_CODE As Short = 43
    Public Const UD_CODE As Short = 44


    ' Tables identifiers
    Public Const AXIS_TABLE_ID As Short = 1 ' AXIS TABLE identifier
    Public Const TOOL_TABLE_ID As Short = 2 ' TOOL TABLE identifier
    Public Const OFFSET_TABLE_ID As Short = 3 ' OFFSET TABLE identifier
    Public Const USER_TABLE_ID As Short = 4 ' USER TABLE identifier


    ' Logical directory identifiers
    Public Const PPDIR_PROGRAM As Short = 0 ' PROGRAM directory
    Public Const PPDIR_USER As Short = 1 ' USER directory
    Public Const PPDIR_SYSTEM As Short = 2 ' SYSTEM directory
    Public Const PPDIR_OEM As Short = 3 ' OEM directory


    Structure GETINTDATA
        Dim AxisName As Byte
        Dim Mode As Byte
        Dim Position As Double
        Dim TotalOffset As Double
    End Structure


    Structure PROCDATA
        Dim Mode As Short
        Dim status As Short
        Dim substatus As Short
    End Structure


    Structure GetInfo1Data
        Dim status As Byte ' process status
        Dim substatus As Byte ' process substatus
        Dim mode_select As Byte ' selected mode
        Dim jog_dir As Byte ' 1 = negative 0 = positive
        Dim speed_ov As Short ' speed override
        Dim feed_ov As Short ' feed override
        Dim rap_feed_ov As Short ' rapid feed override
        Dim man_feed_ov As Short ' manual feed override
        Dim jog_incr As Double ' incremental jog value
        Dim num_ax_sel As Byte ' number of selected axes
        <VBFixedArray(NUM_ELEM_SEL_AXI)> Dim ax_sel() As Byte 'array of selected axes
        Dim actual_tool As Double ' actual active tool number
        Dim progr_tool As Double ' programmed tool number
        Dim actual_tool_off As Short ' actual tool offset number
        Dim progr_tool_off As Short ' programmed tool offset number
        Dim real_speed As Double ' real spindle feed
        Dim progr_speed As Double ' programmed spindle feed
        Dim progr_feed As Double ' programmed feed
        Dim rapid_feed As Double ' rapid feed
        Dim real_feed As Double ' real feed
        Dim feed_mis_unit As Short ' misure unit of feed
        'UPGRADE_WARNING: La dimensione della stringa di lunghezza fissa deve essere contenuta nel buffer. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
        <VBFixedString(MAIN_PROGR_NAME_LEN), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=MAIN_PROGR_NAME_LEN)> Public main_progr_name() As Char ' active main part program name
        Dim dry_run As Byte ' 1 = dry run modality active
        Dim rapid_override As Byte ' 1 = rapid ovverride enable
        Dim disable_slashed_blk As Byte ' 1 = slashed block disable
        Dim optional_stop As Byte ' 1 = M00 stop enable
        Dim force_rapid_feed As Byte ' 1 = rapid feed forced
        Dim auto_jog_ret As Byte ' 1 = automatic jog return mode
        Dim block_retrace As Byte ' 1 = multi block retrace active
        Dim last_nc_error As Short ' last NC error. 0 = no error
        <VBFixedArray(22)> Dim free() As Byte ' free

        'UPGRADE_TODO: "Initialize" deve essere chiamato per inizializzare istanze di questa struttura. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim ax_sel(NUM_ELEM_SEL_AXI)
            ReDim free(22)
        End Sub
    End Structure


    Structure GetInfo2Data
        Dim StatusWord As Short
        Dim Urp As Double
        Dim ActTool As Double
        Dim ActOffset As Short
        Dim ProgTool As Double
        Dim ProgOffset As Short
        Dim M_Status As Short
        <VBFixedArray(15)> Dim M_Value() As Short
        Dim Ax1Name As Byte
        Dim Ax1Offset As Double
        Dim Ax2Name As Byte
        Dim Ax2Offset As Double
        Dim Radius As Double

        'UPGRADE_TODO: "Initialize" deve essere chiamato per inizializzare istanze di questa struttura. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim M_Value(15)
        End Sub
    End Structure


    Structure GETBLKNUMDATA
        Dim ppActNum As Short
        Dim MainActBlk As Integer
        Dim Sbr1ActBlk As Integer
        Dim Sbr2ActBlk As Integer
        Dim Sbr3ActBlk As Integer
        Dim Sbr4ActBlk As Integer
    End Structure


    ' Axis Table Descriptor
    Structure AXIS_TABLE
        Dim owner As Short ' ambient owner
        Dim name As Short ' ascii axis name
        Dim orig As Double ' actual origin
        Dim free1 As Double ' FREE FIELD
        Dim ofg92 As Double ' offset G92
        Dim toff As Double ' actual tool offset
        Dim free2 As Double ' FREE FIELD
        Dim Offset As Double ' axis total offset
        Dim orig1 As Double ' origin 1
        Dim orig2 As Double ' origin 2
        Dim orig3 As Double ' origin 3
        Dim orig4 As Double ' origin 4
        Dim orig5 As Double ' origin 5
        Dim orig6 As Double ' origin 6
        Dim orig7 As Double ' origin 7
        Dim orig8 As Double ' origin 8
        Dim orig9 As Double ' origin 9
        Dim orig10 As Double ' origin 10
        Dim reserved1 As Short ' reserved
        Dim reserved2 As Short ' reserved
    End Structure


    ' Tool table descriptor
    Structure TOOL_TABLE
        Dim Tcode As Double ' tool code
        Dim pocket As Short ' pocket position
        Dim tfamcol As Short ' random family
        Dim tclass As Short ' tool class
        Dim tstatus As Short ' status word
        Dim tcntrl As Short ' control word
        Dim maxtime As Double ' start life
        Dim remtime As Double ' actual life
        Dim tuser1 As Double ' user parameter 1
        Dim tuser2 As Double ' user parameter 2
        Dim tuser3 As Double ' user parameter 3
        Dim tuser4 As Double ' user parameter 4
        Dim tolfnr As Short ' offset number
    End Structure


    ' Offset table descriptor
    Structure OFFSET_TABLE
        Dim tactl1 As Double ' actual tool lenght 1
        Dim tcmaxl1 As Double ' max change lenght 1
        Dim tcactl1 As Double ' actual change lenght 1
        Dim tactl2 As Double ' actual tool lenght 2
        Dim tcmaxl2 As Double ' max change lenght 2
        Dim tcactl2 As Double ' actual change lenght 2
        Dim tdiameter As Double ' diameter (ex radius)
        Dim tcacdiam As Double ' diameter wear (ex tangle)
        Dim torient As Short ' orientation
    End Structure


    ' User table descriptor
    Structure USER_TABLE
        Dim user1 As Double ' user variable 1
        Dim User2 As Double ' user variable 2
        Dim user3 As Double ' user variable 3
        Dim user4 As Double ' user variable 4
    End Structure


    Structure ERR_MSG
        'UPGRADE_WARNING: La dimensione della stringa di lunghezza fissa deve essere contenuta nel buffer. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
        <VBFixedString(40), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=40)> Public Msg1() As Char
        'UPGRADE_WARNING: La dimensione della stringa di lunghezza fissa deve essere contenuta nel buffer. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
        'UPGRADE_NOTE: MSG2 è stato aggiornato a MSG2_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
        <VBFixedString(40), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=40)> Public MSG2_Renamed() As Char
        'UPGRADE_WARNING: La dimensione della stringa di lunghezza fissa deve essere contenuta nel buffer. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
        'UPGRADE_NOTE: MSG3 è stato aggiornato a MSG3_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
        <VBFixedString(40), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=40)> Public MSG3_Renamed() As Char
        'UPGRADE_WARNING: La dimensione della stringa di lunghezza fissa deve essere contenuta nel buffer. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
        <VBFixedString(40), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=40)> Public Msg4() As Char
    End Structure


    Structure PLVARDESC
        Dim Code As Short
        Dim Index As Short
        Dim Bit As Short
    End Structure


    Structure EMCY_TYPE
        Dim usEmcyErrCode As Short
        Dim usEmcyErrorReg As Byte
        Dim SpecErrField As Integer
        Dim reserved As Byte
    End Structure

    ''''''' CNDEX SERVER FUNCTIONS PROTOTYPES '''''''

    Declare Function ConnectServer_C Lib "CndexLink.DLL" (ByVal ServerAddress As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function ReleaseServer_C Lib "CndexLink.DLL" (ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    ''''''' NET SESSION FUNCTIONS PROTOTYPES '''''''

    Declare Function OpenSession_C Lib "CndexLink.DLL" (ByVal RemoteName As String, ByRef UserSession As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function CloseSession_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    Declare Function IsSessionOpened_C Lib "CndexLink.DLL" (ByVal UserSession As Short) As Short


    ''''''' CNC BOOT FUNCTIONS PROTOTYPES '''''''

    Declare Function BootPhaseEnquiry_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef Phase As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    Declare Function BootReboot_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    Declare Function BootShutDown_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    Declare Function BootMode_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal Mode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short



    ''''''' GENERAL FUNCTIONS PROTOTYPES '''''''

    Declare Function GetCodeNumber_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal CodeNumber As String, ByVal SwVersion As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    'UPGRADE_NOTE: Second è stato aggiornato a Second_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    'UPGRADE_NOTE: Minute è stato aggiornato a Minute_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    'UPGRADE_NOTE: Hour è stato aggiornato a Hour_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    'UPGRADE_NOTE: Day è stato aggiornato a Day_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    'UPGRADE_NOTE: Month è stato aggiornato a Month_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    'UPGRADE_NOTE: Year è stato aggiornato a Year_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    Declare Function GetDateTime_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef Year_Renamed As Short, ByRef Month_Renamed As Short, ByRef Day_Renamed As Short, ByRef Hour_Renamed As Short, ByRef Minute_Renamed As Short, ByRef Second_Renamed As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    'UPGRADE_NOTE: Second è stato aggiornato a Second_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    'UPGRADE_NOTE: Minute è stato aggiornato a Minute_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    'UPGRADE_NOTE: Hour è stato aggiornato a Hour_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    'UPGRADE_NOTE: Day è stato aggiornato a Day_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    'UPGRADE_NOTE: Month è stato aggiornato a Month_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    'UPGRADE_NOTE: Year è stato aggiornato a Year_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    Declare Function SetDateTime_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal Year_Renamed As Short, ByVal Month_Renamed As Short, ByVal Day_Renamed As Short, ByVal Hour_Renamed As Short, ByVal Minute_Renamed As Short, ByVal Second_Renamed As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    Declare Function PPInsertName_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal LogicalName As String, ByVal LogicalExt As String, ByVal LogicalDir As Short, ByVal PhysicalName As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function PPDeleteName_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal LogicalName As String, ByVal LogicalExt As String, ByVal LogicalDir As Short, ByRef NumberOfFilesDeleted As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function PPGetLogicalName_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal PhysicalName As String, ByVal LogicalName As String, ByVal LogicalExt As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function PPGetPhysicalName_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal LogicalName As String, ByVal LogicalExt As String, ByVal LogicalDir As Short, ByVal PhysicalName As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function PPGetLogicalDir_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal LogicalName As String, ByVal LogicalExt As String, ByRef LogicalDir As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function PPUpdate_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal LogicalName As String, ByVal LogicalExt As String, ByVal LogicalDir As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short



    ''''''' PROCESS FUNCTIONS PROTOTYPES '''''''

    Declare Function Cycle_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Cmd As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SyncroCycle_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function Reset_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function Hold_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Cmd As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetFeedManOver_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal FeedManOver As Short, ByVal Direction As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetFeedRateOver_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal FeedRateOver As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetFeedRapidOver_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal FeedRapidOver As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetSpeedRateOver_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal SpeedRateOver As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetManMovDirection_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Direction As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetMdiString_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal MdiString As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetProcessMode_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Mode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SelectProcess_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetSelectedProcess_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SelectProcAxis_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal AxisName As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SelectPartProgram_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal PartProgramName As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura GETINTDATA potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function GetAxesPosition_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal AxisName As Byte, ByVal Selector As Short, ByRef NumAxis As Short, ByRef IntPos As GETINTDATA, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura GetInfo1Data potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function GetNcInfo1_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef GetInfo1Data As GetInfo1Data, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura GetInfo2Data potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function GetNcInfo2_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef GetInfo2Data As GetInfo2Data, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura PROCDATA potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function GetProcessStatus_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef NewMode As PROCDATA, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura GETBLKNUMDATA potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function GetBlkNum_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef BlkNum As GETBLKNUMDATA, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function AxesRef_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal NumAx As Short, ByRef AxisName As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetVarE_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByRef Num As Short, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetVarSN_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByRef Num As Short, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetVarSC_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByRef Num As Short, ByVal text As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetVarJOG_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef Value As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetVarRCM_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef Value As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetVarE_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByVal Num As Short, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetVarSN_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByVal Num As Short, ByRef Value As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetVarSC_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByVal Num As Short, ByVal text As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetVarJOG_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Value As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetVarUAS_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Mode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetVarRCM_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Mode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura ERR_MSG potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function ReadErrMsg_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef SysErrMsg As ERR_MSG, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function ReadPartProgramMsg_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal PartProgramMsg As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetGCode_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef GCode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetMCode_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef MCode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SkipPProgBlock_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal NumOfBlocks As Integer, ByVal Direction As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function Ese_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal BlockNum As Integer, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short




    ''''''' PLC FUNCTIONS PROTOTYPES '''''''

    'UPGRADE_WARNING: La struttura PLVARDESC potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
   Declare Function GetPLVarWord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByRef VarDesc As PLVARDESC, ByRef Values As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
   Declare Function GetPLVarWord_M_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByRef VarDesc As PLVARDESC, ByRef Values() As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura PLVARDESC potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function SetPLVarWord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByRef VarDesc As PLVARDESC, ByRef Values As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura PLVARDESC potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function GetPLVarDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByRef VarDesc As PLVARDESC, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura PLVARDESC potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function SetPLVarDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByRef VarDesc As PLVARDESC, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetPLVarAscii_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal Index As Short, ByVal Value As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetPLVarAscii_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal Index As Short, ByRef Value As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetPLStreamWord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByVal Code As Short, ByVal StartIndex As Short, ByRef Values As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetPLStreamDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByVal Code As Short, ByVal StartIndex As Short, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetPLStreamWord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByVal Code As Short, ByVal StartIndex As Short, ByRef Values As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetPLStreamDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByVal Code As Short, ByVal StartIndex As Short, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function ReadWarningMsg_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal WarningMsg As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function CANReadSDO_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal idNode As Byte, ByVal Index As Short, ByVal subIndex As Byte, ByVal timeout As Short, ByVal Sync As Byte, ByRef data As Byte, ByRef DataLen As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function CANWriteSDO_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal idNode As Byte, ByVal Index As Short, ByVal subIndex As Byte, ByVal timeout As Short, ByVal Sync As Byte, ByRef data As Byte, ByRef DataLen As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function CANNMT_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal idNode As Byte, ByVal Cmd As Short, ByVal timeout As Short, ByVal Sync As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    Declare Function CANSync_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal timeout As Short, ByVal Sync As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    Declare Function CANInit_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal TickNr As Short, ByVal Inp1 As Short, ByVal Inp2 As Short, ByVal Out1 As Short, ByVal Out2 As Short, ByVal OffsDiagn As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    'UPGRADE_WARNING: La struttura EMCY_TYPE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function CANGetEmergency_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal idNode As Byte, ByVal timeout As Short, ByVal Sync As Byte, ByRef NodeStatus As Short, ByRef AddInfo As Short, ByRef ProfNum As Short, ByRef NodeStateNG As Short, ByRef ActualErr As Short, ByRef EmcyLen As Short, ByRef EmcyData As EMCY_TYPE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    Declare Function CANBoard_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal Cmd As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short


    Declare Function CANConsoleCfg_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal idNode As Byte, ByVal InpOffs As Short, ByVal OutOffs As Short, ByVal timeout As Short, ByVal Sync As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short



    ''''''' TABLES RELATED FUNCTIONS PROTOTYPES '''''''

    'UPGRADE_WARNING: La struttura AXIS_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function GetAxisTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As AXIS_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura TOOL_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function GetToolTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As TOOL_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura OFFSET_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function GetOffsetTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As OFFSET_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura USER_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function GetUserTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As USER_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetTabFieldDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TableNum As Short, ByVal RecordNum As Short, ByVal FieldNum As Short, ByRef Value As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function GetTabFieldShort_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TableNum As Short, ByVal RecordNum As Short, ByVal FieldNum As Short, ByRef Value As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura AXIS_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function SetAxisTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As AXIS_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura TOOL_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function SetToolTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As TOOL_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura OFFSET_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function SetOffsetTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As OFFSET_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_WARNING: La struttura USER_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Declare Function SetUserTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef RecordBuff As USER_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetTabFieldDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TableNum As Short, ByVal RecordNum As Short, ByVal FieldNum As Short, ByVal Value As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetTabFieldShort_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TableNum As Short, ByVal RecordNum As Short, ByVal FieldNum As Short, ByVal Value As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function SetTabSem_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TableNum As Short, ByVal SemStatus As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function TabSemInfo_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef SemStatus As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function TabSearchDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TabNum As Short, ByVal FieldNum As Short, ByVal StartIndex As Short, ByVal StopIndex As Short, ByVal Value As Double, ByRef MatchIndex As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function TabSearchShort_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TabNum As Short, ByVal FieldNum As Short, ByVal StartIndex As Short, ByVal StopIndex As Short, ByVal Value As Short, ByVal Mask As Short, ByRef MatchIndex As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short



    ''''''' O.S. FUNCTIONS PROTOTYPES '''''''

    'UPGRADE_ISSUE: La dichiarazione di un parametro 'As Any' non è supportata. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="FAE78A8D-8978-4FD4-8208-5B7324A8F795"'
    Declare Function GRead_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal MemId As Short, ByVal Offset As Short, ByVal Length As Short, ByRef Buffer As Object, ByRef BufferLength As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    'UPGRADE_ISSUE: La dichiarazione di un parametro 'As Any' non è supportata. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="FAE78A8D-8978-4FD4-8208-5B7324A8F795"'
    Declare Function GWrite_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal MemId As Short, ByVal Offset As Short, ByVal Length As Short, ByRef Buffer As Object, ByRef BufferLength As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short



    ''''''' ACTIVE PART PROGRAM DOWNLOAD FUNCTIONS PROTOTYPES '''''''

    Declare Function DncInit_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal PathName As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function DncData_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal data As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function DncEof_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

    Declare Function DncStop_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short

End Module
