Jump to content

How do I use LabView to communicate via RS-485?


Recommended Posts

I am working on a project where I have to communicate with a SATEC PM171E series multimeter. I am using the RS-485 port on the multimeter. I have a NI PXI-8421 Series RS-485 Dual Port card installed on the computer I am using.

I do not know where to start. If anybody can make any suggestions I would greatly appreciate it.

Note: I have looked at the example serial vis that come with LabView but when I used them they were failing to read from the specified port.

Link to comment
  • 2 weeks later...
I am working on a project where I have to communicate with a SATEC PM171E series multimeter.  I am using the RS-485 port on the multimeter.  I have a NI PXI-8421 Series RS-485 Dual Port card installed on the computer I am using.

I do not know where to start.  If anybody can make any suggestions I would greatly appreciate it. 

Note:  I have looked at the example serial vis that come with LabView but when I used them they were failing to read from the specified port.

1082[/snapback]

Hi dnvalen,

I assume you have used the standard RS-232 serial VIs provided with LV. As you may know, those are designed for a single-ended or point-to-point serial communications. For example, COM1 to ONLY one device (mouse, keyboard, so on). The provided VIs assumes both sides of the line have been set to the same parameters - (e.g. 9600-N-8-1).

But you are using a different serial communication standard - RS-485. Signaling and topology is completely different. For one, RS-485's signaling is called 'Balanced data transmission', or 'Differential voltage transmission'. Compared to RS-232, an RS-485 data line (Tx & Rx) requires two (2) wires or a twisted pair (similar to CAT5's twisted pairs). Each of the wire in the pair can carry 0 or +5 VDC. Data transitions (high or low) are derived from the difference between the voltages in the two wires - hence, differential signaling. An active transition is when the one wire is 0 V and the other 5 V. If both are 0V or 5V, there is no difference and the data is considered inactive. Actually, the receiver threshold to determine the logice is >=200mV. This is to prevent line noise from corrupting the signal integrity. Determining which is logic zero or logic one is the job of the protocol and the application.

In an RS-232 the signaling format is of 'marks' and 'spaces'. There is only one Tx wire and one Rx wire referenced to a common ground line. Marks (or binary one) are indicated when the Tx or Rx line is a positive voltage (normally +5 to +15 V), and a Space (or binary zero) when either line is negative (-5 to -15 V) compared to the common reference line.

Anyway, one more thing about RS-485, it is designed to be a multi-point serial standard. This means to communicate to a certain device on a 'networked' serial devices, certain topology has to be used. The simplest of which is a 'master & slave' topology (like yours). Make sure your PC controller is the master and the multimeter the slave.

There is only one VI in the examples: NI RS-485 Transceiver Control to get you started.

Enjoy!

winmac96

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.