⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comm.bas

📁 利用RS232做通訊 可以執行自動功能 謝謝大家使用
💻 BAS
字号:
Attribute VB_Name = "COMM"
'************************************************************************
'*  COMMM.BAS
'*
'*  SI_COMM1.OCX Copyright (C) 1998 Software InnoVations Inc
'*  All rights reserved.
'*
'* Description
'*
'*  Basic Language Constants for SI_COMM1.OCX
'*
'************************************************************************

Option Explicit

'**************************************************************************
'* Chariot DLL define
'*************************************************************************

Declare Function DLL_CHR_api_initialize_show_rc Lib "Chariot.dll" () As Integer
Declare Function DLL_CHR_api_initialize_show_error Lib "Chariot.dll" () As String
Declare Function DLL_CHR_test_new_show_rc Lib "Chariot.dll" () As Integer
Declare Function DLL_CHR_test_new_return_handle Lib "Chariot.dll" () As Long
Declare Function DLL_CHR_api_get_return_msg_show_rc Lib "Chariot.dll" (ByVal code As Integer) As Integer
Declare Function DLL_CHR_api_get_return_msg_show_msg Lib "Chariot.dll" () As String
Declare Function DLL_CHR_test_set_filename_show_rc Lib "Chariot.dll" (ByVal Test As Long, ByVal FileName As String) As Integer
Declare Function DLL_CHR_pair_new_show_rc Lib "Chariot.dll" () As Integer
Declare Function DLL_CHR_pair_new_return_handle Lib "Chariot.dll" () As Long
Declare Function DLL_CHR_pair_set_comment_show_rc Lib "Chariot.dll" (ByVal Pair As Long) As Integer
Declare Function DLL_CHR_pair_set_e1_addr_show_rc Lib "Chariot.dll" (ByVal Pair As Long, ByVal e1_addr As String) As Integer
Declare Function DLL_CHR_pair_set_e2_addr_show_rc Lib "Chariot.dll" (ByVal Pair As Long, ByVal e2_addr As String) As Integer
Declare Function DLL_CHR_pair_set_protocol_show_rc Lib "Chariot.dll" (ByVal Pair As Long, ByVal protocol As String) As Integer
Declare Function DLL_CHR_pair_use_script_filename_show_rc Lib "Chariot.dll" (ByVal Pair As Long, ByVal script As String) As Integer
Declare Function DLL_CHR_test_add_pair_show_rc Lib "Chariot.dll" (ByVal Test As Long, ByVal Pair As Long) As Integer
Declare Function DLL_CHR_test_start_show_rc Lib "Chariot.dll" (ByVal Test As Long) As Integer
Declare Function DLL_CHR_test_query_stop_show_rc Lib "Chariot.dll" (ByVal Test As Long, ByVal Timeout As Long) As Integer
Declare Function DLL_CHR_test_save Lib "Chariot.dll" (ByVal Test As Long) As Integer
Declare Function DLL_CHR_test_get_runopts_show_rc Lib "Chariot.dll" (ByVal Test As Long) As Integer
Declare Function DLL_CHR_test_get_runopts_return_handle Lib "Chariot.dll" () As Long
Declare Function DLL_CHR_runopts_set_validate_on_recv_show_rc Lib "Chariot.dll" (ByVal Test As Long) As Integer
Declare Function DLL_CHR_runopts_set_stop_on_init_failure_show_rc Lib "Chariot.dll" (ByVal Test As Long) As Integer
Declare Function DLL_CHR_mgroup_new_show_rc Lib "Chariot.dll" () As Integer
Declare Function DLL_CHR_mgroup_new_return_handle Lib "Chariot.dll" () As Long
Declare Function DLL_CHR_mgroup_set_name_show_rc Lib "Chariot.dll" (ByVal mgroup As Long, ByVal groupName As String) As Integer
Declare Function DLL_CHR_mgroup_set_e1_addr_show_rc Lib "Chariot.dll" (ByVal mgroup As Long, ByVal e1_addrs As String) As Integer
Declare Function DLL_CHR_mgroup_set_multicast_addr_show_rc Lib "Chariot.dll" (ByVal mgroup As Long, ByVal mc_addrs As String) As Integer
Declare Function DLL_CHR_mgroup_set_multicast_port_show_rc Lib "Chariot.dll" (ByVal mgroup As Long, ByVal mc_ports As Integer) As Integer
Declare Function DLL_CHR_mgroup_set_protocol_show_rc Lib "Chariot.dll" (ByVal mgroup As Long, ByVal protocols As String) As Integer
Declare Function DLL_CHR_mgroup_use_script_filename_show_rc Lib "Chariot.dll" (ByVal mgroup As Long, ByVal scripts As String) As Integer
Declare Function DLL_CHR_mgroup_set_script_variable_show_rc Lib "Chariot.dll" (ByVal mgroup As Long, ByVal scriptVars As String, ByVal scriptVarValues As String) As Integer
Declare Function DLL_CHR_mpair_new_show_rc Lib "Chariot.dll" () As Integer
Declare Function DLL_CHR_mpair_new_return_handle Lib "Chariot.dll" () As Long
Declare Function DLL_CHR_mpair_set_e2_addr_show_rc Lib "Chariot.dll" (ByVal mpair As Long, ByVal e2_addrs As String) As Integer
Declare Function DLL_CHR_mgroup_add_mpair_show_rc Lib "Chariot.dll" (ByVal mgroup As Long, ByVal mpair As Long) As Integer
Declare Function DLL_CHR_test_add_mgroup_show_rc Lib "Chariot.dll" (ByVal Test As Long, ByVal mgroup As Long) As Integer
Declare Function DLL_CHR_pair_results_get_average_show_rc Lib "Chariot.dll" (ByVal pair_handle As Long) As Integer
Declare Function DLL_CHR_pair_results_get_average_return_value Lib "Chariot.dll" () As Single
Declare Function DLL_CHR_pair_results_get_maximum_show_rc Lib "Chariot.dll" (ByVal pair_handle As Long) As Integer
Declare Function DLL_CHR_pair_results_get_maximum_return_value Lib "Chariot.dll" () As Single
Declare Function DLL_CHR_pair_results_get_minimum_show_rc Lib "Chariot.dll" (ByVal pair_handle As Long) As Integer
Declare Function DLL_CHR_pair_results_get_minimum_return_value Lib "Chariot.dll" () As Single
Declare Function DLL_CHR_test_get_dgopts_show_rc Lib "Chariot.dll" () As Integer
Declare Function DLL_CHR_test_get_dgopts_return_handle Lib "Chariot.dll" () As Long
Declare Function DLL_CHR_dgopts_set_TTL_show_rc Lib "Chariot.dll" (ByVal dgopt As Long) As Integer

           
         
          
Declare Function ReturnVc Lib "Chariot.dll" () As String
Declare Function Test Lib "Chariot.dll" (ByVal a As Integer, ByVal B As Integer) As Integer
Declare Function Multi Lib "Chariot.dll" (ByVal a As Integer, ByVal B As Integer) As Integer


