Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Learning to writing User Interface

Dear All,
 
Me and co-worker (2 and 0 month LV experience) needs to write a User-Interface program for end-user to enter   "CNC-type motion control script".
 
Basically, the user script will be lines of text
Each line is    OP-CODE    Parameter0   Parameter1 ...
Like        MOVE_TO 123.45 345.67
 
So, we need
 
list box for user to select from several op_code
push button  to 'enter'
radio button to select options (like inch vs. mm) 
a graphic plot showing the  'execution'    (like the x-y grid inspection template.vi in the find-example)   
drop down menu (like File in windows)
 
Grateful pointers for beginner's learning resources on user interface.
 
Thanks in advance
0 Kudos
Message 1 of 9
(5,361 Views)

John,

It sounds like you will need to know how to manipulate strings, possibly read from a file, and know the ins and outs of front panel creation.

I highly recommend you look into taking LabVIEW Basics I and II (a weeklong class).

The page found through the following link has a ton of links to training material for LabVIEW (A lot of it is free)...

http://www.ni.com/academic/lv_training/how_learn_lv.htm

Have fun,

Lorne Hengst
Application Engineer
National Instruments

0 Kudos
Message 2 of 9
(5,340 Views)

Hi john,

You can see string manipulation examples in Labview examples folder. Now, first try to write a simple code using string functions, case structures and while loop to parse a code and enable a boolean bit indicating that the code has been parsed. Tell me if you are able to do it. 

Take these steps as a hint :- 

1.) Acquire the string line by line

2.) Seperate the numbers and alphabets

3.) Convert the number part of the string into actual numbers using the vi ("fractional string to number.vi" located in string functions)

Try this much and i'll tell you the further steps.

Regards,

Giridhar Rajan

Automation Engineer

Cruiser Controls

Mumbai, India

0 Kudos
Message 3 of 9
(5,335 Views)
Hi Giridhar,
 
Have done these steps. I created a simple text G-Code program using ASCII text editor. The VI can read in and parse each line and put the X Y Z value into LV floating point number ARRAY
 
The next step is
 
a) read each element from the LV array
b) send to the motion card
 
I have done (b) in stand alone manner.   NOW is a confused on how to read one lement from the array, send to motion card, wait until the motion is completed THEN loop back and get the next line of G-code.
 
Would appreciate some advise, in LV conext, on the 1D array, 2D array, string, cluster. I meant, how they are used in conext of LV. (we are C and VB programmers and still learning how these are used in LV manner)  
0 Kudos
Message 4 of 9
(5,329 Views)

HI john,

 

First of all, sorry for the delayed reply as I was away for sometime. So, thats good work till now. Now you can obtain individual elements of an array using the index array function. there is a 'wait for move complete' option in the motion library. Try to develop a logic that indexes the array and feeds the next command after each "move complete" event occurs. I can help you better if you send your code.

Regards,

Giridhar Rajan

Automation Engineer, Design

Cruiser Controls

Mumbai, India 

0 Kudos
Message 5 of 9
(5,301 Views)
Hi John,
 
I am also trying to create something to read g-code and execute it to the motion controller, and was wondering if you could share a picture of your block diagram or give me some help on how you created everything? I am a little confused on how to do this.
 
Thank you,
 
 
 
Tyler Searle
 
0 Kudos
Message 6 of 9
(4,955 Views)
Hi Tyler,

I think it would be usefull for you to try looking at some of the examples that ship with LabVIEW.  Giridhar gave several great tips for getting started in his post.  Also there are several great ways to learn more about Labview

I hope this helps

GG
0 Kudos
Message 7 of 9
(4,947 Views)


@GiGe wrote:
Hi Tyler,

I think it would be usefull for you to try looking at some of the examples that ship with LabVIEW.  Giridhar gave several great tips for getting started in his post.  Also there are several great ways to learn more about Labview

I hope this helps

GG



Hi GiGe,

I read Giridhar's post but am kind of lost on what to do to acquire the string line by line and to seperate the numbers and alphabets. This is my first year using labview so im an  NEWB. I do know the labview basics but am not familiar with what Giridhar is saying to do. Do you or anyone else know of the .VI's that would need to be used to do this?

 

Thanks for the help,

 

Tyler

0 Kudos
Message 8 of 9
(4,938 Views)
Hi Tyler,

Although I'm not entirely sure what Giridhar is refering to there.  But there are several functions that you can use to parse through strings.  One of the functions is the match pattern.vi.  The function that will be best for your application depends on the string that you are tyring parse.  You may find it useful to look at the detailed help for the string functions to see what function would be best for your application.

Regards,
GG
0 Kudos
Message 9 of 9
(4,931 Views)