Difference between revisions of "Energy Module Commands"

From OpenMotics
Jump to navigation Jump to search
Line 197: Line 197:
 
** none
 
** none
  
value between 10 and ...  (first 10 pages are bootloader)
+
value between 11 and ...  (first 10 pages are bootloader)
  
 
one page is 4096 bytes so if you delete 1 page you have to do some BWC's to fill it up
 
one page is 4096 bytes so if you delete 1 page you have to do some BWC's to fill it up

Revision as of 19:25, 20 February 2016

General

GST : GeneralStatus

Gives back the general status of the module.

  • Input
    • none
  • Output
    • status: 1xBYTE status
      • todo explain the status values.

TON : TimeOn

Gives back the time in seconds the module is running.

  • Input
    • none
  • Output
    • time : 1xUINT32 time running [s]


FIV : FirmwareIDVersion

Gives back the firmware ID and version.

  • Input
    • none
  • Output
    • ID and version: 16 chars (ex. "OMFPC_0_1_1")

Power

FST : FeedStatus

Gives back the status of each currentFeeds in the energymodule. Normally the status will always be the same per 2 feeds because the status is the one per chip which is per 2 feeds.

  • Input
    • none
  • Output
    • feedstatus : 12xUINT32
      • The bits in each UINT32 are described in the manual of CS5480 with keyword STATUS0

FCO : FeedCounter

Gives back the number of currentFeeds in the energymodule. this should be fixed to 12.

  • Input
    • none
  • Output
    • feedcount : UINT16 number of feeds [#]

VOL : Voltage

Gives back the voltages that the energymodule measure.

  • Input
    • none
  • Output
    • Voltage : 3xFLOAT [V]

FRE : Frequency

Gives back the frequencies that the energymodule measure for the different voltage channels.

  • Input
    • none
  • Output
    • Freqency : 3xFLOAT [Hz]

CUR : Current

Gives back the current that the energymodule measure.

  • Input
    • none
  • Output
    • Current : 12xFLOAT [A]

POW : Power

Gives back the real power that the energymodule measure.

  • Input
    • none
  • Output
    • Power : 12xFLOAT [W]

ENE : Energy

Gives back the energy that the energymodule calculate.

  • Input
    • none
  • Output
    • Energy : 12xUINT32 [kWh]

or set the energy to a specific value

  • Input
    • Fixed value : 1 BYTE set to 0xAA
    • EnergySetValue : 12xUINT32 [kWh] set to 48x 0x00 if you want to reset all the energies
  • Output
    • none

EDA : EnergyDay

Gives back the energy that the energymodule calculate when the module is set to day mode (see [SDN : SetDayNight]).

  • Input
    • none
  • Output
    • EnergyDay : 12xUINT32 [kWh]

or set the energy to a specific value

  • Input
    • Fixed value : 1 BYTE set to 0xAA
    • EnergySetValue : 12xUINT32 [kWh] set to 48x 0x00 if you want to reset all the energies
  • Output
    • none

ENI : EnergyNight

Gives back the energy that the energymodule calculate when the module is set to night mode (see [SDN : SetDayNight]).

  • Input
    • none
  • Output
    • EnergyNight : 12xUINT32 [kWh]

or set the energy to a specific value

  • Input
    • Fixed value : 1 BYTE set to 0xAA
    • EnergySetValue : 12xUINT32 [kWh] set to 48x 0x00 if you want to reset all the energies
  • Output
    • none

SDN : SetDayNight

Set the EnergyModule in day or nightmode. This is used if different rates are used for day and night. This value can be set per feed.

  • Input
    • DayNight : 12xBYTE [night:0,day:1]
  • Output
    • none

OSC : Oscilloscope

Calibration

SVO : SetVoltage

parameter = 1x4 bytes type float in [V] There are 3 voltage channels that can be calibrated. The parameter should be the voltage connected to one or more of the voltage channels. Only the channels that have a voltage above 10V (before calibration) will be calibrated. This way you can calibrate every channel separately or in one shot. If the calibrated value deviate more than factor 2 (in both directions), the value will also be 'floored'. [edit] Calibration of the voltage

SCU : SetCurrent

parameter = 1x4 bytes type float in [A] There are 12 current channels that can be calibrated. The parameter should be the current connected to one or more of the current channels. <<-- what with different current-sensors? should be calibrated with 1 current sensor and an extra parameter should be used to have an extra factor to use in the calculation. Only the channels that have a current above 0.1A (before calibration) will be calibrated. This way you can calibrate every channel separately or in one shot. If the calibrated value deviate more than factor 2 (in both directions), the value will also be 'floored'.

SOS : SetOffset

Addressing

AGT : AddressmodeGoTo

WAA : WantAnAddress

SAD : SetAddress

Bootloader

BGT : BootloaderGoTo

Go to bootloader

  • Input
    • none
  • Output
    • none

BEC : Bootloader Erase Code

  • Input
    • page address : 1xUINT16
  • Output
    • none

value between 11 and ... (first 10 pages are bootloader)

one page is 4096 bytes so if you delete 1 page you have to do some BWC's to fill it up

BWC : Bootloader Write Code

Before doing a write make sure that an erase is done with BEC

  • Input
    • start address : 1 UINT32
    • Code : 32xUINT32 with data
  • Output
    • none

BJA : Bootloader Jump Application

Go back to app if code is valid (checksum is ok) ACK if jump to app will be preformed, REPLY_NAK_INTERNAL if not ok

  • Input
    • none
  • Output
    • none

Special

EEP : EEPROMdata

Error codes

  • REPLY_ACK = 0
  • REPLY_NAK_INTERNAL = 1
  • REPLY_NAK_FUNCTION_NOT_KNOWN = 2
  • REPLY_NAK_INDEX_NOT_OK = 3
  • REPLY_OUT_OF_BOUNCE = 4
  • REPLY_NAK_NO_SET = 5
  • REPLY_NAK_NO_GET = 6
  • REPLY_NO_REPLY = 7