'*****************************************************************************
'* Chariot parameters define
'*****************************************************************************

Public TestString As String
Public sd As String
Public rc As Integer
Public Const CHR_OK = 0
Public Const CHR_TIMED_OUT = 118
Public Const Timeout = 5
Public Const MaxWait = 99999999




'************************************************************************
'*  Communications Port Definition
'************************************************************************
Public ComPort As Control


'************************************************************************
'*  Commands Parsing Definition
'************************************************************************
Public Const Cmd_Arr_Size = 255
Public Const Keyin_CR = 0                       'Keyin "CR" key
Public Const Keyin_Space = 1                    'Keyin "Space" key
Public Const Keyin_Esc = 2                      'Keyin "Esc" key
Public Const Keyin_Exit = 3                     'Keyin Exit string
Public Const Keyin_Password = 4                 'Keyin  Password string
Public Char_Keyin As Boolean                    '=True ,Enter mode
                                                            '=False ,Select mode
Public password As String
Public LocalPwd As String
Public RemotePwd As String
Public Cmd_Arr(Cmd_Arr_Size) As String          'Command array
Public Label_arr(Cmd_Arr_Size) As String           'CI command Label_arr
Public Label_Match As Boolean                   'judge Label match ?
Public Value_Match As Boolean                   'judge Value match ?
Public value_check As Boolean
Public page_change As Boolean                   'judage Page change ?
Public oneline_buf As String
Public Remote_IP As String
Public Ping_IP As String
Public form_number As Integer                   'how many times form load
Public Ping_OK As Boolean                       'Ping_ok ?
Public label_index As Integer
Public char_index As Integer
Public left_right As Integer
Public right_side As Boolean
Public both_side_check As Boolean
Public char_space As Boolean
Public space_check As Boolean
Public buff() As Byte
Public str_buff As String
Public total_item As Integer
Public total_pass As Integer
Public chk_item As Integer
Public chk_pass As Integer
Public speed_chg As Boolean
Public speed_chk As Boolean
Public speed As String
Public label_rep As Boolean
Public over_time As Boolean
Public rational_pass As String
Public smtscan_flag As Boolean



Public scanstart As Integer









'************************************************************************
'*  File Open/Close Definition
'************************************************************************
Public ProgramName As String
Public CmdLine As String
Public LabelLine As String
Public SaveFileName As String
Public RptPathStr As String
Public FirmwareName As String
Public loadfilename As String
Public SaveFileChg As Boolean

Public CurrentTime As Long




'**************************************************************************
'*  setting
'**************************************************************************

Public LocalBand As Integer
Public RemoteBand As Integer
Public LocalCom As Integer
Public RemoteCom As Integer
Public RemoteChg As Boolean
Public LoopIndex As Integer

Public local_remote As Integer
Public localshaking As Integer
Public remoteshaking As Integer

Public lpcount As Integer

Public bandText As Variant

'*************************************************************************
'* SW
'*******************************************************************

 ' SW Global define
Public LanStatus_H(8) As Integer
Public LanStatus_L(8) As Integer


Public excep_loop As Boolean
Public excep_str As String
Public interval_loop As Integer






⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -