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.
01-04-2016 09:30 AM
I have to read information (radius of the cirlce, angle of the beginning and end of the arc) from a text file, the generate a random curved line from all of the circle arcs. Any ideas?
01-04-2016 09:39 AM
01-04-2016 10:31 AM
Yes. Start coding in LabVIEW, making sure that you have Controls for all of the Inputs your problem requires and Indicators for all of its Outputs. In your case, this may include a Path Control (to specify the Text File) and an XY Graph (for the plot).
You know something about how the data are organized (it sounds like possibly a comma-delimited text file with three "columns" and multiple "rows", and you know what the data represent. Break this down into steps:
Now write code for each of these steps, and think about how you would "sequence" the steps.
If you have any questions along the way, post your code (attach your VI or VIs) and explain where you are stuck.
Bob Schor
01-04-2016 03:04 PM
I don't understand what you actually want to do, but here are a couple of extra options which can help you with the actual arcs:
01-04-2016 03:24 PM - edited 01-04-2016 03:48 PM
Do you have problems reading the text file or with creating the arc.
An arc is most easily created using complex numbers (a ramp in radians for the arc and a scalar radius)
(Set the number of points in the ramp to a reasonable value, the default 128 is way too big)
If you have a list of arcs, use a FOR loop, autoindexing over the changing values containd in an array. Use a bundle before the output tunnel to create a complex cluster array that the xy graph understands as multiple plots. If all should be part of the same plot, use a concatenating output tunnel and insert a NaN value between the arcs to create a gap.
01-04-2016 03:43 PM - edited 01-04-2016 03:49 PM
You need to tell us how the text file is structured, but chances are that you can read using "read from spreadsheet file" (older LabVIEW) or "read delimited spreadsheet" (LV2015), creating a plain 2D array.
@iam_daiana wrote:
... generate a random curved line from all of the circle arcs.
Of course the curve will NOT be "random" but exactly follow the data given in the file, right? If you want random data, why would you need a file?
Here's how you could process a list of arcs. Most likely, each row will have one set of parameters, so you would autoindex on the 2D array, then index out the three paramteres inside the loop.
If the data is structured to form a continuous sequece of connected arcs, just remove the bundle and make the output tunnel concatenating. Modify as needed.