Sunny Net Communication Driver

 

Sunny Net is driver to communicate with Sunny boy device of SMA Regelsyteme Corp., in Germany.

 

1. Read settings

 

<Figure 1> is read setting example of Sunny Net communication driver.

<Figure 1> Read setting example of Sunny Net driver

Device part of <Figure 1> input Com Port(COM1), Baud Rate(19200), Parity Bit(0), Data Bit(8), Stop Bit(1) respectively.

If you want to communicate by using Ethernet module, set the device settings as UDP/IP, IP, Service port(24272).

In protocol option part, you can set the following: station number of computer(source) (0 ~ 65535, Default = 0 ), whether to use synchronization code(0 = Not use, 1 = Use, Default = 0) for power line communication, whether to use SMA Net Frame(0 = Not use, 1 = Use,  Default = 0 ), device type number(0 = Default, 1 = SCC, 2 = SBC+,  Default = 0 ), delay time for each packet when using multi packet(0 ~ 5000 mSec, Default = 0), delay time after Time Sync(10 ~ 3000 mSec, Default = 10). Each argument  is a comma-delimited( , ).

You can set station number, baud rate, etc by front control button.

 

Note) When you using 'Sensor Box', the delay time after Time Sync should be set  '170 or over'.

 

Sunny Net communication driver's read schedule

Read schedule setting parameters are as follows:

1) Device Number – The set Address(0 ~ 65535) of Sunny Boy device.

2) Read Command – Fixed to 11(data read).

3) Read Start Address – Don't care.

4) Save Start Address for Communication Server - Saving start address of Communication Server.

5) Read Size – Always fixed to 1.

6) Read Data Save Method – 0 : Save as type of Normal, SBC and SCC+,

                                          1 ~ 255 : Set the save method for read data at WorkDirectory\SCAN\CH_INFO%03d.ini file. (Refer to <Table 4>)

 

Read schedule example)

READ,     FFh,    11,     0,    0,   1,

 

<Table 1> ~ <Table 3> are order and contents to save read value of Default, SCC and SBC+ device type which are read by 11(data read) command to communication memory.

<Table 4> is ini file writing method for saving read data(current value) and <Figure 2> is ini file writing example.

