Skip to content

Commit 0e9c24d

Browse files
authored
sdm630 emulator next try
1 parent ec54012 commit 0e9c24d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

docs/Smart-Meter-Interface.md

+3-10
Original file line numberDiff line numberDiff line change
@@ -3604,7 +3604,7 @@ Show how to emulate an SDM630 e.g. to interact with a GROWATT solar inverter.
36043604

36053605
??? summary "View script"
36063606
```
3607-
>D
3607+
\>D
36083608
; simulate eastron sdm630 modbus meter
36093609
IP=192.168.188.114
36103610
; need this additional defs
@@ -3632,9 +3632,9 @@ Show how to emulate an SDM630 e.g. to interact with a GROWATT solar inverter.
36323632
curr1=0
36333633
cpw1=0
36343634
cvol1=230
3635-
>B
3635+
\>B
36363636
=>sensor53 r
3637-
>BS
3637+
\>BS
36383638
; should be hardware serial pins
36393639
res=so(rec trx 9600 8N1 1024)
36403640
if res==0 {
@@ -3729,18 +3729,14 @@ Show how to emulate an SDM630 e.g. to interact with a GROWATT solar inverter.
37293729
next
37303730
; write response
37313731
smw(addr 3 resp regs)
3732-
37333732
; multitasking every 1 ms
37343733
\>t1
3735-
37363734
; get current power from meter
37373735
cmpwr=sml[3]
3738-
37393736
; fake power
37403737
;cmpwr=3000+rnd(1000)
37413738
curr1=cmpwr/230/3
37423739
cpw1=cmpwr/3
3743-
37443740
; check for incomming request
37453741
res=sa()
37463742
if res>=8 {
@@ -3770,10 +3766,7 @@ if res>=8 {
37703766
res=sa()
37713767
res=sra(resp)
37723768
}
3773-
37743769
}
3775-
3776-
37773770
\>R
37783771
; close serial port
37793772
sc()

0 commit comments

Comments
 (0)