LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using cRIO 9045 for MODBUS communication of DC DC Converter

Solved!
Go to solution

Hi, I have developed a PC based labVIEW GUI for a dc-dc converter through MODBUS over TCP/IP communication. Now, I want to implement the same using cRIO instead of PC and let the cRIO run standalone. The converter responds well with the VI run under MY computer without cRIO but doesn't respond when run under RT target using cRIO. I am using cRIO 9045 here. I have followed the following steps.

 

1. Created new project with blank template 

2. In the final step, I have added my VI (Converter_Final.vi and Decimal to String to Boolean.vi) to RT target as in the attached image.

 

Can anyone suggest what went wrong? How to add a vi to a RT target and run it for controlling the device using MODBUS over TCP/IP communication?

Download All
0 Kudos
Message 1 of 10
(4,034 Views)

Hi sravani,

 

are you sure your cRIO and that power supply are on the same IP subnet?

Your cRIO is set to an IP of 172.22.11.2, while the MODBus master is expected at IP 192.168.1.20…

 

Do you get any errors in your cRIO VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(4,023 Views)

Hi GerdW, 

 

Thanks for the reply. NI MAX and LabVIEW project show the same IP address 172.22.1..2. The converter has ethernet connection at the IP address 192.168.1.20. 

 

I didn't get any errors when the VI is run. cRIO gets connected and the VI runs without any hassle. But there is no response from the converter (since no communication is established??).

 

cRIO is connected to my laptop and is powered up by an external DC power supply. The converter is connected to cRIO via a LAN cable at their respective Ethernet ports.

 

-Sravani

 

0 Kudos
Message 3 of 10
(4,004 Views)

Hi sravani,

 

NI MAX and LabVIEW project show the same IP address 172.22.1..2. The converter has ethernet connection at the IP address 192.168.1.20.

So they are on different IP subnets: usually this leads to problems…

 

cRIO is connected to my laptop and is powered up by an external DC power supply.

So you use one Ethernet port to connect cRIO and PC.

 

The converter is connected to cRIO via a LAN cable at their respective Ethernet ports.

So the other port is used to connect your converter?

Which device is connected to which Ethernet port?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 10
(3,990 Views)

How do you control the execution speed of the vi? Please attach a picture or the vi.

And how do you send the data to the pc? It might also be useful to blink a led on the rio to check it is running.

0 Kudos
Message 5 of 10
(3,985 Views)

Hi GerdW,

 

Sorry for the late reply. I have changed the connections and IP addresses of cRIO and laptop. Attached screenshots of the same. The converter still doesn't respond to the VI.

 

Previous connections:

1.) 24V DC power supply to cRIO

2.) Ethernet port 0 to converter and USB cable from type C dual role on CRIO to laptop type B.

 

Connections changed to:

1.) 24V DC power supply to cRIO

2.) Ethernet port 0 to converter and Ethernet port 1 to laptop

 

Regards

Sravani

0 Kudos
Message 6 of 10
(3,941 Views)

What do you see when you do interactive execution? So when you run the converter_Final.vi which is on the CRio on your PC? Then you should be able to see some debug messages if you probe the error line.

0 Kudos
Message 7 of 10
(3,919 Views)

Hi LennartM,

 

Thanks for the reply. How to do interactive execution? Converter_Final.vi is dumped on cRIO and controlled using the GUI on PC. When it is run, it shows deployment successful and no errors are displayed. 

 

Reply to previous question: The VI executes the while loop for every 1 sec. Data is sent to PC and vice versa through MODBUS using LAN cable.

 

Regards

Sravani

0 Kudos
Message 8 of 10
(3,907 Views)

You should be able to open the front panel of the vi and run it. Probing is also possible. It does run a bit slower so you could get timing problems.

0 Kudos
Message 9 of 10
(3,894 Views)
Solution
Accepted by topic author sravani000

Solution:

 

1. Connect Ethernet port 1 on cRIO to PC ethernet port. 

2. Change adapter settings of PC to same subnet mask (here 169.254.22.30)

3. Make sure IP address of port 1 in NI MAX is same as that indicated next to RT target (here 169.254.22.29)

4. Connect RT target and deploy all

5. Connect Ethernet port 0 on cRIO to the converter

5. Change IP address of port 0 in NI MAX to the same subnet of converter (here 192.168.1.19)

6. Run the converter_final.vi

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x4LaCAI&l=en-US

Download All
0 Kudos
Message 10 of 10
(3,868 Views)