Save Address Save Contents Remarks
Save addr + 0 ~ 2 Year, Month, Day of read data Current time of device
Save addr + 3 ~ 5 Hour, Minute, Second of read data
Save addr + 6 Time Basis DWORD data
Save addr + 7 Analog data K1 Upv actual WORD data
Save addr + 8 Analog data K2 Upv nominal
Save addr + 9 Analog data K3 lac actual
Save addr + 10 Analog data K4 lac nominal
Save addr + 11 Analog data K5 Uac
Save addr + 12 Analog data K6 Fac
Save addr + 13 Analog data K7 Pac
Save addr + 14 Analog data K8 Zac
Save addr + 15 Analog data K9 d-Zac
Save addr + 16 Analog data K10 R-Iso
Save addr + 17 Analog data K11 Uac-Srr
Save addr + 18 Analog data K12 Fac-Srr
Save addr + 19 Analog data K13 Zac-Srr
Save addr + 20 Analog data K14 IZac
Save addr + 21 Analog data K15 TKK
Save addr + 22 Counter data K16 E-Total DWORD data
Save addr + 23 Counter data K17 h-Total
Save addr + 24 Counter data K18 Net-In
Save addr + 25 Counter data K19 ErrorCnt
Save addr + 26 Counter data K20 Snr
Save addr + 27 Status data K21 Status BYTE data
Save addr + 28 Status data K22 Status
<Table 1> Order and contents to save read value which is read by 11(data read) command of default device type, to communication memory
Save Address Save Contents Remarks
Save addr + 0 ~ 2 Year, Month, Day of read data Current time of device
Save addr + 3 ~ 5 Hour, Minute, Second of read data
Save addr + 6 Time Basis DWORD data
Save addr + 7 E-day [kWh]
Save addr + 8 E-total [kWh]
Save addr + 9 Mode and Error WORD data
Save addr + 10 Pac [W] FLOAT data
Save addr  + 11 Ppv [W]
Save addr + 12 MPP Search Count WORD data
Save addr + 13 Vpv [V] DWORD data
Save addr + 14 Upv0 [V]
Save addr + 15 Ipv [A] FLOAT data
Save addr + 16 Iac [A]
Save addr + 17 Vac Phase 1 [V]
Save addr + 18 Vac Phase 2 [V]
Save addr + 19 Vac Phase 3 [V]
Save addr + 20 Fac [Hz]
Save addr + 21 R_ISO
Save addr + 22 Temp SC [degree]
Save addr + 23 Temp PT100 [degree]
Save addr + 24 Reserved WORD data
Save addr + 25 Operation Time [h] DWORD data
Save addr + 26 Working time [h]
Save addr + 27 Tstart
Save addr + 28 Twait
Save addr + 29 Startup counter
Save addr + 30 Fault Counter
Save addr + 31 Warn Counter
Save addr + 32 ~ 51 K1 ~ K20 WORD data
Save addr + 52 ~ 56 AIN1, AIN3, AIN4, AIN5, AIN6 FLOAT data
Save addr + 57 ~ 64 Digital Input 1 ~ 8 (save to bit no.0 ) BYTE data
Save addr + 65 FI-status WORD data
Save addr + 66 FI-code BYTE data
Save addr + 67 Energy Value WORD data
<Table 2> Order and contents to save read value which is read by 11(data read) command of SCC device type, to communication memory
Save Address Save Contents Remarks
Save addr + 0 ~ 2 Year, Month, Day of read data Current time of device
Save addr + 3 ~ 5 Hour, Minute, Second of read data
Save addr + 6 Time Basis DWORD data
Save addr + 7 Pac [W] FLOAT data
Save addr + 8 Reserved WORD data
Save addr + 9 E-day [kWh] DWORD data
Save addr + 10 E-total [kWh]
Save addr + 11 Operating time [s]
Save addr + 12 Power ON [time]
Save addr + 13 ~ 16 Reserved WORD data
Save addr + 17 ~ 18 Serial number (2 DWORD values) DWORD data
Save addr + 19 Reserved WORD data
Save addr + 20 Mode and Error
Save addr + 21 Energy value [days]
Save addr + 22 Measuring data [cycle] DWORD data
Save addr + 23 Detective Device [low], Registered Device [high] WORD data
Save addr + 24 On line
Save addr + 25 FI-status
Save addr + 26 FI-code BYTE data
Save addr + 27 ~ 34 AIN 1 ~ 8 FLOAT data
Save addr + 35 ~ 42 Digital Input 1 ~ 8 (save to bit no.0) BYTE data
Save addr + 43 ~ 106 K1 ~ K64 WORD data
Save addr + 107 24V Power ON [low]
Save addr + 108 ~ 111 Reserved
Save addr + 112 Reserved BYTE data
<Table 3> Order and contents to save read value which is read by 11(data read) command of SBC+ device type, to communication memory

File name

ini file writing method

WorkDirectory\SCAN\CH_INFO%03d.ini

 

%03d is the setting data number between 1 and 255 in here

1) Write to first line of file as text.

2) Each factor is classified by ','(comma).

3) Write maximum 256 channel information.

4) B = Byte, W = Word, D = Double Word, F = Float, S = String data.

5) The number of behind of S is length of String.  Ex) S10  : 10 Strings

<Table 4> ini file writing method for saving read data(current value)
<Figure 2> Example of ini file writing for saving read data(current value)

Notice) Read value is saved to same address position of WORD/FLOAT/DWORD memory by Sunny Net communication driver, and save value is different according to memory type.

 

If you click the icon  in protocol option part of <Figure 1>, you can see the dialog box such as <Figure 3>. You can also set read schedule by using this part.

<Figure 3> Example of Sunny Net communication driver's dialog box

You can set read schedule by using , ,  button and listbox of <Figure 3>.

Also, you can set station number of computer(source), whether to use synchronization code for power line communication, whether to use SMA Net Frame, device type number, delay time for each packet when using multi packet, delay time after Time Sync, by using the part of Communication Option.

 

When you click Add button or Edit button in dialog box of <Figure 3>, dialog box of <Figure 4> is shown.

<Figure 4> Example of Sunny Net communication driver's read schedule Add/Edit dialog box

 

2. Writing settings

 

You can read current value for designated read contents by writing settings.

 

