i have used gurux libraries and developed c# app.Now i am working on c++, i have downloaded "Gurux.DLMS.cpp-master" but i m not able to start it anyway. In visual studio its not starting giving the error
Error LNK1104 cannot open file 'Debug\GuruxDLMS.lib'
I m using codeblock ide to build c++ version.
Please guide me how can i develop in c++. I want to use GXDLMSreader type file that i use in c#.
Gurux client example reads all the data from the meter. If you are running this from the VS, find ShowHelp method. It'll show all command-line arguments.
I have provided the arguments but its showing authentication failure. And still I didn't get the idea of downloading instant profile from this code. Plz provide an example.
Can i include dlms c++ library in my new c++ project in visual studio?
Remove [] around your password.
answer: its done and reading.
You need to create a profile generic object and then read capture objects and buffer.
Answer: Sir as c++ is new to me plz provide an example code to download instant profile.
Started a new c++ project in visual studio and included all the files in that project.
After building the project these type of errors are coming. Any suggestions??
I want to start new c++ project and include c++ library to download meter. Plz help
Added linker dependencies and those errors are gone.Thank You sir
Now the below line is creating error.I have copied the same code which was in dlmsclient example.
char* serialPort = "COM1";
Error (active) E0144 a value of type "const char *" cannot be used to initialize an entity of type "char *"
Error C2440 'initializing': cannot convert from 'const char [5]' to 'char *'
Hello sir,
Now i m getting the initialization correctly.
Reading meter data with below code.
CGXDLMSProfileGeneric *obj = new CGXDLMSProfileGeneric("1.0.94.91.0.255");//Instant
obj->SetAccess(2, DLMS_ACCESS_MODE_READ);
ret = comm.Read(obj, 2,value);
I m getting ret =0 i.e success.
All methods are returning integer value.
But i need to save the data so how can i get the data or the buffer which i am reading.
if i m reading second attribute then where can i get the resulted parameters so that i can save and show them.
Thank You
After you have read the value you can see the value in the object attribute.
You can use ToString-method to get all object's values as a string.
If you read attribute #2, you can get value from the Buffer property.
Thanks sir for your support.
I want to ask that this c++ application build exe in visual studio can work in Common Meter Reading instrument (CMRI) devices or not .
Because in CMRI only C or C++ exe works.
There are several different CMRI from different manufacturers. Some CMRI's are running in Linux. You need to compile an app for Linux and you should be able to run it in CMRI. You need to verify this from the manufacturer of CMRI.
Don't know about Linux but when I develop c++ exe on windows XP it works fine in CMRI.
Therefore I think this gurux c++ exe developed in visual studio should also work in it.
What's your opinion??
I can't say for sure because I don't know what CMRI you are using but if it's working in Windows it should work in CMRI. The only thing you need to change is how to send and receive the bytes.
Hi,
Hi,
Open GuruxDLMSClientExample it will do exactly the same as C# example.
You need to build the development folder first.
BR,
Mikko
Successfully build it in VS
Successfully build it in VS but when i run it this error shows(check image).
I have windows10 64 bit computer.
Hi,
Hi,
You have set the wrong path. You are running Win32 and set a path to Win64 version. Change that.
BR,
Mikko
I dont understand sir,
I dont understand sir,
Its giving error when i am using win 32 in visual studio. Check below image.
Hi,
Hi,
I believe that you try to start Gurux.DLMS.library. You need to open GuruxDLMSClientExample and start that.
After starting
After starting GuruxDLMSClientExample how can i read Instant etc. Where i have to provide the options to start communication??
Hi,
Hi,
Gurux client example reads all the data from the meter. If you are running this from the VS, find ShowHelp method. It'll show all command-line arguments.
BR,
Mikko
I have provided the arguments
I have provided the arguments but its showing authentication failure. And still I didn't get the idea of downloading instant profile from this code. Plz provide an example.
Can i include dlms c++ library in my new c++ project in visual studio?
Hi,
Hi,
Remove [] around your password.
You need to create a profile generic object and then read capture objects and buffer.
BR,
Mikko
Remove [] around your
Remove [] around your password.
answer: its done and reading.
You need to create a profile generic object and then read capture objects and buffer.
Answer: Sir as c++ is new to me plz provide an example code to download instant profile.
Hi,
Hi,
Something like this:
CGXDLMSProfileGeneric pg("LOGICAL NAME");
Read(&it, 3, str);
Read(&it, 2, str);
Check also ReadRowsByRange and ReadRowsByEntry.
BR,
Mikko
Started a new c++ project in
Started a new c++ project in visual studio and included all the files in that project.
After building the project these type of errors are coming. Any suggestions??
I want to start new c++ project and include c++ library to download meter. Plz help
Hi,
Hi,
Please, don't add pics like this. They are compressed and I can't see the error code.
You haven't added linker dependencies. Add those:
Debug\GuruxDLMS.lib
Ws2_32.lib
BR,
Mikko
Added linker dependencies and
Added linker dependencies and those errors are gone.Thank You sir
Now the below line is creating error.I have copied the same code which was in dlmsclient example.
char* serialPort = "COM1";
Error (active) E0144 a value of type "const char *" cannot be used to initialize an entity of type "char *"
Error C2440 'initializing': cannot convert from 'const char [5]' to 'char *'
Hi,
Hi,
Change to this:
const char* serialPort = "COM1";
BR,
Mikko
Hello sir,
Hello sir,
Now i m getting the initialization correctly.
Reading meter data with below code.
CGXDLMSProfileGeneric *obj = new CGXDLMSProfileGeneric("1.0.94.91.0.255");//Instant
obj->SetAccess(2, DLMS_ACCESS_MODE_READ);
ret = comm.Read(obj, 2,value);
I m getting ret =0 i.e success.
All methods are returning integer value.
But i need to save the data so how can i get the data or the buffer which i am reading.
if i m reading second attribute then where can i get the resulted parameters so that i can save and show them.
Thank You
Hi,
Hi,
After you have read the value you can see the value in the object attribute.
You can use ToString-method to get all object's values as a string.
If you read attribute #2, you can get value from the Buffer property.
www.gurux.fi/Gurux.DLMS.Objects.GXDLMSProfileGeneric
BR,
Mikko
Hi sir,
Hi sir,
Tried many things but still cant get the value exactly.Can u please show an example.
I m doing obj->GetBuffer() but still no success.
Thank you
Hi,
Hi,
Try to read Profile entries #8 and entries in use #7. When read capture objects and the buffer.
Profile entries
CGXDLMSProfileGeneric obj("1.0.94.91.0.255");//Instant
ret = comm.Read(&obj, 7,value);
ret = comm.Read(&obj, 8,value);
You should see correct values now. Read capture objects and the buffer.
ret = comm.Read(&obj, 2,value);
ret = comm.Read(&obj, 3,value);
Thanks sir for your support.
Thanks sir for your support.
I want to ask that this c++ application build exe in visual studio can work in Common Meter Reading instrument (CMRI) devices or not .
Because in CMRI only C or C++ exe works.
Hi,
Hi,
There are several different CMRI from different manufacturers. Some CMRI's are running in Linux. You need to compile an app for Linux and you should be able to run it in CMRI. You need to verify this from the manufacturer of CMRI.
BR,
Mikko
Don't know about Linux but
Don't know about Linux but when I develop c++ exe on windows XP it works fine in CMRI.
Therefore I think this gurux c++ exe developed in visual studio should also work in it.
What's your opinion??
Hi,
Hi,
I can't say for sure because I don't know what CMRI you are using but if it's working in Windows it should work in CMRI. The only thing you need to change is how to send and receive the bytes.
BR,
Mikko