Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Read power meter in LabVIEW via RS-232/RS-485

Solved!
Go to solution

Hello!

 

I have a power meter , WM14-DIN advanced power analyzer. I want to display different values , Kwh,VA,Kvar etc, from the meter in graphs in labview. I have just a basic understanding of Modbus RTU and the connection with RS-232. But I don't know how to make it work with labview. To my meter I have connected a converter  Moxa TCC-100 ( see attachments) from RS-485 to RS-232, since my power meter only works with RS-485.

 

From the converter I have a RS-232 usb adapter( see attachment)  to COM3 on my PC .  

 

Maybe the easiest way would have been connecting this directly http://sine.ni.com/nips/cds/view/p/lang/sv/nid/12845 . But i havent bought it yet!

 

So now you know the connection setup, drivers for the usb adapter is installed and VISA drivers also. I haven't found any good examples explaining how you can do this with programming and sending adn reciving data.

 

I have googled around and found out that you should use VISA read/write blocks, and that there is a Modbus library you could use. I have installed the library but I don't know how to use them to communicate with my power meter.

 

I have a communication protocol to my power meter but I don't know how to use it.

 

I'm pretty  much stuck and really dont know where to begin. But from my understanding of modbus, these kind of things should be easy to do, so I'm guessing it isn't too hard to learn.

 

Is there anyone that could explain how these thing work or if there is something that I could read or see?

 

Best regards Maurlind

 

0 Kudos
Message 1 of 27
(6,349 Views)

Try simply using the configure serial port function and VISA read/write like in this example:

http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Error-Property-Node-arg-1-in-VISA-Configure-S...

0 Kudos
Message 2 of 27
(6,286 Views)

Hi SgtPeprLHCB!

 

I recently buoght a usb adapter to rs-485 ( see attachment)and will try it as soon as I recive it, and then try the example you linked. Since my last configuration did not work.

 

But this time I think it will, the only thing I see as a problem is to get the right information from the power meter.  I know a should use a VISA write function to send the adress that I want to acess but I don't know how to convert the "Modicon adress" in my power meter protocol to a ASCII adress.

 

Beacuse just using a simple VISA read/write example won't give me what I want unless I tell it to do so.

 

What is the best way to do this? Maybe I want more tabs of information that gives me "KWh" and "var" and so on, then I must write more adress at the same time.

 

In short, I don't know how to get the right adress code from my powermeters modbus protocol ( see attachment).

Best regards Maurlind!

 

0 Kudos
Message 3 of 27
(6,280 Views)

Maurlind,

 

I've never worked with Modbus before.  I've done some LabVIEW with serial using a serial-to-usb adapter and the functions I mentioned.  Using a serial-to-usb adapter creates a COM port on your PC and you use that as your "address" (VISA reference).  I would assume this is the same for your adapter.

 

Regards,

 

SgtPeprLHCB

0 Kudos
Message 4 of 27
(6,277 Views)

Maurlind,

 

Seems to me you'd use the COM port as the visa reference and you'd append the actual address of the device to the command

 

Regards,

 

SgtPeprLHCB

0 Kudos
Message 5 of 27
(6,275 Views)
A search for modbus should have led you to this - https://decibel.ni.com/content/docs/DOC-30140

You can do things with the regular VISA functions but why make it harder than it had to be?
Message 6 of 27
(6,271 Views)

Hi Maurlind,

 

I was wondering if you still needed help with the issue or if the above answers solve the problem?

 

Let me know!

 

Best regards,

 

Collin de Wit
National Instruments
Applications Engineering

0 Kudos
Message 7 of 27
(6,233 Views)

Hi CollindeWit!

 

I'm wating for my delivery of a usb rs-485 adapter, until then Idon't have any more question. If i get it to work with that adapter I will respond with my soulution or I will ask for help again!

 

Thanks for all the replys and links to examples!

 

Best regards Maurlind

0 Kudos
Message 8 of 27
(6,217 Views)

HI Collin

 

I have a kiethley 2401 source meter and have installed labview 2014 in my computer(Windows 8.1). I want to configure keithley 2401 with labview so that I can make a program for certain operations. I am using serial port RS232. I am new at using both labview and kiethley source meter. Looking for help.

 

Regards

 

Sunil

0 Kudos
Message 9 of 27
(6,150 Views)

@sunil75 wrote:

HI Collin

 

I have a kiethley 2401 source meter and have installed labview 2014 in my computer(Windows 8.1). I want to configure keithley 2401 with labview so that I can make a program for certain operations. I am using serial port RS232. I am new at using both labview and kiethley source meter. Looking for help.

 

Regards

 

Sunil


First download the drivers for your meter (this one should work).  There should be an example in the drivers of how to use them.  Start there.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 27
(6,146 Views)