Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: RE: MSP430i2040 Sub Metering EVM not reporting energy consumption data

$
0
0
The whole point of evaluating the MSP430i2040 EVM is to measure the energy consumption of the load. I am interested in retrieving the energy value being acculumlated on the MSP430I2040 every 4 ac cycles (80 milli-seconds). I would like to get this value whenever I send a DL/T645 command to the MSP430I2040 . Do I have to add the code (on the MSP430I2040 ) to do this ? The DL/T645 command "GET_CONSUMPTION_PHASE_1" should be able to retrieve the energy value. If you look at this function "send_consumption_report()" in emeter-dlt645.c, it is returning the accumulated energy values to the host. static void send_consumption_report(int port, serial_msg_t *rx_msg, int rx_len, int phx) { serial_msg_buf_t *tx; uint8_t *tx8; uint16_t *tx16; tx = &ports[port].tx_msg; tx8 = &tx->buf->uint8[DLT645_PREAMBLE_BYTES + DLT645_MESSAGE_HEADER_BYTES]; tx16 = (uint16_t *) &tx->buf->uint8[DLT645_PREAMBLE_BYTES + DLT645_MESSAGE_HEADER_BYTES]; tx8[0] = rx_msg->uint8[DLT645_MESSAGE_HEADER_BYTES]; tx8[1] = rx_msg->uint8[DLT645_MESSAGE_HEADER_BYTES + 1] | 0x80; *((uint64_t *) &tx16[1]) = active_energy(phx, ENERGY_DIRECTION_IMPORT); *((uint64_t *) &tx16[5]) = active_energy(phx, ENERGY_DIRECTION_EXPORT); *((uint64_t *) &tx16[9]) = reactive_energy(phx, ENERGY_QUADRANT_I); *((uint64_t *) &tx16[13]) = reactive_energy(phx, ENERGY_QUADRANT_II); *((uint64_t *) &tx16[17]) = reactive_energy(phx, ENERGY_QUADRANT_III); *((uint64_t *) &tx16[21]) = reactive_energy(phx, ENERGY_QUADRANT_IV); *((uint64_t *) &tx16[25]) = apparent_energy(phx, ENERGY_DIRECTION_IMPORT); *((uint64_t *) &tx16[29]) = apparent_energy(phx, ENERGY_DIRECTION_EXPORT); prepare_tx_message(port, 66); }

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>