example1.csv 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // Example Test Script for ModScan Application
  3. //
  4. // Each Script entry consists of the following
  5. // comma delimited data fields:
  6. //
  7. // TEST NAME, NODE, FUNCTION, ADDRESS, LENGTH, DATA, CONTROL CODE
  8. //
  9. // Double slashes on the front of a line denote comments
  10. //
  11. // The following Control Codes may be used (i.e. last field on each line)
  12. // \ -- Continue DATA fields on next line
  13. // C -- Generate Bad CRC message to slave
  14. // D -- Check response data quantity only, (ignore actual data)
  15. // 1 -- Expect Exception Response 01
  16. // 2 -- Expect Exception Response 02
  17. // 4 -- Expect Exception Response 04
  18. // 6 -- Expect Exception Response 06
  19. // R -- Expect no Response
  20. // T (default) -- Verify Response Data
  21. // (Added March 2001)
  22. // %d -- Verify Response Data using a percentage tolerance
  23. // value around the expected data. Only valid for
  24. // modbus function codes 03 & 04 and only valid to
  25. // to compare 16-bit register values. May not be used
  26. // with registers containing floats, longs, etc.
  27. // New Test:
  28. // Read a single Holding Register at address 100 and
  29. // compare its value to +/- 5% of 1000. Test will pass
  30. // if register contains data between 950 - 1050.
  31. //
  32. Analog Value Test,1,3,100,1,1000,%5
  33. //
  34. // First Test:
  35. // Write 20 Coils to Node 1 starting at address 100
  36. // Data is alternating pattern of ones & zeros
  37. // (DATA field consists of 32-bits and may be specified
  38. // as a decimal, hex or floating-point value)
  39. //
  40. Preset Multiple Coils,1,15,100,20,0xAAAAA,T
  41. //
  42. //
  43. // Second Test:
  44. // Verify results of first test by reading the pattern back
  45. //
  46. Verify Coil Status,1,1,100,20,0xAAAAA,T
  47. //
  48. // Third Test:
  49. // Read 100 Input Status values
  50. // ignore the data and only verify proper quantity returned
  51. //
  52. Verify Input Status,1,2,100,100,0,D
  53. //
  54. //
  55. // Forth Test:
  56. // Check Slave Response to request for 1000 registers
  57. // (Should probably generate an exception response)
  58. //
  59. Test Exception 2,1,3,100,1000,0,2
  60. //
  61. // Fifth Test:
  62. // Check Slave Response to bad CRC
  63. //
  64. Invalid Request,1,1,100,1,0,C
  65. //
  66. // Sixth Test:
  67. // Query an unknown device & expect no response
  68. //
  69. Query Device 73,73,1,1,1,0,R
  70. //
  71. // Seventh Test:
  72. // Write 6 Holding Registers with data
  73. // (Each floating point number represents
  74. // two registers -- The NAME field on the
  75. // continuation line is ignored)
  76. //
  77. Write Floats,1,16,100,6,1.00,\
  78. ,2.00,3.00,,,,T
  79. //
  80. // Eighth Test:
  81. // Verify Test Seven by reading back the Registers
  82. //
  83. Read Floats,1,3,100,6,1.00,\
  84. ,2.00,3.00,,,,T
  85. //
  86. // END OF SCRIPT
  87. end