Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

customize FPGA channels name with ini

I am planning to use the cRIO, and I would have a relay card with 4 channels.  For the application, only the first 2 relays at channel 1 and 2 of the relay module are used.  If the relays at channel 1 and 2 go bad, I want to be able to switch to channel 3 and 4 and modify the setting in a ini file without having to change my code.  Is that easy to do?  I know how to do that in a compact DAQ, but not sure how to do that with FPGA.  Thanks!

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 6
(5,955 Views)

Hey Jyang, 

 

Its not going to be the same process as you went through on a cDAQ. There is no INI file to determine what channels your FPGA uses. 

 

Although you could certainly program the functionality you're looking for using LabVIEW Real-Time/ FPGA. The Real-Time controller can read a INI file you create for it, and decide which input to write to on the FPGA. (Your architecture will change slightly between using the FPGA in scan interface or LabVIEW FPGA.)

 

You could also program the controller/FPGA to recognize that the relay on channel 1 or 2 has gone bad and automatically switch. (this would likely require additional feedback to the system such as AI channel)

 

Does that answer your question? 

 

Applications Engineer
National Instruments
CLD Certified
0 Kudos
Message 2 of 6
(5,935 Views)

so how do I do that?  How do I do that with only FPGA?  And how do I do that with real time?

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 6
(5,931 Views)

To use the FPGA on the cRIO you will have to use the Real-Time controller, unless you're referring to an Ethernet RIO such as the 9148. 

 

It may be possible, but highly impractical to read a file on an FPGA, due to the resources required to do so. You'll want to read the file in the Real-Time(RT) code, and communicate those values to the FGPA through I/O methods (LabVIEW FPGA) or by switching to a different set of I/O variables if you're using the scan interface.

 

On the FPGA you can compile the code to determine which relay to use depending on the input received from the RT controller. 

 

If you did use additional feedback such as an analog in card, you could program the FPGA to determine which relay to used based on that feedback.   

Applications Engineer
National Instruments
CLD Certified
0 Kudos
Message 4 of 6
(5,928 Views)

You are giving me some good ideas, but I have no idea how to impletement them at all.

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 5 of 6
(5,926 Views)

File I/O on a Real-Time target is going to be essentially the same as in regular LabVIEW (there are some good examples in the example finder), just be aware that File I/O is non-deterministic and should not be done in a Time Critical SubVI or Timed loop. 

 

If you're new to LabVIEW Real-Time you may want to look through the Getting Started with the LabVIEW Real-Time Module here

 

I'd also recommend checking out our cRIO developers guide. It can be found here.

Applications Engineer
National Instruments
CLD Certified
0 Kudos
Message 6 of 6
(5,916 Views)