11-06-2007 03:34 PM
11-07-2007 02:17 PM
Hi Greg,
Thanks for contacting National Instruments. I have been looking into your questions and I have some answers for you. These are some pretty good questions and are pretty important for understanding how the cRIO system works as a whole. Here goes...
1) The loop timer that you are seeing at the very beginning is there to set up how the loop will execute and sets up the timing for that loop. You are right in that it does this. The loop timer actually only executes on the first iteration of the loop and sets flags for making sure that the timing of the loop stays consistent and executes in the specified amount of time.
2) As for the calibration data, the actual module is calibrated at the factory when it is made and this data is stored on an EEPROM on the actual module. This data is used basically for converting the binary numbers returned by the module into actual Engineering units that will make more sense to you. Since these values are static and do not change, there is no need to have the reading of this data inside of a loop. Reading it once and storing the data will suffice. This will make the program more efficient in that you are using less calculations and taking the necessary steps to ensure the timing that you want.
Now, on to the real question... as for getting the different delta t's between each sample, this looks like it is occurring because you are running the program on the host PC. Running the program on the host PC eliminates the value of the Real-Time operating system on the cRIO controller, or 9002. Usually, we recommend that all calculations and samples take place on the FPGA/RT system and the host PC mainly be used for displaying data to the user and merely provide a user interface. With non Real-Time operating systems, you can never be completely sure what is going on in the background, so other processes may take priority over your VI that you are running and hurt the determinism of your application. I have attached a link below that goes through some of the basic ideas behind Real-Time.
I hope some of this helps and please don't hesitate to reply back if you have any more questions about this issue. Thanks!
http://zone.ni.com/devzone/cda/tut/p/id/3938
11-07-2007 02:19 PM
11-08-2007 08:59 AM
11-08-2007 09:54 AM
Hi Greg,
I have been doing a little more research into you question, and I want to clarify something about your question a little further. When using the I32 numeric data type, 31 bits are used for the actual value while one final bit is used to determine the sign of the value. When passing the data through the FIFO, it will copy the data as a 32-bit integer exactly as it appears. However, when you are programming in the Host VI and need to convert the data to a nominal value, you can use the Binary to Nominal VI that is already programmed with the knowledge and capability to convert the binary data coming from the 9217 into an I32 nominal value. So in summary, transferring the data as a U32 number will not affect anything with your data and you should not have to use any kind of a workaround to get the correct data. I hope this helps and clarifies some of your questions. Thanks!
11-08-2007 07:56 PM
11-09-2007 01:21 PM
Hi Greg,
Thanks for the response and the sample program with the explanation! I have been looking over your program and I think I may see why exactly you're seeing the FIFO not fill up. When you are checking the FIFO to see if it is full, the only time the value will return as true from the FIFO Write function is when it is full and you attempt to write another element to it. In your case, you have your information in a For Loop and are only placing the elements you have to fill it up into the FIFO and not running through the loop again in order to see if the FIFO is full. I hope that makes sense with how the FIFO will return a True value for being full.
However, with all that being said, you do not have to fill the FIFO completely each time you write to it. When you set the depth, you are basically just creating a buffer that is of a certain size. Please don't feel like you have to pad the FIFO with extra values just to take up the extra space. I have attached a link below that you may have looked at already, but it does go through some of the basics behind the FIFO. Also, the LabVIEW help is a great resource for getting information about anything involving FPGA. I hope some of this helps and good luck with your program!
http://zone.ni.com/devzone/cda/tut/p/id/4534
11-09-2007 02:08 PM
11-12-2007 03:29 PM
Hi Greg,
Thanks again for the reply. I think the problem you may be seeing is a result of running your program in Emulator mode. I have been able to write a sample program on my own and I am able to see when the FIFO is full when I'm not running in Emulator mode. When you use the Emulator, you cannot simulator a FIFO as it is physical memory. Try running your program without Emulator mode enabled and it will hopefully work then. Please let me know what you see. Thanks!
11-12-2007 07:55 PM