I am new here, started working on arduino IDE with stm32l082 as client and sprint 350 meter as server.
The code is working fine and meter is responding accordingly.
I wanted to read the L1voltage and used below code
gxRegister v1;
void setup() {
bb_init(&frameData);
//Set frame size.
bb_capacity(&frameData, 128);
cl_init(&meterSettings, 1, 32, 1, DLMS_AUTHENTICATION_LOW, "ABCD0001", DLMS_INTERFACE_TYPE_HDLC);
cosem_init(BASE(v1), DLMS_OBJECT_TYPE_REGISTER, "1.0.32.7.0.255");
// start serial port at 9600 bps:
Serial.begin(9600);
while (!Serial) {
}
}
void loop() {
int ret;
//Initialize connection.
ret = com_initializeConnection();
if (ret != DLMS_ERROR_CODE_OK)
{
return;
}
ret = com_read(BASE(v1), 2);
if (ret != DLMS_ERROR_CODE_OK)
{
Serial.println("error2");
return;
}
com_close();
}
It is clear that the result value is obtained and "seems" correct.
Inorder to be sure about the value obtained i require the scalar value too. How to obtain that too..
Thanks. Regards
Hi,
Hi,
You need to read attribute #3 to get scaler and unit before you read the value.
http://gurux.fi/Gurux.DLMS.Objects.GXDLMSRegister
BR,
Mikko
Yah it works thank.
Yah it works thank.