04-09-2017 10:00 AM
I am currently trying to understand the labview code created by someone else than myself earlier on; my task is to create a cloud for a set target trajectory and I am wondering how should I start/go thorough with it. At the moment I am given the trajectory code that is consisted of key and time as inputs (the code operates on y, x axes as well as t - for time); since I am new to labiew, and given no word description, I am confused with the strucure of the target trajectory code. Could anyone help?
04-09-2017 10:51 AM
If you had attached the actual code (the file possibly called traj.vi), we could have returned it to you with little comment boxes on the various functions explaining what they were and how the code apparently is designed to work. Much harder to do that with a picture. The other thing that having code does is if there is something that we might not recognize, we could do what you also can do, open it in LabVIEW, right-click it, and choose Help to provide a complete description of the function, its inputs and outputs, and how to use it.
Bob Schor
04-09-2017 11:16 AM
Thank you, Bob.
One thing about using the Context Help is that sometimes, like in this particular case, I find it hard to put in the context of the experiment (the trajectory and its changes are supposed to be created for the purpose of an object tracking task, simultaneous for two people).
Anyway, I am attaching the *vi below (of the trajectory generation as well as the key), I would be more than grateful for any comments that could help me understand the purpose of all of the components.
Still, if anyone had ever tried coding a cloud cursor target in labview, please - let me know.
04-09-2017 11:40 AM
Thanks for providing the code. The Key Generation code looks overly complex to me. It appears to consist of "Generate an integer from 0 to 7 using a uniform distribution when Generate is True, and return 0 when Generate is False", but lays on unnecessary feedback loops that mainly serve to confuse me (I've never liked feedback loops, find them tricky to understand, even though I've used them on rare occasion).
It is certainly true that Key will be an integer in the range 0 .. 7. Thus the In Range and Coerce function in Trajectory is not only unnecessary, but a potential source of a bug if you ever decide to use the (unused-in-your-code) "In Range?" indicator, which will return "True" for inputs 0 .. 6 and "False" for the single input 7.
I'm about to try to catch a plane to return home, so haven't time to look at the rest of the code. I also know nothing about "cloud cursor trajectory" -- I can't even imagine what this is ...
Bob Schor
04-10-2017 08:59 AM
Thanks, Bob.
On the cloud cursor topic, I have the following info (to be applied in general; have no idea how to do it in labview within my given code):
'The target’s trajectory is a multi-sine function
04-10-2017 10:09 AM
It's often a Good Idea to take a complicated, complex task and break it up into simpler parts. I'm going to discuss one such "simple part", namely generating an "exact" Cloud Cursor Trajectory.
You have provided formulas for the X and Y coordinates of the trajectory as a function of time, have given an "update" time of 400 msec, and a total time of 15 seconds. If we were to plot 15000/400 = 37.5 (rounded up to 38) points at 400 msec intervals, we'd have the Exact Trajectory.
X-Y plots are Graphs. The X and Y values are made up of a sum of sine terms, where each sum has an amplitude and a frequency, and there are 4 of each of them. This suggests 4 arrays -- X Coeff, X Freq, Y Coeff, Y Freq. A simple For loop will compute the array of X-Y coordinates, which we plot.
Here's a LabVIEW 2016 Snippet of the code -- I've also tried to save it as LabVIEW 2014 as an attachment.
Bob Schor