LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Really challenging, Really Tough Array problem



@sudhir01 wrote:

Is there a way to obtain the string X0 Y0 Z0 F100 inside the case G0 instead of obtaining it outside the while loop.



Hey, this is LabVIEW! Everything is possible! 😄

I assume you want this extra string only inside the case structure and not also in the listbox later split into seperate tokens. Is this correct?

In this case you could do something like in the attached modification.

Message 11 of 17
(862 Views)
Hi GerdW,
 
I am unable to implement this one using search pattern. May be I'm still at a beginner level. Below is my VI. Kindly modify this for me to obtain X0 Y0 Z0 F100 inside G00 using search pattern. Thanks.
 
 
0 Kudos
Message 12 of 17
(852 Views)


@sudhir01 wrote:
 
I am unable to implement this one using search pattern. May be I'm still at a beginner level. Below is my VI. Kindly modify this for me to obtain X0 Y0 Z0 F100 inside G00 using search pattern. Thanks.


Have you tried my example above?
0 Kudos
Message 13 of 17
(846 Views)

Hi Altenbach,

Once more you came for the rescue. You should be called, The LV Superman. Thanks a lot.

I have one more doubt. When I get the string containing X10 Y50 Z70 F100 inside the case G00, I am able to seperate the numbers following X,Y,Z and F i.e. 10,50,70 and 100 into four variables. Now I feed these values to a three axis motion control system using NI PCI7344 motion controller in which X,Y, and Z specify the position of the motor for the three axes and F specifies the speed of the motors. I have used the VIs "load vector motion", "load speed" and "start motion" to command and "read speed in rpm", "read position" to analyse. Now, my control does'nt stay in G00 till all axes reach their required position. It just commands the controller and moves to the next case. Hence the variables that indicate the speed and position of motors become inactive because the control has shifted to another case. Please let me know, how to keep the control to the case till the task finishes.

0 Kudos
Message 14 of 17
(839 Views)

Sorry, I am not familiar with the motion control VIs. Here's a wild guess on a possible solution to be placed in the G00 case:

(1)  Give your motion commands, then (2) put the "read position" inside a small while loop (together with a small wait statement e.g. 10 ms). Inside the loop, compare the actual position with the target position and once they are equal finish the loop. Only after this loop finishes, the G00 case can complete.

0 Kudos
Message 15 of 17
(825 Views)
Hi Altenbach,
 
The while loop worked for me. Thanks again. If you remember, I had a list box in my VI. I want the the list box to show all the elements in the string and highlight only that one which is being currently executed. For example if my string is
 
STRING
---------------------------------
G98 G21 G15
G6 G00 X10 Y15 Z50
G54 .......
---------------------------------
 
The listbox should display all the strings at once as below
 
Listbox
---------------------------------
G98
G21
G15
G6
G00
G54
   -
   -
   -
---------------------------------
 
and highlight the case the one being currently scanned. If the loop is in G00, then G00 should be highlighted in the listbox. When I tried to implement it, my listbox does'nt go with my case structure and moves irrespective of the current string being scanned. Please help me implement this.
 
Regards,
 
Giridhar Rajan
Automation Engineer
Cruiser Controls,
 
Mumbai, India
0 Kudos
Message 16 of 17
(814 Views)
In order to update the listbox in realtime, the listbox needs to be inside the main loop. The simplest solution would be to only show the commands up to the currently processed. You don't yet know all of the commands, because the rest of the string hasn't been parsed yet. 😉
 
The attached (LAbVIEW 7.1) shows one possibility.
 
If you want to show all the commands from the start, you need to make a dry run that parses the entire string and extracts all the commands BEFORE entering the big loop. This should also be easy to do.
Message 17 of 17
(807 Views)