diff --git a/firmware/modbus-sd-VSD-generic/data/pm8k_2024923.csv b/firmware/modbus-sd-VSD-generic/data/pm8k_2024923.csv new file mode 100644 index 0000000..61a41fd --- /dev/null +++ b/firmware/modbus-sd-VSD-generic/data/pm8k_2024923.csv @@ -0,0 +1,39 @@ + +Date Time,@1837,@1838,@1839,@1840,@1841,@2700,@2702,@2704,@2706,@2708,@2710,@2712,@2714,@2716,@2718,@2720,@2722,@2724,@2726,@2728,@2730,@2732,@2734,@2736,@2738,@2740,@2742,@2744,@2746,@2748,@2750,@2754,@2756,@2758,@2762,@2768,@2772,@2774,@2776,@2778,@2780,@2782,@2784,@2786,@2788,@2790,@2792,@2794,@2796,@2798,@2800,@2802,@2804,@2806,@2808,@2810,@3000,@3002,@3004,@3006,@3008,@3020,@3022,@3024,@3028,@3030,@3032,@3054,@3056,@3058,@3060,@3062,@3064,@3066,@3068,@3070,@3072,@3074,@3076,@3110, +2024-9-23 21:16:57,2024,9,23,21,22,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:17:5,2024,9,23,21,22,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:17:12,2024,9,23,21,22,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:17:20,2024,9,23,21,22,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:17:27,2024,9,23,21,22,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:17:35,2024,9,23,21,22,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +Date Time,@1837,@1838,@1839,@1840,@1841,@2700,@2702,@2704,@2706,@2708,@2710,@2712,@2714,@2716,@2718,@2720,@2722,@2724,@2726,@2728,@2730,@2732,@2734,@2736,@2738,@2740,@2742,@2744,@2746,@2748,@2750,@2754,@2756,@2758,@2762,@2768,@2772,@2774,@2776,@2778,@2780,@2782,@2784,@2786,@2788,@2790,@2792,@2794,@2796,@2798,@2800,@2802,@2804,@2806,@2808,@2810,@3000,@3002,@3004,@3006,@3008,@3020,@3022,@3024,@3028,@3030,@3032,@3054,@3056,@3058,@3060,@3062,@3064,@3066,@3068,@3070,@3072,@3074,@3076,@3110, +2024-9-23 21:48:7,2024,10,15,20,23,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:48:15,2024,10,15,20,23,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:48:22,2024,10,15,20,23,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:48:30,2024,10,15,20,23,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:48:37,2024,10,15,20,23,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:48:45,2024,10,15,20,24,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:48:53,2024,10,15,20,24,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:49:0,2024,10,15,20,24,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:49:8,2024,10,15,20,24,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:49:15,2024,10,15,20,24,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:49:23,2024,10,15,20,24,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:49:30,2024,10,15,20,24,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:49:38,2024,10,15,20,24,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:49:46,2024,10,15,20,25,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:49:53,2024,10,15,20,25,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:50:1,2024,10,15,20,25,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:50:8,2024,10,15,20,25,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:50:16,2024,10,15,20,25,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:50:24,2024,10,15,20,25,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:50:31,2024,10,15,20,25,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:50:39,2024,10,15,20,26,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:50:46,2024,10,15,20,26,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:50:54,2024,10,15,20,26,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:51:1,2024,10,15,20,26,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:51:9,2024,10,15,20,26,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:51:17,2024,10,15,20,26,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:51:24,2024,10,15,20,26,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:51:32,2024,10,15,20,26,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:51:39,2024,10,15,20,27,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, +2024-9-23 21:51:47,2024,10,15,20,27,275879.18,0.00,275879.18,275879.18,353.28,454.06,807.33,-100.78,275891.18,0.00,0.48,0.00,0.00,247401.81,0.00,0.00,353.28,0.00,0.00,454.06,30106.41,0.00,0.00,245756.50,0.00,0.00,4485.08,0.00,0.00,4437.08,0.00,nan,nan,nan,nan,nan,nan,nan,0.00,0.00,28477.23,0.00,0.00,246294.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,nan, \ No newline at end of file diff --git a/firmware/modbus-sd-VSD-generic/modbus-sd-VSD-generic.ino b/firmware/modbus-sd-VSD-generic/modbus-sd-VSD-generic.ino new file mode 100644 index 0000000..1ef0acc --- /dev/null +++ b/firmware/modbus-sd-VSD-generic/modbus-sd-VSD-generic.ino @@ -0,0 +1,304 @@ +#include +#include + +#include +#include +#include "util.h" +#include "register_map_vsd.h" + +// #include + +#include +#include +#define SD_CS_PIN 10 // Chip Select for SD Card +// RS485 pins +#define DE_RE_PIN 4 +#define RX_PIN 8 // SoftwareSerial RX pin +#define TX_PIN 7 // SoftwareSerial TX pin +#define SLAVE_ID 101 +#define SERIAL_BAUDRATE 9600 +#define LED_A_PID 3 +#define LED_B_PID 5 + +// Try to select the best SD card configuration. +#define SPI_CLOCK SD_SCK_MHZ(50) +#if HAS_SDIO_CLASS +#define SD_CONFIG SdioConfig(FIFO_SDIO) +#elif ENABLE_DEDICATED_SPI +#define SD_CONFIG SdSpiConfig(SD_CS_PIN, DEDICATED_SPI, SPI_CLOCK) +#else // HAS_SDIO_CLASS +#define SD_CONFIG SdSpiConfig(SD_CS_PIN, SHARED_SPI, SPI_CLOCK) +#endif // HAS_SDIO_CLASS + +RTC_DS3231 rtc; // Create an RTC object +SdFat32 sd; +// SdExFat sd; +File dataFile; +NeoSWSerial modbusSerial(RX_PIN, TX_PIN); // Create a software serial instance +ModbusMaster node; + +unsigned long lastRefreshTime = 0; +bool headerWritten = false; +bool booted = false; + +void flicker(uint8_t pin, uint8_t times, uint16_t speed) +{ + for (int i = 0; i < times; i++) + { + delay(speed); + digitalWrite(pin, HIGH); + delay(speed); + digitalWrite(pin, LOW); + } +} + +void setup() +{ + booted = false; + pinMode(LED_A_PID, OUTPUT); + pinMode(LED_B_PID, OUTPUT); + digitalWrite(LED_A_PID, LOW); + digitalWrite(LED_B_PID, HIGH); + + Serial.begin(SERIAL_BAUDRATE); // For debugging + Serial.println(F("Startup \n")); + + // Initialize RTC + if (!rtc.begin()) + { + Serial.println(F("Couldn't find RTC\n")); + flicker(LED_B_PID, 4, 1000); // 4 times on LED b is RTC Error + digitalWrite(LED_B_PID, HIGH); + digitalWrite(LED_A_PID, HIGH); + return; + } + + if (rtc.lostPower()) + { + Serial.println(F("RTC lost power, let's set the time!\n")); + // Comment out the following line once the time is set to avoid resetting on every start + rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); + flicker(LED_B_PID, 4, 500); // 6 times fast on LED b is RTC reset + } + + Serial.print(F("Time: ")); + Serial.print(rtc.now().timestamp()); + Serial.println(F("\n")); + + // Initialize SD card + Serial.println(F("SD card initializing...")); + pinMode(SD_CS_PIN, OUTPUT); + + // if (!SD.begin(SPI_HALF_SPEED, SD_CS_PIN )) + // { + // Serial.println(F("SD card initialization failed!\n")); + // return; + // } + // Initialize the SD. + if (!sd.begin(SD_CONFIG)) + { + flicker(LED_B_PID, 2, 1000); + digitalWrite(LED_B_PID, HIGH); + sd.initErrorHalt(&Serial); + + // 2 Times slow and stay on, SD Card initilize error + return; + } + Serial.println(F("SD card initialized.\n")); + + Serial.println(F("Initialize RS485 module / Modbus \n")); + + pinMode(DE_RE_PIN, OUTPUT); + digitalWrite(DE_RE_PIN, LOW); // Set to LOW for receiving mode initially + modbusSerial.begin(SERIAL_BAUDRATE); + + node.begin(SLAVE_ID, modbusSerial); + node.preTransmission(preTransmission); + node.postTransmission(postTransmission); + flicker(LED_B_PID, 10, 100); + digitalWrite(LED_B_PID, LOW); + booted = true; +} + +void preTransmission() +{ + // Serial.println(F("Transmitting Start")); + digitalWrite(DE_RE_PIN, HIGH); // Enable RS485 transmit + digitalWrite(LED_A_PID, HIGH); +} + +void postTransmission() +{ + + digitalWrite(DE_RE_PIN, LOW); // Disable RS485 transmit + digitalWrite(LED_A_PID, LOW); + // Serial.println(F("Transmitting End")); +} + +void primeFileDate() +{ + if (!dataFile) + { + Serial.println(F("Error opening file")); + return; + } + DateTime now = rtc.now(); + // Log the current date and time + dataFile.print("\n"); + dataFile.print(now.year(), DEC); + dataFile.print('-'); + dataFile.print(now.month(), DEC); + dataFile.print('-'); + dataFile.print(now.day(), DEC); + dataFile.print(" "); + dataFile.print(now.hour(), DEC); + dataFile.print(':'); + dataFile.print(now.minute(), DEC); + dataFile.print(':'); + dataFile.print(now.second(), DEC); + dataFile.print(F(",")); +} + +String getFilename() +{ + DateTime now = rtc.now(); + String mb = F("pm8k_"); + mb += now.year(); + mb += now.month(); + mb += now.day(); + mb += F(".csv"); + + return mb; +} + +// const char[20] filename = "20240523.csv"; + +void loop() +{ + if (!booted) + { + Serial.print(F("\nBoot failed, cycle ")); + + delay(10000); + digitalWrite(LED_A_PID, LOW); + return; + } + delay(100); + String writebuffer; + + if (millis() - lastRefreshTime >= 1000) + { + lastRefreshTime += 1000; + + Serial.print(F("\nTime: ")); + Serial.print(rtc.now().timestamp()); + // Serial.print("\nHeep:"); + // Serial.print(ESP.getFreeHeap()); + const uint16_t totalReg = sizeof(registers) / sizeof(registers[0]); + float rawValues[totalReg] = {0}; + // Open File + String filename = getFilename(); + Serial.print(F("Open Card ")); + Serial.print(filename.c_str()); + Serial.print("\n"); + if (!dataFile.open(filename.c_str(), FILE_WRITE)) + { + flicker(LED_B_PID, 6, 500); // Six quick flickers. SD Card error + Serial.println(F("Failed to Open Card ")); + } + if (!headerWritten) + { + dataFile.print("\nDate Time,"); + for (int i = 0; i < totalReg; i++) + { + const uint16_t regaddr = pgm_read_word(®isters[i].regaddr); + dataFile.print("@"); + dataFile.print(regaddr); + dataFile.print(","); + } + headerWritten = true; + flicker(LED_A_PID, 50, 10); // 10 flickers, written header + } + primeFileDate(); + + Serial.print("\n"); + Serial.println(totalReg); + + // First pass - read all base registers + + + for (int i = 0; i < totalReg; i++) { + const uint16_t regaddr = pgm_read_word(®isters[i].regaddr); + const uint8_t regtype = pgm_read_word(®isters[i].regtype); + + if (regaddr > 0 && regtype <= 3) { // Only read direct registers + delay(25); + uint8_t result = node.readHoldingRegisters(regaddr - 1, 2); + delay(25); + + if (result == node.ku8MBSuccess) { + switch(regtype) { + case 1: + rawValues[i] = node.getResponseBuffer(0); + break; + case 2: + rawValues[i] = getRegisterFloat(node.getResponseBuffer(0), node.getResponseBuffer(1)); + break; + case 3: + rawValues[i] = getRegisterInt64(node.getResponseBuffer(0), node.getResponseBuffer(1), + node.getResponseBuffer(2), node.getResponseBuffer(3)); + break; + } + } + } + } + + // Second pass - process all registers including derived values + for (int i = 0; i < totalReg; i++) { + const uint8_t regtype = pgm_read_word(®isters[i].regtype); + const float scale = pgm_read_float(®isters[i].scale); + float value = 0; + + switch(regtype) { + case 1: + case 2: + case 3: + value = rawValues[i] * scale; + break; + case 4: + value = calculateStatusWord(rawValues) * scale; + break; + case 5: + value = calculateThermal(rawValues) * scale; + break; + case 6: + value = calculatePower(rawValues) * scale; + break; + case 7: + value = calculateRPM(rawValues) * scale; + break; + } + + dataFile.print(value); + dataFile.print(","); + } + + + Serial.print(F("\nRead buffer: ")); + delay(10); + + if (dataFile) + { + dataFile.close(); // Close the file + Serial.print(F("Data written to SD card: ")); + Serial.print(filename.c_str()); + Serial.print(F("\n")); + } + + Serial.print(F("\n\n")); + + flicker(LED_A_PID, 4, 100); // Cycle written 4 quick flickers + } + + // // Check if the read was successful +} diff --git a/firmware/modbus-sd-VSD-generic/modbus-sd-vsd.md b/firmware/modbus-sd-VSD-generic/modbus-sd-vsd.md new file mode 100644 index 0000000..27ffed2 --- /dev/null +++ b/firmware/modbus-sd-VSD-generic/modbus-sd-vsd.md @@ -0,0 +1,120 @@ +# Modbus Reading for Generic VSD Device + +This is a specification and implementation of the Arduino-based Modbus data logger for a Generic VSD Device. +This software is designed for Vivarox EMS and only Vivarox has right to use and modify this software. + +## Arduino Implementation: + +This project uses an Arduino to connect to Modbus devices, read information, and log it onto an SD card with timestamps. + +### Hardware needed: + +1. Arduino Board + Recommended: Arduino MEGA 2560 (for more memory and I/O pins) or Arduino UNO (for simpler projects). + - [Arduino MEGA @ R377.20](https://www.robotics.org.za/MEGA-16U2?search=Arduino%20MEGA%202560) + - [UNO R3 with 16U2 USB Interface @ R151.00](https://www.robotics.org.za/UNOR3-16U2?search=%20Arduino%20UNO) + +2. RS485 to TTL Module + Allows communication between the Arduino and Modbus devices using the RS485 protocol. + - [RS485 Module (TTL -> RS485) @ R25.30](https://www.robotics.org.za/RS485-MOD) + - [MAX485 Bus Transceiver (4 Pack) @ R16.00](https://www.robotics.org.za/MAX485-DIP?search=MAX485) + +3. SD Card Module + Allows the Arduino to read from and write data to an SD card. + - [Micro SD Card Module @ R25.00](https://www.diyelectronics.co.za/store/memory/512-micro-sd-card-module.html?srsltid=AfmBOoptww8c6kx53xbZWiP2_C_qOE3r9xinyoCO-AZHrZkNQiyxU17c) + +4. RTC Module + To keep track of the current date and time, even when the Arduino is powered off. + - [DS3231 Real Time Clock Module @ R55.20](https://www.robotics.org.za/DS3231-MOD?search=DS3231) + +5. Power Supply + To power the Arduino and connected peripherals. + - [AC Adapter 9V with barrel jack @ R60](https://www.robotics.org.za/AC-9V-2A-2155?search=%20Power%20Supply) + +6. LED Indicators + Two LEDs for status indication (not included in original cost estimate). + +### Wiring + +#### RS485 Module to Arduino: +1. RO (Receiver Output) to Arduino RX (pin 8) +2. DI (Driver Input) to Arduino TX (pin 7) +3. DE (Driver Enable) & RE (Receiver Enable) to Arduino digital pin 4 +4. VCC to 5V on Arduino +5. GND to GND on Arduino +6. A & B (RS485 differential pair) to Modbus device + +#### SD Card Module to Arduino: +1. VCC to 5V on Arduino +2. GND to GND on Arduino +3. MOSI to MOSI (pin 51 on MEGA, pin 11 on UNO) +4. MISO to MISO (pin 50 on MEGA, pin 12 on UNO) +5. SCK to SCK (pin 52 on MEGA, pin 13 on UNO) +6. CS (Chip Select) to digital pin 10 + +#### RTC Module to Arduino: +1. VCC to 5V on the Arduino +2. GND to GND on the Arduino +3. SDA to SDA (pin 20 on MEGA, pin A4 on UNO) +4. SCL to SCL (pin 21 on MEGA, pin A5 on UNO) + +#### LED Indicators: +1. LED A to digital pin 3 +2. LED B to digital pin 5 + +### Software + +- Modbus Library: ModbusMaster +- SD Library: SdFat (more advanced than the standard SD library) +- RTC Library: RTClib by Adafruit +- NeoSWSerial: For better latency on software serial communication + +### Implementation Details + +1. Modbus Configuration: + - Slave ID: 101 + - Baud Rate: 9600 + - Register map: Defined in separate "register_map_pm8000.h" file + +2. Data Logging: + - Frequency: Readings taken every second + - File Format: CSV (Comma-Separated Values) + - Filename: "pm8k_YYYYMMDD.csv" (generated daily based on current date) + - Data Structure: Timestamp, followed by register values + - Header Row: Includes register addresses for easy identification + +3. Register Types Supported: + - Float (32-bit) + - Integer (32-bit) + - Long (64-bit) + - String (up to 20 characters) + +4. Error Handling and Status Indication: + - LED A: Indicates successful data writing and transmission + - LED B: Indicates errors (e.g., SD card issues, RTC problems, Modbus communication errors) + - Serial output for debugging (9600 baud) + +5. Special Features: + - Automatic creation of new log file on date change + - Header row written only once per file + - Robust error handling for SD card, RTC, and Modbus communication + +### Programming Workflow + +1. Initialize hardware (RTC, SD card, RS485 module) +2. Set up Modbus communication parameters +3. Enter main loop: + - Read current time from RTC + - Read data from Modbus registers + - Write timestamped data to SD card + - Handle any errors and provide status indication via LEDs + - Delay for 1 second before next reading + +## Best Practices + +- Start by commenting out registers you don't need before adding new ones. +- If you're using an Arduino UNO, you may need to be more selective about which registers to include due to memory constraints. +- Test your modifications incrementally to ensure the Arduino can handle the memory load. +- If you need to read a large number of registers, consider using an Arduino MEGA or a more powerful microcontroller. + +By carefully managing the registers in the `register_map_vsd.h` file, you can customize this Modbus reader to suit your specific requirements while staying within the memory limitations of your Arduino board. diff --git a/firmware/modbus-sd-VSD-generic/register_map_vsd.h b/firmware/modbus-sd-VSD-generic/register_map_vsd.h new file mode 100644 index 0000000..8110794 --- /dev/null +++ b/firmware/modbus-sd-VSD-generic/register_map_vsd.h @@ -0,0 +1,65 @@ + +#include +#ifndef REGISTER_MAP_VSD_H +#define REGISTER_MAP_VSD_H + +struct RegisterMap { + uint16_t regaddr; + uint8_t regtype; // 1=UINT16, 2=FLOAT32, 3=INT64, 4=Status, 5=Thermal, 6=Power, 7=RPM + uint32_t sr_addr; + float scale; +}; + +const PROGMEM RegisterMap registers[] = { + {0x0000, 4, 402910, 1.0}, // Status Word + {3060, 6, 402911, 1.0}, // Min Active Value + {3000, 5, 402912, 1.0}, // Thermal Sense + {3110, 2, 402913, 10.0}, // Frequency + {1840, 1, 402914, 1.0}, // Running Hours + {1840, 1, 402916, 1.0}, // Operating Hours + {2700, 2, 402918, 1.0}, // kWh Counter + {3060, 2, 402920, 100.0}, // Input Power kW + {3060, 6, 402922, 134.102}, // Input Power HP + {3006, 2, 402924, 100.0}, // Motor Current + {3000, 2, 402926, 100.0}, // Phase I1 + {3002, 2, 402928, 100.0}, // Phase I2 + {3004, 2, 402930, 100.0}, // Phase I3 + {3110, 7, 402932, 60.0}, // Motor RPM + {3028, 2, 402934, 10.0}, // Motor Voltage + {3060, 6, 402935, 1.0}, // Torque Nm + {3000, 5, 402936, 1.0}, // Motor Thermal + {3000, 5, 402937, 1.0}, // Heatsink Temp + {3000, 5, 402938, 1.0}, // Card Temp + {3000, 5, 402939, 1.0}, // Inverter Thermal + {3028, 2, 402940, 1.0}, // DC Link Voltage + {3060, 6, 402941, 1.0}, // Motor Torque % + {3006, 2, 402942, 100.0}, // Inverter Nominal Current + {3006, 2, 402944, 100.0}, // Inverter Max Current + {0x0000, 4, 402946, 1.0}, // Alarm Word 1 + {0x0000, 4, 402948, 1.0}, // Alarm Word 2 + {0x0000, 4, 402950, 1.0}, // Warning Word 1 + {0x0000, 4, 402952, 1.0}, // Warning Word 2 + {0x0000, 4, 402954, 1.0}, // Power Ups + {3000, 5, 402955, 1.0} // Over Temp Counter +}; + +float calculateStatusWord(float* values) { + uint16_t status = 0; + if(values[0] > 0) status |= 0x0001; // Running + if(values[1] > 100) status |= 0x0002; // Overload + return status; +} + +float calculateThermal(float* values) { + return (values[0] / 100.0) * 100.0; +} + +float calculatePower(float* values) { + return values[0] * 0.746; // kW to HP conversion +} + +float calculateRPM(float* values) { + return values[0] * 60.0; +} + +#endif \ No newline at end of file diff --git a/firmware/modbus-sd-VSD-generic/util.h b/firmware/modbus-sd-VSD-generic/util.h new file mode 100644 index 0000000..fc150b3 --- /dev/null +++ b/firmware/modbus-sd-VSD-generic/util.h @@ -0,0 +1,27 @@ +#include +#include +#include + +uint32_t getRegisterUInt32(uint16_t highWord, uint16_t lowWord) { + uint32_t val = (highWord << 16) + lowWord; + return val; +} + +int32_t getRegisterInt32(uint16_t highWord, uint16_t lowWord) { + int32_t val = (highWord << 16) + lowWord; + return val; +} + +int64_t getRegisterInt64(uint16_t word1, uint16_t word2, uint16_t word3, uint16_t word4) { + uint64_t val = ((uint64_t)word1 << 48) + ((uint64_t)word2 << 32) + (word3 << 16) + word4; + return val; +} + +float getRegisterFloat(uint16_t highWord, uint16_t lowWord) { + uint32_t floatRaw = ((uint32_t)highWord << 16) | lowWord; + float floatValue; + + memcpy(&floatValue, &floatRaw, sizeof(float)); + return floatValue; +} +