From: Uwe Hermann Date: Sat, 22 Aug 2015 16:23:19 +0000 (+0200) Subject: modbus: Add a test-case. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=87e6446b6ee41c40a8479906d99a9b2fd3d552a4;p=sigrok-test.git modbus: Add a test-case. --- diff --git a/decoder/test/modbus/brainchild_io_16do.output b/decoder/test/modbus/brainchild_io_16do.output new file mode 100644 index 0000000..6c651d8 --- /dev/null +++ b/decoder/test/modbus/brainchild_io_16do.output @@ -0,0 +1,157 @@ +31179-31597 modbus: cs-server-id: "Slave ID: 1" +31756-32174 modbus: cs-function: "Function 1: Read Coils" +32333-33329 modbus: cs-address: "Start at address 0x3 / 10004" +33488-34484 modbus: cs-length: "Read 1 units of data" +34643-35638 modbus: cs-crc: "CRC correct" +37901-38319 modbus: sc-server-id: "Slave ID: 1" +38475-38893 modbus: sc-function: "Function 1: Read Coils" +39049-39467 modbus: sc-length: "Byte count: 1" +39622-40040 modbus: sc-data: "00000001" +40196-41188 modbus: sc-crc: "CRC correct" +44485-44903 modbus: cs-server-id: "Slave ID: 1" +45062-45480 modbus: cs-function: "Function 2: Read Discrete Inputs" +45639-46634 modbus: cs-address: "Start at address 0x0 / 20001" +46794-47789 modbus: cs-length: "Read 1 units of data" +47949-48944 modbus: cs-crc: "CRC correct" +51201-51619 modbus: sc-server-id: "Slave ID: 1" +51775-52193 modbus: sc-function: "Function 2: Read Discrete Inputs" +52349-52767 modbus: sc-length: "Byte count: 1" +52923-53341 modbus: sc-data: "00000000" +53496-54488 modbus: sc-crc: "CRC correct" +58485-58903 modbus: cs-server-id: "Slave ID: 1" +59062-59480 modbus: cs-function: "Function 3: Read Holding Registers" +59639-60635 modbus: cs-address: "Start at address 0x63 / 30100" +60794-61790 modbus: cs-length: "Read 1 units of data" +61949-62944 modbus: cs-crc: "CRC correct" +65180-65598 modbus: sc-server-id: "Slave ID: 1" +65753-66171 modbus: sc-function: "Function 3: Read Holding Registers" +66327-66745 modbus: sc-length: "Byte count: 2" +66901-67893 modbus: sc-data: "0x0201 / 513" +68048-69040 modbus: sc-crc: "CRC correct" +72485-72903 modbus: cs-server-id: "Slave ID: 1" +73062-73480 modbus: cs-function: "Function 4: Read Input Registers" +73640-74635 modbus: cs-address: "Start at address 0x78 / 40121" +74795-75790 modbus: cs-length: "Read 1 units of data" +75949-76945 modbus: cs-crc: "CRC correct" +79158-79576 modbus: sc-server-id: "Slave ID: 1" +79732-80150 modbus: sc-function: "Function 4: Read Input Registers" +80306-80724 modbus: sc-length: "Byte count: 2" +80879-81871 modbus: sc-data: "0x4B00 / 19200" +82027-83019 modbus: sc-crc: "CRC correct" +86493-86911 modbus: cs-server-id: "Slave ID: 1" +87071-87489 modbus: cs-function: "Function 5: Write Single Coil" +87648-88643 modbus: cs-address: "Address 0x3 / 10003" +88803-89798 modbus: cs-data: "Coil Value ON" +89957-90953 modbus: cs-crc: "CRC correct" +93189-93607 modbus: sc-server-id: "Slave ID: 1" +93762-94180 modbus: sc-function: "Function 5: Write Single Coil" +94336-95328 modbus: sc-address: "Address 0x3 / 10003" +95484-96475 modbus: sc-data: "Coil Value ON" +96631-97623 modbus: sc-crc: "CRC correct" +101484-101902 modbus: cs-server-id: "Slave ID: 1" +102062-102480 modbus: cs-function: "Function 6: Write Single Register" +102639-103634 modbus: cs-address: "Address 0x1 / 30001" +103794-104789 modbus: cs-data: "Register Value 0x55 / 85" +104949-105944 modbus: cs-crc: "CRC correct" +108158-108576 modbus: sc-server-id: "Slave ID: 1" +108732-109150 modbus: sc-function: "Function 6: Write Single Register" +109305-110297 modbus: sc-address: "Address 0x1 / 30001" +110453-111445 modbus: sc-data: "Register Value 0x55 / 85" +111600-112592 modbus: sc-crc: "CRC correct" +116494-116912 modbus: cs-server-id: "Slave ID: 1" +117071-117489 modbus: cs-function: "Function 15: Write Multiple Coils" +117649-118644 modbus: cs-address: "Start at address 0x2 / 10003" +118803-119799 modbus: cs-length: "Write 1 Coils" +119958-120376 modbus: cs-length: "Byte count: 1" +120535-120953 modbus: cs-data: "Value 0x1" +121113-122108 modbus: cs-crc: "CRC correct" +124379-124797 modbus: sc-server-id: "Slave ID: 1" +124953-125371 modbus: sc-function: "Function 15: Write Multiple Coils" +125527-126518 modbus: sc-address: "Start at address 0x2 / 10003" +126674-127666 modbus: sc-data: "Write 1 Coils" +127822-128813 modbus: sc-crc: "CRC correct" +132488-132906 modbus: cs-server-id: "Slave ID: 1" +133065-133483 modbus: cs-function: "Function 16: Write Multiple Registers" +133642-134638 modbus: cs-address: "Start at address 0x1 / 30002" +134797-135793 modbus: cs-length: "Write 1 Registers" +135952-136370 modbus: cs-length: "Byte count: 2" +136529-136947 modbus: cs-data: "Value 0x0" +137107-137525 modbus: cs-data: "Value 0xAA" +137684-138679 modbus: cs-crc: "CRC correct" +140913-141331 modbus: sc-server-id: "Slave ID: 1" +141487-141905 modbus: sc-function: "Function 16: Write Multiple Registers" +142061-143052 modbus: sc-address: "Start at address 0x1 / 30002" +143208-144200 modbus: sc-data: "Write 1 Registers" +144356-145347 modbus: sc-crc: "CRC correct" +199560-199978 modbus: cs-server-id: "Slave ID: 1" +200137-200555 modbus: cs-function: "Function 1: Read Coils" +200715-201710 modbus: cs-address: "Start at address 0x3 / 10004" +201869-202865 modbus: cs-length: "Read 1 units of data" +203024-204019 modbus: cs-crc: "CRC correct" +206267-206685 modbus: sc-server-id: "Slave ID: 1" +206841-207259 modbus: sc-function: "Function 1: Read Coils" +207415-207833 modbus: sc-length: "Byte count: 1" +207989-208407 modbus: sc-data: "00000001" +208562-209554 modbus: sc-crc: "CRC correct" +213495-213913 modbus: cs-server-id: "Slave ID: 1" +214072-214490 modbus: cs-function: "Function 2: Read Discrete Inputs" +214650-215645 modbus: cs-address: "Start at address 0x0 / 20001" +215804-216800 modbus: cs-length: "Read 1 units of data" +216959-217954 modbus: cs-crc: "CRC correct" +220194-220612 modbus: sc-server-id: "Slave ID: 1" +220767-221185 modbus: sc-function: "Function 2: Read Discrete Inputs" +221341-221759 modbus: sc-length: "Byte count: 1" +221915-222333 modbus: sc-data: "00000000" +222489-223480 modbus: sc-crc: "CRC correct" +227494-227912 modbus: cs-server-id: "Slave ID: 1" +228071-228489 modbus: cs-function: "Function 3: Read Holding Registers" +228649-229644 modbus: cs-address: "Start at address 0x63 / 30100" +229803-230799 modbus: cs-length: "Read 1 units of data" +230958-231954 modbus: cs-crc: "CRC correct" +234172-234590 modbus: sc-server-id: "Slave ID: 1" +234746-235164 modbus: sc-function: "Function 3: Read Holding Registers" +235319-235737 modbus: sc-length: "Byte count: 2" +235893-236885 modbus: sc-data: "0x0201 / 513" +237041-238032 modbus: sc-crc: "CRC correct" +241488-241906 modbus: cs-server-id: "Slave ID: 1" +242065-242483 modbus: cs-function: "Function 4: Read Input Registers" +242642-243638 modbus: cs-address: "Start at address 0x78 / 40121" +243797-244792 modbus: cs-length: "Read 1 units of data" +244952-245947 modbus: cs-crc: "CRC correct" +248202-248620 modbus: sc-server-id: "Slave ID: 1" +248776-249194 modbus: sc-function: "Function 4: Read Input Registers" +249350-249768 modbus: sc-length: "Byte count: 2" +249924-250915 modbus: sc-data: "0x4B00 / 19200" +251071-252063 modbus: sc-crc: "CRC correct" +255496-255914 modbus: cs-server-id: "Slave ID: 1" +256073-256491 modbus: cs-function: "Function 5: Write Single Coil" +256651-257646 modbus: cs-address: "Address 0x3 / 10003" +257805-258801 modbus: cs-data: "Coil Value ON" +258960-259955 modbus: cs-crc: "CRC correct" +262181-262599 modbus: sc-server-id: "Slave ID: 1" +262755-263173 modbus: sc-function: "Function 5: Write Single Coil" +263328-264320 modbus: sc-address: "Address 0x3 / 10003" +264476-265468 modbus: sc-data: "Coil Value ON" +265623-266615 modbus: sc-crc: "CRC correct" +270495-270913 modbus: cs-server-id: "Slave ID: 1" +271072-271490 modbus: cs-function: "Function 6: Write Single Register" +271650-272645 modbus: cs-address: "Address 0x1 / 30001" +272804-273800 modbus: cs-data: "Register Value 0x55 / 85" +273959-274954 modbus: cs-crc: "CRC correct" +277202-277620 modbus: sc-server-id: "Slave ID: 1" +277776-278194 modbus: sc-function: "Function 6: Write Single Register" +278350-279342 modbus: sc-address: "Address 0x1 / 30001" +279497-280489 modbus: sc-data: "Register Value 0x55 / 85" +280645-281637 modbus: sc-crc: "CRC correct" +285449-285867 modbus: cs-server-id: "Slave ID: 1" +286026-286444 modbus: cs-function: "Function 15: Write Multiple Coils" +286603-287599 modbus: cs-address: "Start at address 0x2 / 10003" +287758-288753 modbus: cs-length: "Write 1 Coils" +288913-289331 modbus: cs-length: "Byte count: 1" +289490-289908 modbus: cs-data: "Value 0x1" +290067-291063 modbus: cs-crc: "CRC correct" +293319-293737 modbus: sc-server-id: "Slave ID: 1" +293893-294311 modbus: sc-function: "Function 15: Write Multiple Coils" +294467-295458 modbus: sc-address: "Start at address 0x2 / 10003" +295614-296606 modbus: sc-data: "Write 1 Coils" +296762-297753 modbus: sc-crc: "CRC correct" diff --git a/decoder/test/modbus/test.conf b/decoder/test/modbus/test.conf new file mode 100644 index 0000000..87c6c1f --- /dev/null +++ b/decoder/test/modbus/test.conf @@ -0,0 +1,6 @@ +test brainchild_io_16do + protocol-decoder uart channel rx=0 channel tx=1 option baudrate=19200 option invert_rx=yes option invert_tx=yes + protocol-decoder modbus option channel=RX + stack uart modbus + input uart/modbus_rtu/brainchild_io_16do/brainchild-io-16do.sr + output modbus annotation match brainchild_io_16do.output