From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-18-2011 03:57 AM
Hi Batistuta,
When I started my cRIO projectI was told that "variables" were an extremely inefficient way of trying to communicate, because of this I have never used them, but have been able to produce (sort of) project which is similar to yours.
How good is the connection between the PC you are using and the cRIO? I think the network streams functions may be your better bet, I will stick a rough vi together to show you what I mean, which may (or may not) solve your problem, but will hopefully demonstrate an alternative way of communicating between the cRIO and the PC.
Dom
08-18-2011 04:09 AM
Hi Dom,
I am connecting my computer to the cRIO remotely on the local network thru wireless or ethernet cable. Can you please show me an example of vi demonstrating your method of communicating data ? It is greatly appreciated. Thanks!
08-18-2011 04:20 AM
I am working on one now.
In the meantime, define the three variables you want the user to set up, and which ones you want to be able to change "live" and which ones are to remain constant during the data acquisition.
Dom
08-18-2011 04:21 AM
oh,
what version of LV do you have?
08-18-2011 04:51 AM
Thanks.
I am using LV 2009
Basically I want the user to specify the sampling rate by choosing three options (eg. 10 Hz, 30Hz and 50Hz or sumthing like that), and then one stop button that stops the writing data process. So assuming the data acquisition process runs 24/7 non stop, depends on the occasion the user would change the sampling rate without stopping the data acquisition process.
08-18-2011 04:55 AM
Hello,
1) Try to connect error wire from stop variable not just to while loop, but also to the start of timed loop - there is possibility that timed loop executes before stop variable is changed to false.
2) I attached 2 pictures, how should it looked for changeable rate - first you you put starting sampling rate in the variable before timed loop; and then you read the desired sampling rate each irritation.
The improvement of performance would be the value of the variable would not be sampling rate, but the sampling period - that way you wouldn't need to calculate from rate to period each irritation
3) No, flat sequence is not necessary. Also the code in cRIO.vi with Time stamp is not necessary (at least I don't see any connections, because the indicator in Real-Time is not recommended)
For data coming from your modules it is better to use network streams, but for easier implementation I recommended you network variables - if you want to implement network streams please check this site: http://zone.ni.com/devzone/cda/tut/p/id/12267 - here is well described the architecture of network streams.
Different is with stop and sampling rate variable - here you are changing value rarely ( >0,5 s) and it would be useless to send those values each irritation - that is why I recommend you to stick with network shared variables for those kind of values.
Best Regards,
Gregor Cerne
National Instruments
08-18-2011 05:14 AM - edited 08-18-2011 05:15 AM
Hi Batistuta,
Right, try what I have sent you, it is not a final version, but should give you enough information to change what you need to.
I agree with Gregor when it comes to the controls, you may find that with the working network streams, it frees up space on the network for the network variables, which will then, hopefully work well.
Read the link Gregor put up if you haven't already.
Let me know.
Dom
08-18-2011 05:41 AM - edited 08-18-2011 05:45 AM
@ Dom : Thanks! is there a way you can down convert the project to 2009? Becasue i dont have access to the newer version of labview. Or I can post the project onto the down convert thread.
@Gregor: Can you briefly explain the difference and purpose of the Input node on the left hand corner on the timed loop and the right data node?
And also I have tried to connect the error wire to the start of the timed loop as you suggested but unfortunately it cant solve problem 1). I am not sure whether I did it correctly so I attached the photo showing the way I connected it. And I think you are right that the value of the stop variable must be true and that the timed loop executed before the false value was written to the stop variable.
In the computer.vi, where should I place the control to write into values of the sampling rate? should it be placed inside the while loop or outside the while loop? Because my supervisor requires me to only give the user three options of different sampling rate (eg. 10Hz 30Hz 50Hz) I am thinking to use a case structure with three buttons (cases) to write the 3 different sampling rates into the "sampling" network variable. Do you think it's a good idea?
08-18-2011 05:44 AM
it seems that network streams is a new feature in Labview 2010? If thats the case then most likely I will not have access to it. Nonetheless I'll still read the link provided by Gregor and hopefully can build some conceptual knowledge for better Labview skills.
08-18-2011 05:48 AM
Right,
I didn't realise that.
I will try to down convert anyway..... I am not sure how well this will go!!!
I have tried using TCP to achieve the same result, but it is a bit of a faff, I'll have another look.
Dom