08-24-2020 11:54 AM
Hello,
Im doing a LabView project designed to control an XY stage.
I am somewhata intermediate in LabView, having only done a short basic course in school.
Before trying to dive in, i decided and simulate the action with a language i am more familiar with - python - to ease the logic and structure of the code in my mind.
I already finished the simulation and the first problem unveiled:
Is there a way to interactively create input fields according to input received from another field?
I want the user to insert the number of desired segments. Each segment has 4 unique parameters - X distance, Y distance, velocity, repetition count.
So if for example the user insert 5 in the segment field id like to display 5 rows with 4 numeric input fields each.
Another option that may work for me is to pre create a maximum of 10 rows, and after the user input the segment number (up to 10), say 3, 3 rows will be visible and accessable for input.
Any advices on how to do it?
I already searched the internet and this community specifically and saved some posts that might help, but none of them solved my question.
Thanks in advance for helping
08-24-2020 12:01 PM
Hi Aqua,
I prefer to use a (multicolumn) listbox to present the "steps". The user can select rows to edit them. Then I place additional controls next to the listbox so the user can input your parameters. Then you need two buttons to add new rows or delete the selected one...
08-24-2020 12:30 PM
08-24-2020 02:28 PM
Awsome!
this is more the way i imagine it graphically and in terms of what i want to allow my user to input.
I am not familiar with complex usage of this dataset. is it possible to use each array (row) seperatly for actions and events?
In short, each segment is represented by an array and i would like the stage to move according to the parameters of the first row, when it finished it should continue to the second and so on, so the user could create different (and somewhat simple) shapes as rectangle, triangle, grid, and other stright line shapes...
If i enjoy the making enough i'd go for a circle which i suspect will be harder task with a need to define polar cordinates somehow within the program, but that is still early 😁
08-24-2020 02:36 PM - edited 08-24-2020 02:37 PM
@Aqua- wrote:
Awsome!
this is more the way i imagine it graphically and in terms of what i want to allow my user to input.
I am not familiar with complex usage of this dataset. is it possible to use each array (row) seperatly for actions and events?
In short, each segment is represented by an array and i would like the stage to move according to the parameters of the first row, when it finished it should continue to the second and so on, so the user could create different (and somewhat simple) shapes as rectangle, triangle, grid, and other stright line shapes...
If i enjoy the making enough i'd go for a circle which i suspect will be harder task with a need to define polar cordinates somehow within the program, but that is still early 😁
Make a For Loop that iterates over the array of parameter sets (wire the array into the For Loop to iterate over that array). Inside the loop is where you tell the stage to move based on the parameters for the given iteration. When iteration 0 is done, it will move to iteration 1 and so on.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
08-25-2020 07:59 AM
Hello and thanks again for your help.
I worked all morning and have made some progress.
So what i have done is dropping an array and placing a cluster inside. inside the cluster i placed 4 numerric fields and chose their type of data.
I also wired the array to the for loop as you mentioned, now I tried to think about the group Name (second input field in the XPS inside the loop) - the group name given by the manufacturer is some long name e.g. XRO34PL9. is there a way to give a numeric field a key name, but still present the label i desire, so i can wire the key element of the field to the group name and use its value all at once?
It is not that crucial cause i can always uses a constant string (as shown in the picture), but it seems like better programing to do it that way...
Another problem i encountered is the fact that i need to specify which direction should be invoked first - X or Y.
I decided t start trying create a grid, so I copied the UI and seperated it into vertical segments and horizontal segments.
I limited the vertical movement (i.e. Y>X distance) to go first, and so Y direction move first, then X. When all vertical segments finish, the horizontal loop should start.
By wireing the invoke nodes as i did, i hope the order of the invoke will go as i desire, i.e. in the vertical loop Y then X, and in the horizontal X then Y.
Is that make sense? I start to realize the course did not prepare me that well for this kind of project...
Also i looked over in my machine's programmer manual, a technical note that explains how to start a .NET node + looked over the internet for what should be the input in nbitem row in the XPS inside the loop, but couldnt find anything. any idea? it is an int32 type.
Moreover the TargetDisplacment row recieves an array, but it doesnt make sense, as the internet page made by the company to control the stage allow to insert a float/double to the rel distance field and it makes a move of the inserted distance in relative to its last stop.
Thanks tons for helping.
08-25-2020 08:13 AM
Hi Aqua,
@Aqua- wrote:
Is that make sense? I start to realize the course did not prepare me that well for this kind of project...
Ask yourself: does it make sense to create a 2D array of the very same "XPS" reference between your 2 loops?
Your course should have taught you the basics about the different type of loop tunnels…
08-25-2020 08:34 AM
@Aqua- wrote:
is there a way to give a numeric field a key name, but still present the label i desire
You can have a caption that gets displayed while the actual label can be hidden and changed to whatever. As an example, make some numeric control on your front panel. Right click > Visible Items > uncheck Label. Right click > Visible Items > check Caption. Change caption to some name to be displayed, the label will stay the default name.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
08-28-2020 08:03 AM
awsome got it!
Another question about the array of clusters which i use for collecting input:
I have tested my code in the following way:
i chose move in 3 segments with my stage, meaning i changed the numeric field connected to the number of rows to 3.
3 rows appeared to me in the array of cluster. i inserted the parameters, pressed start and the stage moved.
after that i chaged the number of segments to 1, hence the array of clusters reduced to 1 row of parameters, i changed the values and hit start.
to my surprise the stage moved first according to the new parametes i inserted, but then went on to move according to rows 2 and 3 in my previous check.
Is there a way to auto clear all the rows that are not presented? or maybe, instead, save the previous data in the UI, but using the data only of the rows being shown ?
08-28-2020 08:45 AM