CT通讯协议.doc_第1页
CT通讯协议.doc_第2页
CT通讯协议.doc_第3页
CT通讯协议.doc_第4页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

OPTRIS CT communication interface1. Serial interface parametersBaud rate:9600115200, set by user (factory default: 9600)Data bits:8Parity:noneStop bits:1Flow control:offProtocolThe protocol of the OPTRIS CT is a binary protocol. Beginning with firmware rev. 26 a checksum is needed for set commands but not for read commands. The protocol has no additional overhead with CR, LR or ACK bytes. This makes the communication fast.To get the current object temperature the user must send a simple 01hex byte and the CT will respond with the two byte temperature. Deducted by 1000dec the result is the temperature in tenth degrees.Command listThe following table lists all commands accessible for the user. Cmd. (Hex)CommandData bytesAnswer bytesCommand descriptionUnit01READ Temp - Target-2*T)C02READ Temp - Head-2*T)C03READ Temp - Box-2*T)C04READ Epsilon-2=(byte1*256 + byte2) / 100005READ Transmission-2=(byte1*256 + byte2) / 100006READ AVG Time-2=(byte1*256 + byte2) / 10s07READ Valley Hold Time-2=(byte1*256 + byte2) / 10s08READ Peak Hold Time-2=(byte1*256 + byte2) / 10s09READ Temp. Unit-11 = C, 0 = F0AREAD AL1 Value-2*T)C0BREAD AL2 Value-2*T)C0CREAD AL3 Value-2*T)C0DREAD AL4 Value-2*T)C0EREAD Serial Number-3=byte1*65536 + byte2*256 + byte30FREAD FW Rev.-2=byte1*256 + byte210READ Multidrop Address-1=byte1 (1.79)11READ Scal_Out_Min-2mV or A12READ Scal_Out_Max-2mV or A13READ Amb. Temp. Source-11 = ext. Analog, 2 = ext. FIX, 3 = Head Temp14READ Amb. Temp. Fix Value-2*T)C15READ Eps. Source-11 = ext. Analog, 2 = ext. FIX, 3 = Table16READ IR Failsafe Mode-10 = always HIGH1 = under - HIGH over - LOW2 = always LOW3 = under - LOW over - HIGH17READ Amb. Failsafe Mode-118READ Low End for output-2*T)C19READ High End for output-2*T)C1AREAD Output value for IR-DAC1% value of defined range%1BREAD Output value for Ambient-DAC1%1CREAD AVG Mode (adaptive)-11 = adaptive Mode , 0 = normal1DREAD Advanced Hold Mode-10 = off, 1 = peak, 2 = valley1EREAD Advanced Hold Treshold-2*T)C1FREAD Eps. Calculation Required Temp-2*T)C20READ Eps. Calculation Current Temp-2*T)C21READ Eps. Calculation State-11 = ON; 0 = OFF22READ Adv. Hold Hysteresis-2*T)C23READ Material Table12See example24READ Head Code13byte1 = block numberbyte2.4 = head code26READ Tweak Offset-2*T)C27READ Tweak Gain-2= (1/215) * (byte1*256 + byte2)28READ ALARMx Mode12byte1 = Alarm x (x = 0.3)byte2 = Bit sequence: ( see Example)2BREAD F3 Low temperature (0Volt)-2*T)C2CREAD F3 High temperature (5Volt)-2*T)C2DREAD Checksum111 = ON; 0 = OFF2ELine Mode request12 nbyte1 = number of devices on the RS485 bus (up to 79)answer : 2 byte Target Temp for any device2FLine Mode Timer SET (continuously line mode)22 nbyte1 = cycle time in millisecondsbyte2 = number of devices on the RS485 bus (up to 79)continuously answer : 2 byte Target temperature for any device81READ Act. Temp.-2*T)C82SET Baud rate10 = 9600, 1 = 19200, 2 = 384003 = 57600, 4 = 11520084SET Epsilon22See command 0485SET Transmission22See command 0586SET AVG Time22See command 06s87SET Valley Hold Time22See command 07s88SET Peak Hold Time22See command 08s89SET Temp. Einheit READ11See command 098ASET AL1 Value22*T)C8BSET AL2 Value22*T)C8CSET AL3 Value22*T)C8DSET AL4 Value22*T)C8ESET Serial number33See command 0E8FRESET of DAC percent output -See command 0F90SET Multidrop Address11See command 1091SET Scal_Out_Min22See command 1192SET Scal_Out_Max22See command 1293SET Ambient Temp. Source11See command 1394SET Ambient Temp. Fix Value22*T)C95SET Eps. Source11See command 1596SET IR Failsafe Mode11See command 1697SET Ambient Failsafe Mode11See command 1798SET Low End for output22*T)C99SET High End for output22*T)C9ASET Output value for IR-DAC11See command 1A%9BSET Output value for Amb-DAC11See command 1B%9CSET AVG Mode11See command 1C9DSET Advanced Hold Mode11See command 1D9ESET Advanced Hold Treshold22*T)C9FSET Eps. Calculation Required Temp22*T)CA0SET Eps. Calculation Current Temp22*T)CA1SET Eps. Calculation State11See command 21A2SET Adv. Hold Hysteresis22*T)CA3SET Material Table33See command 23A4SET Head Code44See command 24A6SET Tweak Offset22*T)CA7SET Tweak Gain22See command 27A8SET ALARMx Mode22See command 28ABSET F3 Low temperature (0Volt)22*T)CACSET F3 High temperature (5Volt)22*T)CADSET Checksum111 = ON; 0 = OFF*T) = Encoding of temperature: = (byte1*256 + byte2 - 1000) / 10AddressingThis is relevant for communication with the RS485 bus only. OPTRIS CTs with RS232 or USB communication will respond to any address. If you use the RS485 interface board you must use the multidrop addresses.A multidrop address is a simple prefix byte to the command. The byte is build by adding the hexadecimal value B0 to the device address. B5 01 will read the temperature from the device with the address 5. The address of any device can be set by the device user interface (“M_01”) or by the communication interface with the command 90. A special case is address prefix B0 for set commands. Because there is no multidrop address 0 this addresses no certain device. But a SET command with prefix broadcast the command to all devices at the RS485 bus. Note: The command is executed immediately on any of the devices even if they do not respond to the command. That is because all are slaves and cant talk at the same time.ChecksumsThis is relevant for OPTRIS CT with firmware revision 26 or higher.If the device is setup to use checksums any SET command must have a checksum suffix. The checksum can be switched off with command AD. After every “Power on” the device will expect the checksum again.The checksum byte is build by the arithmetical XOR of all command bytes except of the address prefix.To switch off the checksums with the SET command 90 you must send the checksum.To switch on the checksums with the SET command 90 you must not send the checksum.ExamplesRead CommandsSendReceiveReading a target temperature0104 D3(04D3hex -1000)/10 = (1235-1000)/10 = 23.5CReading a target temp. with device address 5B5 0104 D323.5CReading emissivity0403 B603B6hex/1000 = 950/1000 = 0.950Reading serial number0E3D CC 5D3DCC5Dhex = 4050013Query whether the device uses checksums2D0101 = Device uses checksumsSet CommandsSend *)ReceiveSetting the alarm 1 value8A 04 D3 5D04 D3(04D3hex -1000)/10 = (1235-1000)/10 = 23.5CSetting the alarm 1 value with device address 5B5 8A 04 D3 5D04 D323.5CSetting the emissivity to 0.9584 03 B6 3103 B603B6hex/1000 = 950/1000 = 0.950Giving the device with address 5 the new address 6B5 90 06 9606After this command you have to use B6 as address prefixSwitch the checksums off, if the device uses checksumsAD 00 AD00Switch the checksums on, if the device does not use checksumsAD 0101Setting the baud rate of all devices at the same time to 115200 baudB0 82 04 86After this the communication baud rate is set to 115200 and the master device must change its own baud rate too.*) Checksum in square bracketsLine mode commandsSendReceiveReading the target temperatures from the devices with addresses 1.5 one time:2E 0504 D3 04 4C 04 B0 05 14 05 78 Addr 1 = 04D3hex = 23.5CAddr 2 = 044Chex = 10.0CAddr 3 = 04B0hex = 20.0CAddr 4 = 0514hex = 30.0CAddr 5 = 0578hex = 40.0CReading the target temperatures from the devices with addresses 1.5 continouosly with a cycle time of 50ms, timer is device 3B3 2F 32 052E 05 04 D3 04 4C 04 B0 05 14 05 78 2E 05 is the continuously repeated command of time device 3temperatures: (23.5, 10, 20, 30, 40)Stopping the continuously line mode of timer device 3B3 2F 00 00-This stops line mode of timer device 3. Note: If you setup a big number of devices with a short cycle time it is possible that the line mode cant be stopped.Head CodeThe head code commands (read 24, set A4) must be sent for any of the three blocks of the head code. The first byte of the command is the head code block number.The three following data bytes of any of the three commands encode the four digits of any block in a 5-bit-formatBit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0Byte2d3.4d3.3d3.2d3.1Byte3d3.0d2.4d2.3d2.2d2.1d2.0d1.4d1.3Byte4d1.2d1.1d1.0d0.4d0.3d0.2d0.1d0.0dx.4 . dx.0 encodes the bytes of the block in a 5-bit-format (the ASCII-numbers followed by the ASCII-letters):000000000100010000110010000101001100011101000010010101001011011000110101110011110123456789ABCCEF10000100011001010011101001010110110101111100011001110101101111100111011111011111GHIJKLMNOPQRSTUVExample: (headcode is B6JG M2IM 0IKC):Send the two bytes 24 01 to retrieve thesecond block of the Head code:The command responds: 01 0B 0A 56This is binary: 00000001 00001011 00001010 01010110With other words:10110 00010 10010 10110 = M2IMRead/Set Head CodeSend *)ReceiveRead head code block 124 0000 05 9A 70B6JGRead head code block 224 0101 0B 0A 56M2IMRead head code block 324 0202 00 4A 8C0IKCSet head code block 1 to B6JGA4 00 05 9A 70 4B00 05 9A 70B6JGSet head code block 2 to M2IMA4 01 0B 0A 56F201 0B 0A 56M2IMSet head code block 3 to 0IKCA4 02 00 4A 8C6002 00 4A 8C0IKC*) Checksum in square bracketsAlarm modeThe OPTRIS CT has 4 alarms. These alarm modes can be controlled by the Alarm mode command (read 28, set A8).To read or set a alarm mode a byte must follow the command byte that specifies the alarm:Byte1Alarm0Alarm 11Alarm 22Output channel 2 (ambient / head temperature)3Output channel 1 (IR / Object temperature)The data byte (byte2) contains the following informationBitDescriptionRelevant for alarm0123Bit7Source for the alarm is the box temperaturexxx-Bit6Source for the alarm is the head temperaturexxx-Bit5Source for the alarm is the object temperaturexxxxBit40 = contact is normally closed, 1 = contact is normally openxxxxBit31 = Output is digital, 0 = output is analog (if not used for alarm)-xxBit020 = Output as 010mV1 = Output as 05V-xx2 = Output as 020mA4 = Output as TCK3 = Output as 420mA5 = Output as TCJ-xNote: not every setting is relevant for all alarms. For example the IR-Output cant watch the box temperature, but it is the only one that can configured as Thermocouple J.Read/Set alarm examplesSend *)ReceiveRead alarm mode, alarm 128 0000 80Source=TBox, normally closedRead alarm 1 value0A04 1A5CRead alarm mode, alarm 228 0101 90Source=TBox, normally openRead alarm 2 value0B05 DC50CRead alarm mode, ambient output28 0202 51Source=THead, normally open, digitalRead ambient output alarm value0C06 A570.1CRead alarm mode, IR output28 0303 23Source=TObj, normally closed, digital, 4.20mARead IR output alarm value0D0B B8200CSet alarm mode, IR outputA8 03 03 8803 23Source=TObj, normally closed, digital, 4.20mASet IR output alarm value8D 07 D0 5A07 D0100C*) Checksum in square bracketsMaterial tableThe material table is organized in 8 rows and 4 columns. The rows correspond with the 8 entries in the table and the columns are defined as follow:ColumnContent0Epsilon=(byte2*256 + byte3) / 10001Alarm value A= (byte2*256 + byte3 - 1000) / 102Alarm value B= (byte2*256 + byte3 - 1000) / 103Device(is the same for all 8 entries)Higher 4 bit of byte3: source of alarm ALower 4 bit of byte3: source of alarm BAlarm sources:0 = alarm 1 (blue backlight)1 = alarm 2 (red backlight)2 = output channel 2 (ambient output)3 = output channel 1 (IR output)4 = alarm is not used by material tableAlso see the OPTRIS CT manual for material table editing.To read or set a value in the material table a byte must follow the command byte that specifies row and column in the table.The higher 4 bit of this byte dete

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论