LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Syntax Help

BACKGROUND:
 
I am using
 
>>> an NI cRIO-9102 FPGA chassis
>>> an NI cRIO-9012 CompactRIO Real-Time Controller
>>> an NI 9401 module in each of the 8 slots of the FPGA chassis
>>> LabVIEW software with the Real-Time and FPGA modules (all three at the 8.5 version)
 
All I want to do here (as a first "learning step") is to build an FPGA application that will simply trigger a digital output line high and low, based on a digital control on the Front panel of the Host VI (which is to be deployed on the controller).
 
I have a Fluke digital multimeter connected to Mod1/DIO1 (i.e. the return hooked to pin 3 and the active line of the multimeter hooked to pin 16 of the 9401 module located in slot #1 [i.e. the leftmost slot])
 
I compile the FPGA VI and run the Host VI but when I toggle the digital control on the front panel of the Host VI I ON and OFF, I get no change in the reading of the DMM
 
I am attaching the project file.
 
For the purposes of this self-tutorial, I just want to know what is needed or what is missing so that I can get the digital output reading and that I can also read and display via the Front panel indicator, digital inputs as well.
 
Thanks,
 
Auden
 
0 Kudos
Message 1 of 6
(6,071 Views)
Hi Auden,

I believe the problem you are running into is the fact that the NI 9401 is a DIO module that defaults to digital input for all its lines. In order for you to set a nibble (4-bit) as output, you need to either:

1- Open the properties page and set the initial line direction for DIO3:0 to output (since you are trying to output through DIO1)
2- Use the "Set Line Direction" Method Node on the FPGA block diagram to change line direciton.

Actually, what I just wrote is here too:

http://forums.ni.com/ni/board/message?board.id=170&message.id=185258&query.id=559563#M185258

JMota
0 Kudos
Message 2 of 6
(6,054 Views)
So setting the FPGA IO Node to/from "Change to Read" and "Change to Write" does not do anything? or do you have to do both setting the node as well as configure the 9401? Thanks for your response.
0 Kudos
Message 3 of 6
(5,990 Views)

Hi Auden,

When the actual 9401 is configured by specifying the line direction, the DIO lines are specified to operate in a certain direction.  When you set the FPGA I/O node to Read or Write, this is not as explicit as configuring the line directions on the module.  For example, if you are writing on a specific line and then you set the I/O node to Read on the same line, then you will basically just be reading what you were telling the program to write earlier.  So to sum it up, the configuration properties are the correct way to actually specify a line to have a desired direction.  I hope this helps you out with your question and feel free to post back if you have any more questions.  Thanks!

Regards

Noah R
Applications Engineering
National Instruments
0 Kudos
Message 4 of 6
(5,888 Views)

Thanks Noah and JMota,

That was it - - - I have to configure the lines for either input or output - - - just configuring the "Change to Read/Write" property options are not sufficient.

I THINK NI SHOULD DOCUMENT THIS MORE CLEARLY SOMEHOW THOUGH (would have saved me three days)!!!

But now it works like a charm and I am well on my way here.

Another question:

Now that I have a built Host VI (residing on the cRIO9012) and the FPGA VI, what I want is that when I power on the cRIO9012, that BOTH the Host VI and the FPGA VI start running automatically.

How can that be accomplished?

Thanks

0 Kudos
Message 5 of 6
(5,691 Views)
 

Hi rvquartz,

Thanks again for contacting National Instruments.  I'm glad that you were able to get that to work.  Some of the documentation in the LabVIEW help about the FPGA Module goes through how to configure the directions for those lines, but I do understand how it could get a little confusing.  As for your other question, what you can do is just set the Host VI to run on startup and then set the properties for the Open FPGA Reference VI in your Host VI to "Open and Run" instead of just "Open."  I have attached a link below that goes through the steps of how to set up your Host VI to run on startup.  Thanks and I hope this helps!

https://www.ni.com/docs/en-US/bundle/labview-real-time-module/page/creating-stand-alone-real-time-ap...

Regards

Noah R
Applications Engineering
National Instruments
0 Kudos
Message 6 of 6
(5,512 Views)