Digital Write

Digital write setting parameters are as follows:

1) Port             Connected communication port number. (Not COM number)

2) Station         The set Address(0 ~ 65535) in Sunny Boy device.

3) Address      Index number in channel(Channel = Analog/Digital/Counter/Status).

4) Extra1          Channel type number.

AIN : Analog Input Channel(Type number = 0101h),

DIN : Digital Input Channel(Type number = 0102h),

CIN : Count Input Channel(Type number = 0104h),

SIN : Status Input Channel(Type number = 0108h),

AOU : Analog Output Channel(Type number = 0201h),

DOU : Digital Output Channel(Type number = 0202h),

COU : Count Output Channel(Type number = 0204h),

SOU : Status Parameter Channel(Type number = 0208h),

APA : Analog Parameter Channel(Type number = 0101h),

DPA : Digital Parameter Channel(Type number = 0102h),

CPA : Count Parameter Channel(Type number = 0104h),

SPA : Status Parameter Channel(Type number = 0108h),

READ_CH : Save to WorkDirectory\SCAN\CH_SAVE%03d.ini file by reading channel information, %03d = Station number.

(It is saved as method, such as <Table 4> and <Figure 2>)

0 or character etc : Digital Input Channel(Type number = 0902h),

Etc Number : Channel type number value,

( Bit 0 = Analog, Bit 1 = Digital, Bit 2 = Counter, Bit 3 = Status, ¡¦ Bit 8 = Input, Bit 9 = Output, Bit 10 = Parameter, Bit 11 = Instant. Values ¡¦ )

5) Extra2          Output data format.

1 : DWORD data,

2 : BYTE data,

0, blank etc : WORD data.

Analog Write

Analog write setting parameters are as follows :

1) Port             Connected communication port number. (Not COM number)

2) Station         The set Address(0 ~ 65535) in Sunny Boy device.

3) Address      Index number in channel(Channel = Analog/Digital/Counter/Status).

4) Extra1          Channel type number.

                        AIN : Analog Input Channel(Type number = 0101h),

                        DIN : Digital Input Channel(Type number = 0102h),

                        CIN : Count Input Channel(Type number = 0104h),

                        SIN : Status Input Channel(Type number = 0108h),

                        AOU : Analog Output Channel(Type number = 0201h),

                        DOU : Digital Output Channel(Type number = 0202h),

                        COU : Count Output Channel(Type number = 0204h),

                        SOU : Status Parameter Channel(Type number = 0208h),

                        APA : Analog Parameter Channel(Type number = 0101h),

                        DPA : Digital Parameter Channel(Type number = 0102h),

                        CPA : Count Parameter Channel(Type number = 0104h),

                        SPA : Status Parameter Channel(Type number = 0108h),

                        READ_CH : Save to WorkDirectory\SCAN\CH_SAVE%03d.ini file by reading channel information, %03d = Station number.

(It is saved such as <Table 4> as <Figure 2>)

                        0 or character etc : Analog Input Channel(Type number = 0901h),

                        Etc number : Channel type number value,

( Bit 0 = Analog, Bit 1 = Digital, Bit 2 = Counter, Bit 3 = Status, ¡¦ Bit 8 = Input, Bit 9 = Output, Bit 10 = Parameter, Bit 11 = Instant. Values ¡¦ )

5) Extra2          Output data type.

                        1 : DWORD data,

                        2 : BYTE data,

                        0, Blank etc : WORD data.

 

Write example 1)

PORT : 0   STATION : 255   ADDRESS : 0002  EXTRA1 : AIN  EXTRA2 : Blank

The setting parameter shown above is example of writing contents of analog input channel no.2 Index for Sunny Net device connected no.0 port as set value.

 

3. Communication cable and power connection

Connect communication cable and basic power to Sunny Boy device, as follows.

 

RS-232C Communication cable connection

Connect general RS-232C communication cable(Cross) to RS-232C(COM2) terminal of <Figure 5>.

<Figure 6> is appearance of Sunny Boy device.

<Figure 5> Appearance of connecting communication cable and basic power etc to Sunny Boy
<Figure 6> Appearance of Sunny Boy device

Basic power connection

Basic power of sunny Boy enter 90 ~ 260VAC 50/60Hz to supported power socket.