Once you have configured your system, you are ready to develop your application. As mentioned in the tutorial overview, there are three main differences between remotely developing an application for Windows as compared to real-time CompactRIO targets:
- Managing Targets in the LabVIEW Project Explorer
- Debugging Your Windows and FPGA VIs
- Executing Your VIs on the CompactRIO
Managing Targets in the LabVIEW Project Explorer
As you can see in the image below, in contrast to the Project Explorer for a real-time CompactRIO, when developing for the Windows-based CompactRIO the host and FPGA applications will be located under different targets. In the LabVIEW project you develop a remote Windows application first on your development computer target for initial functional debugging and then deploy it later in the development to the remote target for final debugging and verification. This development practice extends to Windows-based CompactRIO targets. By developing and executing the Windows portion of your CompactRIO application on your development machine, you have access to all the standard LabVIEW Debugging Tools and the LabVIEW Profile Performance and Memory Window.
In contrast to Real-Time based CompactRIO, for Windows-based CompactRIO you develop your Windows host application under My Computer and develop your FPGA VI under a separate Windows CompactRIO Target .
However, targeting My Computer for your Windows VI does not inherently provide access your CompactRIO I/O and peripherals. To add access to your FPGA target and C Series I/O modules, you need to add the CompactRIO as a Networked Computer/Device. To add the FPGA target to your LabVIEW project, follow these steps:
- Right-click on the project title and select New»Targets and Devices...
- In the dialog box that appears select the New target or device radio button
- Select Windows CompactRIO»cRIO-9081/cRIO-9082 and click OK
To remotely develop, debug, and deploy to the FPGA target on the WES-based CompactRIO you need to add a Windows CompactRIO to your LabVIEW project.
- Back in the Project Explorer window, right-click on the Windows CompactRIO you just added and select Properties.
- In the properties dialog set the IP address to that of your Windows based CompactRIO and select OK. To look up the IP address of your CompactRIO, attach a monitor, mouse, and keyboard to the target and follow the steps outlined in the How to determine the TCP/IP address Microsoft support document.
- Right-click on the Chassis underneath your Windows CompactRIO Target and select New»FPGA Target.
Note: If the FPGA target does not appear, reference the Enabling RIO Server for Remote FPGA Development section of the document and verify that you have completed the steps.
- Allow LabVIEW to scan the I/O modules in your chassis to populate them in your project under the FPGA target.
Now you can access the FPGA target through the Host Interface Palette API from your Windows-based VI.
To communicate between the host and the FPGA VI you use the same FPGA Open VI Reference you normally would use for other RIO applications, except the FPGA VI is under the CompactRIO project target.
Debugging Your Windows and FPGA VIs
For your Windows VI, prior to deployment to the target, you have access to all the standard LabVIEW Debugging Tools and the LabVIEW Profile Performance and Memory Window. If you want to use the debugging tools while the application is executing on the CompactRIO, you can enable debugging when building the application. It should be noted that remote debugging only works when there is a network connection between the CompactRIO and your development machine as described in the Initial Configuration section of this document. For more information, please see Debugging Applications and Shared Libraries.
The development, debugging and deployment process for the LabVIEW FPGA VI in your Windows based CompactRIO project is identical to that for other CompactRIO targets. You can develop using the simulation tools to functionally verify your design, and debug your VI. To deploy your FPGA click the Run button or create an FPGA Build Specification to start an FPGA compilation. Once the compilation is complete the bitfile will be deployed to the FPGA on the CompactRIO across the network. In addition, once deployed the FPGA interactive front panel will update with values.
Reference the Testing and Debugging LabVIEW FPGA Code tutorial for more information on general best practices for LabVIEW FPGA development.
Executing Your VIs on the CompactRIO
To execute your VI on the target, drag the VI file in your project from My Computer to beneath your Windows CompactRIO Target, as shown below.
Then press the Run Arrow on your VI. You can view the front panel of a VI running on the WES 7 target if you connect a monitor to the target. The front panel on the target monitor mirrors the front panel on the host computer. For more information on connecting to your target from your host computer and controlling the Front Panel, read Running VIs on Windows Embedded Standard Targets. This process assumes you're connected to your target over Ethernet.