Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Reading data from USB port

Status
Not open for further replies.

sharikbaig

Member level 1
Joined
Aug 24, 2013
Messages
41
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Activity points
1,613
This is a bit complicated and strictly application oriented question.
I want to take a RS485 communicable energy meter's reading into a windows application. I have connected the 'Schneider Electric- Conzerv EM6436' meter to 'MOXA Transio A52' RS485 to RS232 converter and then RS232 to USB converter connects it to USB port of my computer.
Just to simplify:
Energy Meter (RS485) ---> RS485 to RS232 converter ---> RS232 to USB converter ---> Windows PC
By doing this I successfully got the data in ModScan Software from WinTech. Now i dont want to use modscan but i want my own windows application to show the readings from Energy Meter.
How can i achieve that, how can i read the same data in Visual Studio 2012. I am new with Visual Studio, so a detailed answer would be appreciated. The meter uses MODBUS RTU protocol. I got the data into PC as i said. Now i just want it in Visual Studio. You have to enter some memory address in modscan to get particular reading. For example address 3915 gives Frequency. These memory addresses are specified in data manual of energy meter.

Energy Meter manual attached below.
ModScan Download Link - https://www.win-tech.com/html/demos.htm
 

Attachments

  • NHA12537-01.pdf
    3.8 MB · Views: 114

you must read the serial port data . the port no (COM xx) is fixed by the system when you connect the usb2serial interface.

so , write the code for reading and writing the com port no.

you can use the windows api for doing this.
 
Thanks for replying. Are there any sample codes to help me with programming?
 

In fact, I have been working on similar requirement to get meter data to windows application. But was struggling to get successful connection.

We tried with modscan as well.But no luck..I followed EM6438 manual that you attached in the post.

May i know what settings you configured in modscan.Great help if you send your c# code.
 

Subbav,

In MODSCAN, suppose you want to read Power from the Meter,

Set address as 3901
Device ID - 1
Length - 2
MODBUS point type - 03-Holding Register

Now Click connection > connect, to see the connection detail window. In that window,
Direct connection to (The port at which you've connected your meter, COM9 in my case).
Baud Rate - 19200
Word Length - 8
Parity - EVEN
Manual Hardware Flow Control with 0 delay for DSR & CTS.

Now click on Protocol Selection, set Transmission Mode as RTU and Slave Response Timeout as 1200ms.
Click on OK and you must be able to see Power Total there. If not, set it to read as float from toolbar and you're done!

For reading other parameters such as voltage, frequency etc, see the attached manual for addresses. As far as i remember, its 3927 for Volage at V1, and 3915 for frequency.

Hope this helped. I am unable to get it into c due to lack of knowledge on that subject. Will upload the c code if done at any time. Request you to share if you got any further success.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top