04-30-2008 01:46 PM
04-30-2008 02:08 PM
imperial-aero,
Here are three different options I can think of to increment the value of 't', starting at zero:
1. Create another script node that executes before the While loop starts. The node can simply contain 't=0;', and no inputs or outputs should be needed. Make sure to wire the error cluster so that it is guaranteed to execute before the loop starts.
2. Wire the First Call? node to the current script node (you'll need to convert the boolean to a double), and add a case in the node to check if it is the first iteration.
3. This is the solution I would go with: Eliminate the script node altogether, and compute the 'theta' values in LabVIEW. These are very simple calculations, and there is really no reason to send data back and forth between LabVIEW and another program for something like this, unless you ultimately decide to do something far more complicated in the script node in the future.
Chris M.
04-30-2008 02:19 PM
04-30-2008 02:22 PM
Cheers for the reply Chris.
You're right. The last option is probably the best as this is all I am trying to achieve using this VI. However, I've only got basic LabVIEW knowledge and can't actually figure out how I would achieve this. I am guessing I need to have another While Loop inside my main While Loop that does the time incrementing, since the main While Loop increments at every second as it is set up like it is.
Any pointers on how to actually achieve this will be much appreciated.
04-30-2008 03:01 PM
imperial-aero,
Here's how I would implement this in LabVIEW (there are many ways to do this). I removed the DAQ code and made some simplifications to make it easier to read. No extra while loops are necessary because the script node code is not iterative. Note the use of the shift register to keep the old value of 't' at each iteration.
Chris M.
04-30-2008 03:15 PM
05-01-2008 04:42 AM - edited 05-01-2008 04:43 AM