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

📄 pcgen2.bas

📁 usb pci detection to usb port device
💻 BAS
📖 第 1 页 / 共 5 页
字号:
'''## ********************************
''Case DevType_Circ_8_115VAC_Grouped_PhaseA            '## (IC660CBD100)
'''## 8 circuit blocks have 12 bytes of configuration data
'''## Request all in one message
''result = ReadConfigurationDatagram(SBA, 0, 12)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''
''With iocb
''.block_type = SRI.read_datagram_buffer(2)
''.firmware_revision = SRI.read_datagram_buffer(3)
''.block_config_1 = SRI.read_datagram_buffer(4)
''.block_config_2 = SRI.read_datagram_buffer(5)
''End With 'iocb
''For i = 0 To 7 ' 8 circuits to copy: 1..8
''iocb.discrete_io_config.circuit_config(i) = SRI.read_datagram_buffer(6 + i)
''Next i
''Case DevType_Circ_8_115VAC_125VDC_Isolated_PhaseA    '## (IC660CBS100)
'''## 8 circuit blocks have 12 bytes of configuration data
'''## Request all in one message
''result = ReadConfigurationDatagram(SBA, 0, 12)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''
''With iocb
''.block_type = SRI.read_datagram_buffer(2)
''.firmware_revision = SRI.read_datagram_buffer(3)
''.block_config_1 = SRI.read_datagram_buffer(4)
''.block_config_2 = SRI.read_datagram_buffer(5)
''End With 'iocb
''For i = 0 To 7 ' 8 circuits to copy: 1..8
''iocb.discrete_io_config.circuit_config(i) = SRI.read_datagram_buffer(6 + i)
''Next i
''Case DevType_Circ_8_115VAC_2A_Grouped                '## (IC660BBD100)
'''## 8 circuit blocks have 12 bytes of configuration data
'''## Request all in one message
''result = ReadConfigurationDatagram(SBA, 0, 12)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''
''With iocb
''.block_type = SRI.read_datagram_buffer(2)
''.firmware_revision = SRI.read_datagram_buffer(3)
''.block_config_1 = SRI.read_datagram_buffer(4)
''.block_config_2 = SRI.read_datagram_buffer(5)
''End With 'iocb
''For i = 0 To 7 ' 8 circuits to copy: 1..8
''iocb.discrete_io_config.circuit_config(i) = SRI.read_datagram_buffer(6 + i)
''Next i
''Case DevType_Circ_8_115VAC_125VDC_Isolated            '## (IC660BBS100 / IC660BBS101)
'''## 8 circuit blocks have 12 bytes of configuration data
'''## Request all in one message
''result = ReadConfigurationDatagram(SBA, 0, 12)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''
''With iocb
''.block_type = SRI.read_datagram_buffer(2)
''.firmware_revision = SRI.read_datagram_buffer(3)
''.block_config_1 = SRI.read_datagram_buffer(4)
''.block_config_2 = SRI.read_datagram_buffer(5)
''End With 'iocb
''For i = 0 To 7 ' 8 circuits to copy: 1..8
''iocb.discrete_io_config.circuit_config(i) = SRI.read_datagram_buffer(6 + i)
''Next i
''Case DevType_Circ_8_220VAC_Grouped                    '## (IC660??????)
'''## 8 circuit blocks have 12 bytes of configuration data
'''## Request all in one message
''result = ReadConfigurationDatagram(SBA, 0, 12)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''
''With iocb
''.block_type = SRI.read_datagram_buffer(2)
''.firmware_revision = SRI.read_datagram_buffer(3)
''.block_config_1 = SRI.read_datagram_buffer(4)
''.block_config_2 = SRI.read_datagram_buffer(5)
''End With 'iocb
''For i = 0 To 7 ' 8 circuits to copy: 1..8
''iocb.discrete_io_config.circuit_config(i) = SRI.read_datagram_buffer(6 + i)
''Next i
''Case DevType_Circ_8_115VAC_LowLeakage_Grouped        '## (IC660BBD101)
'''## 8 circuit blocks have 12 bytes of configuration data
'''## Request all in one message
''result = ReadConfigurationDatagram(SBA, 0, 12)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''
''With iocb
''.block_type = SRI.read_datagram_buffer(2)
''.firmware_revision = SRI.read_datagram_buffer(3)
''.block_config_1 = SRI.read_datagram_buffer(4)
''.block_config_2 = SRI.read_datagram_buffer(5)
''End With 'iocb
''For i = 0 To 7 ' 8 circuits to copy: 1..8
''iocb.discrete_io_config.circuit_config(i) = SRI.read_datagram_buffer(6 + i)
''Next i
'''## ************************************************************************
'''## 16 Circuit Discrete I/O Blocks (except 16 Circuit 115VAC Input Block) **
'''## ************************************************************************
''Case DevType_Circ_16_24VDC_48VDC_Sink_PhaseA            '## (IC660CBD021)
'''## 16 circuit blocks have 20 bytes of configuration data
'''## Request in two messages
'''## Retrieve block info and circuits 1-8 in first message
''result = ReadConfigurationDatagram(SBA, 0, 12)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''
''With iocb
''.block_type = SRI.read_datagram_buffer(2)
''.firmware_revision = SRI.read_datagram_buffer(3)
''.block_config_1 = SRI.read_datagram_buffer(4)
''.block_config_2 = SRI.read_datagram_buffer(5)
''End With 'iocb
''For i = 0 To 7 ' 8 circuits to copy: 1..8
''iocb.discrete_io_config.circuit_config(i) = SRI.read_datagram_buffer(6 + i)
''Next i
'''## Retrieve circuits 9-16 in second message
''result = ReadConfigurationDatagram(SBA, 12, 8)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''For i = 0 To 7 ' 8 circuits to copy: 9..16
''iocb.discrete_io_config.circuit_config(8 + i) = SRI.read_datagram_buffer(2 + i)
''Next i
''Case DevType_Circ_16_24VDC_48VDC_Source_PhaseA            '## (IC660CBD020)
'''## 16 circuit blocks have 20 bytes of configuration data
'''## Request in two messages
'''## Retrieve block info and circuits 1-8 in first message
''result = ReadConfigurationDatagram(SBA, 0, 12)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''
''With iocb
''.block_type = SRI.read_datagram_buffer(2)
''.firmware_revision = SRI.read_datagram_buffer(3)
''.block_config_1 = SRI.read_datagram_buffer(4)
''.block_config_2 = SRI.read_datagram_buffer(5)
''End With 'iocb
''For i = 0 To 7 ' 8 circuits to copy: 1..8
''iocb.discrete_io_config.circuit_config(i) = SRI.read_datagram_buffer(6 + i)
''Next i
'''## Retrieve circuits 9-16 in second message
''result = ReadConfigurationDatagram(SBA, 12, 8)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''For i = 0 To 7 ' 8 circuits to copy: 9..16
''iocb.discrete_io_config.circuit_config(8 + i) = SRI.read_datagram_buffer(2 + i)
''Next i
''Case DevType_Circ_16_24VDC_48VDC_Sink                    '## (IC660BBD020 / IC660BBD023)
'''## 16 circuit blocks have 20 bytes of configuration data
'''## Request in two messages
'''## Retrieve block info and circuits 1-8 in first message
''result = ReadConfigurationDatagram(SBA, 0, 12)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''
''With iocb
''.block_type = SRI.read_datagram_buffer(2)
''.firmware_revision = SRI.read_datagram_buffer(3)
''.block_config_1 = SRI.read_datagram_buffer(4)
''.block_config_2 = SRI.read_datagram_buffer(5)
''End With 'iocb
''For i = 0 To 7 ' 8 circuits to copy: 1..8
''iocb.discrete_io_config.circuit_config(i) = SRI.read_datagram_buffer(6 + i)
''Next i
'''## Retrieve circuits 9-16 in second message
''result = ReadConfigurationDatagram(SBA, 12, 8)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''For i = 0 To 7 ' 8 circuits to copy: 9..16
''iocb.discrete_io_config.circuit_config(8 + i) = SRI.read_datagram_buffer(2 + i)
''Next i
''Case DevType_Circ_16_12VDC_24VDC_48VDC_Source            '## (IC660BBD021 / IC660BBD022)
'''## 16 circuit blocks have 20 bytes of configuration data
'''## Request in two messages
'''## Retrieve block info and circuits 1-8 in first message
''result = ReadConfigurationDatagram(SBA, 0, 12)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''
''With iocb
''.block_type = SRI.read_datagram_buffer(2)
''.firmware_revision = SRI.read_datagram_buffer(3)
''.block_config_1 = SRI.read_datagram_buffer(4)
''.block_config_2 = SRI.read_datagram_buffer(5)
''End With 'iocb
''For i = 0 To 7 ' 8 circuits to copy: 1..8
''iocb.discrete_io_config.circuit_config(i) = SRI.read_datagram_buffer(6 + i)
''Next i
'''## Retrieve circuits 9-16 in second message
''result = ReadConfigurationDatagram(SBA, 12, 8)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''For i = 0 To 7 ' 8 circuits to copy: 9..16
''iocb.discrete_io_config.circuit_config(8 + i) = SRI.read_datagram_buffer(2 + i)
''Next i
''Case DevType_Circ_16_Normally_Open_Relay                '## (IC660BBR101)
'''## 16 circuit blocks have 20 bytes of configuration data
'''## Request in two messages
'''## Retrieve block info and circuits 1-8 in first message
''result = ReadConfigurationDatagram(SBA, 0, 12)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''
''With iocb
''.block_type = SRI.read_datagram_buffer(2)
''.firmware_revision = SRI.read_datagram_buffer(3)
''.block_config_1 = SRI.read_datagram_buffer(4)
''.block_config_2 = SRI.read_datagram_buffer(5)
''End With 'iocb
''For i = 0 To 7 ' 8 circuits to copy: 1..8
''iocb.discrete_io_config.circuit_config(i) = SRI.read_datagram_buffer(6 + i)
''Next i
'''## Retrieve circuits 9-16 in second message
''result = ReadConfigurationDatagram(SBA, 12, 8)
''If result <> GENI_NoError Then
''
''
''GENI_Return_IO_Block_Configuration = (result)
''End If
'''## Command succeeded copy configuration data to provided iocb
'''## (skip first two "overhead" bytes in datagram reply buffer)
''For i = 0 To 7 ' 8 circuits to copy: 9..16
''iocb.discrete_io_config.circuit_config(8 + i) = SRI.r

⌨️ 快捷键说明

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