Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Communication between PC & RT app over RS 232 port on cRIO 9064/66

Solved!
Go to solution

Problem Summary:

The RT application is running in cRIO already but we need to publish all the measurements in application over MODBUS protocol. I created MODBUS mapping by using Labview DSC module.

In cRIO side, I did everything regarding tutorials and instructions but I cannot read the register 0001 at MODBUS Master at laptop side. I only suspicious about the adapters I used while converting RS 232 port - RS 458 – USB. You can find the schematic of convertings. If you have a feasible converter or adapter suggestion for my application or do you have any another solution please let me know, I will be so appreciated.

 

Hardware:

  • Crio 9066
  • Null Modem, ( not straight) serial cable
  • USB to RS485/422 Converter
  • Regular RS 232-USB converter (My laptop doesnt have RS 232 ports)
  • Laptop

 

Software

  • Labview 17 Professional
  • Labview 17 DSC Module
  • Labview 17 RT Module

Picture1.jpg 

0 Kudos
Message 1 of 7
(3,840 Views)

Hi,

Suggested and build many of those connections. Normally most of the 232-485 converters and USB-232 will work.

These are the problems that can across my path in the last years:

 

232-485. Not all manufacturers believe that A=+ and B=- Also sometimes you have to swap A and B at one side.

485 is a balanced line and + goes to + and - to - But there are some that think differently.

Another thing is the 0V Connection and terminators. I think in your situation the connection is short. So it should work Ok without terminators. To be sure I would suggest to add the terminator resistors. 

If the 232-485 converter and the 485 host have the same power source you leave out the 0V connection. If there is any galvanic isolation the power sources are not the same and a 0V connection maybe necessary.

 

232-USB: With the devices from FTDI I never had any problems. 

 

ModBus: Is it possible to use the MB LoopBack command ? 

You say address 0001. In DCS terms it is reading 40001. This is translated in ModBus function code 3 and address 0.

With DCS connection the address offset is always a problem.

 

Hope this helps.

 

Kees

 

 

 

0 Kudos
Message 2 of 7
(3,819 Views)

Hi KC,

Thank you for the detailed explanation.

I am actually using Modbus library that comes with DCS module. ( Not IO Server) In this library, I tried to use Modbus RTU slave and master VIs. But I cannot find any functional example or any explanation about MODBUS RTU. 

Loopback for Modbus and Serial is working for both PC and cRIO.  

 

What I ask is adapter combinations that I should use. As you know I need to use a null modem and RS 232 to RS 485 converter combination. When I look at the pins of converters with a null modem, things are getting complicated. 

 

During that time, I tried to use Modbus TCP/IP and it worked perfectly. But I am still worried if this Modbus TCP IP is not suitable for this project.

0 Kudos
Message 3 of 7
(3,803 Views)

Which converters are you using ?

 

Why not use ModBus TCP ?

 

0 Kudos
Message 4 of 7
(3,796 Views)

I use Hexin RS 232 to RS 485 converter. You can find the datasheet here

But the combination is like that ;

 

(cRIO RS 232) > (RS 232 to RS 485 Converter) > (RS 232 Null modem cable) > (RS 232 to USB Converter) > (PC)

Also, I tried that one;

(cRIO RS 232) > (RS 232 Null modem cable)> (RS 232 to RS 485 Converter) > (RS 232 to USB Converter) > (PC)

 

I need to use RS RTU mode because I need to communicate with another industrial controller over Modbus RTU.

I added the schematic of my application;

 

Untitled.png

 Additionally, I added the trial application that contains Modbus RTU slave on RT, RTU Master on PC. This application is working like a charm with TCP/IP but I couldn't make it work for RTU.

Thank you for helping.

 

0 Kudos
Message 5 of 7
(3,791 Views)

I saw these converters before. With the name Hexin and others. 

The problem with these converters is the power. Are pin 4 and 7 connected to a RS-232 signal that is active + or - 5V or more ?

0 Kudos
Message 6 of 7
(3,787 Views)
Solution
Accepted by topic author TOLGAHAN_NI

Hi, 

Sorry responding late, I changed my cables and did these configuration:

 

(RS 232 Port of cRIO 9064) => (Null Modem Cable) => ( RS 232 TO USB Converter) => (USB Port of Laptop)

 

This configuration work great for me .

Thank you for help.

0 Kudos
Message 7 of 7
(3,550 Views)