08-17-2012 12:42 PM - edited 08-17-2012 12:43 PM
Hello,
I am new to cRIO programming. I am going to use a cRIO 9022 with different modules, such as 9214, Labview 2010.
However, when I go on the examples, I cannot load the Getting Started Scan Mode for the module 9214, it says I need to reinstall. I do not know which examples have not been installed, since I have reinstalled my software already once and I could not find any change. Can anyong tell me where I can find this example, so I'll try to find the example easily and install it.
Thanks a lot
Cheers,
Antonio
Solved! Go to Solution.
08-20-2012 05:44 AM
Hi Antonio,
Thank you for your post and welcome to the NI forums.
It is strange that the example is appearing in the example finder yet you are unable to open it. I have attached the example project to this post as it is easier than reinstalling LabVIEW. Simply download the attachment and open directly from the download location.
As you are new to CompactRIO, it may be useful to visit our starters guide which includes a wealth of information regarding set-up optimising your system. This page can be found on our website here.
If you have any further questions do not hesitate to ask.
Thank you,
08-20-2012 07:03 AM
Dear Eden,
thanks a lot for your reply. I wanted to ask you if it is possible for you to send me the 2010 compatible version of this software please.
In the meantime I am installing Labview 2012, but, part of the code that i am using to control my system is 2010 compatible, so I'd rather stick with the 2010 version.
Thanks a lot. I have seen that there are courses for learning cRIO, unfortunately the nearest one started today, so I guess I'll have to wait for the 10th of October for the next course.
Cheers,
Antonio
08-20-2012 07:21 AM - edited 08-20-2012 07:22 AM
Hi Antonio,
I have saved the mentioned example to be compatible with 10.0 using LabVIEW's "Save for previous version" function and attached the new document below. Please let me know if this works.
The courses will be very helpful if you are going to be using it a lot in the future. The real-time courses are most relevant to developing on CompactRIO and the FPGA course will be valuable if you plan on using FPGA in your applications. Have you sat any of our training courses before?
Thank you,
08-20-2012 08:26 AM
Dear Eden,
I have never sat in any course, whatever I know, it has been done on trial and error, using codes left by other people.
I guess I will initially use Scan interface, since I know it's easier.
I tried to run the code, but it still gives problems, look the attachment.
Cheers,
Antonio
08-20-2012 11:26 AM - edited 08-20-2012 11:27 AM
Hello Antonio,
Apologies that the last version didn't work. The shared variables used in the project clearly are not backward compatible. I have pulled the example straight from a version of LabVIEW 2010 and attached below, this should now work.
I should note that if you want to be able to access this from the example finder once again, I suggest you put the new folder in the correct directory. This will be found under "C:\Program Files(x86)\National Instruments\LabVIEW 2010\examples\CompactRIO\NI Scan Engine\Module Specific\Analog Input\", just drop the folder in here.
I find trial and error works very well, but also found value in the courses as it is easy to pick up bad programming habits without the correct guidance.
I hope this version now works. Again, if there are any more problems please do not hesitate to ask. I wish you all the best in your application.
Thank you,
08-21-2012 03:58 PM
Dear Eden,
thanks for your work. I have installed the 2012 version, and eveyrhint is working. I have couple of questions on the way the actual code works.
1) I don't understand why there is a High priority and a low priority loop
2) In the low priority, what's the use of timeout, since by changing it, nothing changes
3) is it possible to evaluate the maximum frequency for acquiring the temperature since I have noticed that (in the same physical time)
increasing the period (dt), gives less sample per physical time, but all of them are different (Timeout_100_dt_100)
but with a low period (dt) I have noticed that there are just constant readings between two neighbour readings (Timeout_100_dt_1)
I would like to understand how I can maximise the readings.
I know that plotting the numbers decreases the rate.
I would expect to have a rate of 10 sample per second roughly, which comes from http://www.ni.com/pdf/manuals/375138b.pdf, since I am measuring in high accuracy two channels only, then
maximum rate=1/(Conversion time [52 ms] x Number of Channels [2]) = 9.6 S/s.
Thanks for any reply or suggestion.
Cheers,
Antonio
08-22-2012 03:41 AM - edited 08-22-2012 03:41 AM
Hi again Antonio,
Glad we got the example working. Out of curiosity, do all of your other example codes load ok? In answer to your questions:
1) The high priority and low priority loops are used where timing and determinism are important in your application. Acquisition code is put in the high priority loop to ensure that the device acquires predictably and on-time every time (deterministic code). This is used in applications where it would be crucial to the programmer that data is never missed.
2) The timeout is used so that null data is not attempted to be written to the chart. The shared variable that is reading data will output a "true" in the "timed out?" connector if data has not been received in the specified Timeout (by default in this program it is 100ms). Changing the timeout will change the amount of time that the variable will wait for data before returning a true value.
3) I would suggest that in the dt=1 case, you are trying to acquire data at a faster rate than your hardware can support. This is why you are getting the results appearing to "step". Are you using the scan engine as the clock for the high priority loop? This is defaulted by the program to sample at 100Hz. However, you are expecting a maximum rate of around 10 samples per second. You therefore want the period to be around 100ms which corresponds to around 10Hz.
As for evaluating the maximum frequency you can sample at; start with the manual's suggestion and play around from there.
Thank you,