LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deterministic timed loops in real time CompactRIO PID

Hi,

I'm trying to write a PID control system using a compactrio.  I'm fairly new to labview and don't really understand how to use timed loops correctly so that both a deterministic and nondeterministic loop and execute at the same time.  I've gotten my program to work, but then when I add a sub vi that I've writte as an alarm system, I get the message "Failed to connect to real-time target" when I run the program.  I thought I could fix this by making the periods of the loops bigger, but this isn't working. I've attached the main VI I've written. Any advice on how to better time this realt-time program would be greatly appreciated.

0 Kudos
Message 1 of 2
(3,029 Views)

Hello,

 

It appears from the information you presented, there are a couple of different issues that need to be addressed; each independent of each other. Below is an article that discusses creation of timed loops in LabVIEW Real-Time as well as a tutorial for the LVRT module:

 

Creating Deterministic Applications Using the Timed Loop (RT Module)

http://zone.ni.com/reference/en-XX/help/370622H-01/lvrtconcepts/deterministic_apps_timed_loop/

 

LabVIEW Real-Time Module Training

http://zone.ni.com/devzone/cda/tut/p/id/9988#toc0

 

The 'failed to connect to real-time target' error you reported is a target connection/communication issue, again not necessarily related to your RT programming. A few questions to help you troubleshoot the connection of your host to your Real -Time target, the cRIO:

 

-what version of the LabVIEW Real-Time module are you using?

-what O/S is your host (PC) operating on?

-what are the IP addresses for your host (PC) and target (cRIO)? Are they on the same subnet?

-can you ping your cRIO  and receive a response?

-can you see your cRIO in Measurement & Automation Explorer (MAX) listed under the 'Remote Systems'  as being in the 'connected' state?

-what version of the NI-RIO driver to you have installed on the host and cRIO? ( driver version can be located under 'Software' section in MAX)

 

You will also want to ensure you have properly added the cRIO to the project. Below are instructions on how to do this as well:

 

How to Add a Real-Time Target to a LabVIEW Project

https://decibel.ni.com/content/docs/DOC-16189

 

Best,

Patricia B.

 

 

National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(3,006 Views)