LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read data from Hart Sensors

I have 14 sensors 4-20mA/HART and I want to show values in Labview.

At the moment I haven't any hardware/software in the middle. What you suggest to interface the sensors to Labview?

0 Kudos
Message 1 of 8
(5,213 Views)

Hi IDILIO,

 

I found a reference example for doing HART communication in LabVIEW (see Developer Zone: HART Communication Protocol Reference Example). It uses a RS232 to HART modem (although it looks like the suggested hardware only handles one sensor) then implements NI-VISA to handle the low-level calls. This is really only one way, there are probably a few other methods too.

 

Tim W.

Applications Engineering

National Instruments

http://www.ni.com/support 

0 Kudos
Message 2 of 8
(5,199 Views)

HI,

 

You can use the drivers for the HART protocol, or if you like you can go with some alternative middleware and use DSC module.

-------
Mark Ramsdale
-------
0 Kudos
Message 3 of 8
(5,191 Views)

Hi Tim W
I'm doing a similar application. I want to read measures of 4 level sensor.
My question is, It is possible to access no just to the process variables, but also to configuration, and diagnosis parameters? I mean, it possible send and receive all hart commands by Labview?
Thanks in advance
Please, if u have more information about Labview working with Hart, please send it me. Thanks again

0 Kudos
Message 4 of 8
(4,836 Views)

Hi Milepcco,

 

We now retail a HART module. You can download the associated driver before purchasing to evaluate if it includes the HART commands you need for your application. The driver can be found as "AM-9898 Hart Interface Toolkit" on VI Package Manager.

Andrew T.
"His job is to shed light, and not to master" - Robert Hunter
0 Kudos
Message 5 of 8
(4,828 Views)

I presume you're talking about HART over 4-20 ma (aka Bell 202). There are a few other flavors of HART that are much less common, HART over 485 and Wireless HART. 

 

The most common way to get the basic data from a device is 'Command 3 Read Dynamic Variables and Loop Current' This will return up to four parameters (with units!). Command 3 is a Universal Command and MUST be supported by all HART devices. There are two other types of commands, Common Practice which is type of device specific (ie, Temperature, Pressure, Control Valve, etc.) and Device Specific commands. 

 

Using the AM 9898 will support up to four devices by, I think, only polling Command 3 on each device. You would need four of them at $1500 each!!!, not cheap.  I was wrong, it will support 15 devices. But you do need a cRIO system to run it. For 14 devices I recommend the Moore Industries HCS which will convert up to 16 devices to Modbus. But it too is only using Command 3. Modbus is a much easier protocol to use so would be pretty straightforward to get running. 

 

HART is a proprietary protocol a so if you want to support commands other than 3 you will need to buy the HART specs as well as the documentation for each device you want to work with. None of these will be cheap. 

 

Additionally HART uses a multiple master system where more than one thing can request data on the same bus. This requires careful timing to make work correctly and will be impossible to do in native LabVIEW. You will have to use so called 'point-to-point' mode where only your LabVIEW code can be talking to equipment. You'll have to stop your code to do configuration with a Handheld communicator. I'm not sure if you care about this but it is a consideration. Burst mode won't work either with native code. If you want to be able to use multiple masters with LabVIEW I recommend Borst Automation's Hart Tools. It is a massive pain to use with DLL calls. 


One additional thought, HART needs to be able to manipulate the RTS line on the serial port with fairly precise timing. Some USB converters do this for you and are much easier to use with LabVIEW, I recommend Microflex's product. It works pretty well.

Please feel free to ask me questions. Sorry I can't give you my code.

—Ben
Prevent your computer from sleeping programmatically!
Use Power Requests
Download from GitHub

Message 6 of 8
(4,822 Views)

I've just looked into the AM 9898 a little more. I seems to be only using 'Command 1 Read Primary Variable' which only returns one thing for each device. 

 

In summary, unless you want to do 'on-the-fly' configuration I'd just buy the Moore Industries HCS. 

—Ben
Prevent your computer from sleeping programmatically!
Use Power Requests
Download from GitHub

Message 7 of 8
(4,806 Views)

I know of 3 ways to communicate with multiple HART devices and while Ben touches on all these above, I see a need to add some clarification. 

 

Multiple HART Devices and a single HART modem (RS-485 or whatever)

Although a single HART modem can communicate with up to 15 devices this capability has 2 conditions.

  1. The 4-20mA outputs of all the devices must be wired in parallel and connected to the HART modem.
  2. Each device must be assigned a unique non-zero slave address (1-15). 

The catch is that the moment you change a slave address to a non-zero value, the 4-20mA device output goes to a constant 4 mA rendering it incompatible with any device that uses the analog 4-20mA current signal.  You can still access the primary variable (and any others available) with HART commands but with this arrangement you must regard the devices as a purely digital entities.  It's very important to return the slave address of every device back to the default value of zero after you have finished working with it (unless the end user of the device is planning to use non-zero slave addresses).

 

Multiple HART devices with a single HART modem and generic multiplexer (mux)

An alternative is to use a generic multiplexer (an array of programmable switches or relays) with a single HART modem (connected across the load resistor) in one of 3 possible arrangements.  

  1. For units configured as 4 wire devices (2 for power in and 2 for signal output), the 4-20mA output signals of all devices can be wired in parallel with the generic multiplexer wired to apply power to only one device at a time.
  2. Units configured as 4 wire devices can also have the power for all devices wired in parallel and use the generic multiplexer to connect the output signals to the HART modem one device at a time.
  3. Units configured as 2-wire devices combine the power and signal to a single pair of wires. In this case the generic multiplexer can connect the 2-wire pair for each device to the power supply and the HART modem one unit at a time.

With a generic multiplexer, all devices can keep their default slave address of zero.

 

Multiple HART devices and a HART multiplexer (a multiplexer designed for HART devices)

The last alternative is to use a HART multiplexer that knows how to power and communicate with multiple devices simultaneously.  The NI AM-9898 (no longer in production) is the only HART multiplexer I know of with LabVIEW drivers.  Other HART multiplexers can be commanded from LabVIEW by sending commands over an RS-485 serial connection to the multiplexer. 

 

 

 

Message 8 of 8
(1,687 Views)