![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| CamSoft Products Discuss Camsoft PC based CNC controller products here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
| Using CNC Lite: From GCODE.FIL as delivered, the logic commands associated with G1 (G01); !'DISPLAY4 {f*[\73/100]} !'DISPLAY5 {s*[\74/100]} !TIME CYCLE;\4 !DISPLAY7 \4 !RUNTIME \4 !DISPLAY8 \4 -----G1 I kind of understand the first two lines. The apostrophe at the beginning of the first two lines make them unread by the system, Yes/No? I don't see the apostrophe being used in any other G codes. I understand the logic values DISPLAY, TIME CYCLE, RUNTIME. I don't understand the use of the semicolon after TIME CYCLE. What parameter would/could be placed after TIME CYCLE? I don't understand the variable \4. What is happening? The variable "4" is all over the place in GCODE.fil and MCODE.fil but doesn't seem to be a dedicated variable like \73 and \74. Any help appreciated. Last edited by keithorr; 05-06-2005 at 04:53 PM. |
|
#2
| |||
| |||
| Ok.. Im not good at reading other peoples code but here goes: Assuming the control named DISPLAY7 is visible in your interface, the following code will grab the value that is stored in variable \4 and put that value into the display box on your interface. !DISPLAY7 \4 This code will get the time since the cycle was started and store that time into variable \4. !RUNTIME \4 This code will get the value stored in variable \4 and show that number on your interface in the control named DISPLAY8. !DISPLAY8 \4 One cool way to learn the camsoft code is to make a clock. Try this. In your Startup.fil place the following code: !Timer ON;1000 'this line turns the timer on and sets the interval to 1000ms !\500=1 'this line simply makes variable number 500 equal 1 In your Timer.fil place the following code: !\500={\500+1} 'this line reads the value of variable 500 and adds one to it. !DISPLAY1 \500 'this line reads the variable 500 and puts that number into your display box. On your interface, make sure DISPLAY1 is visible. When your interface starts, the control named DISPLAY1 will change every 1000 milliseconds (1 second) and it will read a new number that is 1 higher than the previous number. Every 1000 milliseconds, the timer file will run all the code that was placed in the file. Since there is code there that tells it to get the value of 500 and +1 to it then variable 500 will increase by 1 incrementaly every second. Instead of placing the code in the timer.fil file, you could also go into your Mcodes and place the code there.. Then assign that Mcode to a button and everytime you press the button the variable \500 will update by 1. You get only 999 variables to make your program and you can use them over and over in any way you want. All codes place anywhere in any of your .fil files can access the value in any variable. The values in your variables can be anything you can type with your keyboard but be carefull because when you start messing with filenames as variables, the camsoft software goes to another dimension of understanding. Once you get the hang of it, you can so some very crazy things with the interface. Hope this helps . Murph |
|
#3
| |||
| |||
| That helps. Since variable \4 is a time value, the DISPLAY7 (Cut Time) and DISPLAY8 (Run Time) are being updated each time a G01 line of code is run. I still don't get the apostrophe in front of DISPLAY4 (Feed Rate) and DISPLAY5 (Spindle Speed) |
|
#4
| |||
| |||
Good for adding notes or temporarily making it so a line wont run without having to delete the line. Murphy |
|
#5
| ||||
| ||||
| You need to learn Camsoft's search engine(Its way cool and helps a lot). Here's the result of the TIME command: TIME Returns various elapsed times in minute format since the machine has been turned on into the user-supplied variable. There are two parameters. The first parameter is the keyword. The keywords are ON, CYCLE, IDLE, DATE, MS and RESETMS. The ON keyword returns the time elapsed since the machine has been on in minutes. CYCLE is the amount of time the machine has been in either auto cycle or single step mode. IDLE is the amount of time the machine has been idle and not in cycle. DATE is the current month, day, year, hour, minute and second. MS returns the number of milliseconds that elapsed since the last RESETMS was done or since the EXE was started. Minimum CPU time cycles will vary between computers (15ms to 60ms). Accuracy is very good above this. RESETMS is used to zero out the MS counter. The second parameter is the variable. EXAMPLE: TIME ON;\55 In your case TIME has the parameter CYCLE and stores the result to the variable after the semicolon, \4 in your case. Later on, you can attach potentiometers for feed to analog input 1, uncomment out all the lines with \73 in them, and have a knob to adjust feedrate on the fly. The programming is all done for you, just remove the comments. Same story for spindle speed. There's a bit of a learning curve for you. Stick with it,Camsoft is the most powerful control out there. Karl |
| Sponsored Links |
|
#6
| ||||
| ||||
I understand that TIME CYCLE and RUNTIME enter values into variable \4 and DISPLAYx utilizes the variable value.
According to the Camsoft search engine, semicolons are used to fill a space when a parameter value is not being used. What parameter value could be used following TIME CYCLE? Why isn't RUNTIME or CYCLES (not time-cycles) followed by a semicolon? Again, why is there an apostrophe in front of DISPLAY in the Gcode.fil for G1 but not G0,G2,3,10,81 etc? I understand the \73,74 override. |
|
#7
| |||
| |||
| The apostrophe is so the code doesnt run. It may only be my view but it seemed to me that all of the camsoft code that came with the package was just examples of how to do things. If your inquiry is based on the fact that the piece of code you gave us didnt make sense in a real world application then you would be correct in most cases. Here is some more examples of coding.. !IF #29=1 THENIF \17=<0 THEN#28=0 :#29=0 :#62=0 :ESTOP Notice the semicolon ":" that seperates the commands. The above code says: If output 29 is on then if variable 17 is equal or less than 0 then turn off output 28 turn off output 29 turn off output 62 and emergency stop. Did that help? Murphy |
|
#8
| |||
| |||
| "If your inquiry is based on the fact that the piece of code you gave us didnt make sense in a real world application then you would be correct in most cases." I was told by sales that the G Code is ready to go out of the box. I'm wondering why the lines were included if the display boxes were not going to be updated. I know some of the examples are just examples, and not usable as delivered. The documentation even states as such for StartUp.fil, InputIO.fil etc but I was told different regarding gcode.fil. Also, your example of THEN#28=0 :#29=0 :#62=0 :ESTOP is using a colon, not a semicolon so it's not germaine to my concerns. With the syntax being so specific, I don't want to make mistakes on an active machine. I finally realized I can play back G Code files in the "demo" mode by using the "single step" button and see what updates with each line. If I use the "cycle start" the lines run right to the end with no chance to see what is going on. If camsoft doesn't reply here I will contact them on Monday. |
|
#9
| |||
| |||
| The ":" seprates commands on the same line. The ";" is used to seperate parameters within the same command. Here is an example. !BUTTON1 OUT;DESCRIPTION;12;FILENAME !BUTTON1 IN;WATER ON; 15; MyButton.bmp The above example is right out of the book but is a useless example that is meant to show only the syntax to be used for the BUTTON command. !BUTTON1 ;;;Manual.bmp The above example is my own code. Notice the differences. I do not require a parameter for IN or OUT so I skip that parameter but it still needs the ; to be there. I also do not need to include a DESCRIPTION for the button so I placed another ; there. The 12 is a color code and since I didnt need that either, I just placed the ; there. The file name I needed so that changes with my code. Am I making sense here? If you were sitting next to me this would take less than 60 seconds for me to show you and you would understand. Typing it out here makes it allot more difficult to show. The button command requires 4 parameters. Those are: ON or OFF A DESCRIPTION which puts text onto the button for the user to read COLOR which is a number 0-15 or something like that. FILENAME which tells the interface to find the file name and use that filename as the buttons picture graphic. Here is another example !TIMER ON;1000 The TIMER command takes 2 parameters. The first parameter is either ON or OFF. Then a ; is placed there to seperate parameters and the second parameter is the timer interval in milliseconds. Here is an example of turning on the timer, and setting an output to ON. !TIMER ON;1000 :#29=1 Here is an example of turning off the timer and turning off the output. !TIMER OFF : #29=0 Here is an example of turning on the timer again at 1/2 sec interval and also setting variable 5 to the value of HELLO !TIMER ON;500 :\5=HELLO I hope this helps.. I know your getting fustrated.. This is a very normal reaction to the camsoft software and it will go away quickly once you get the basics figured out. Keep asking questions.. I will help you as often as I log on to check the messages.. Murph |
|
#10
| |||
| |||
Go into the directory that contains all your files and delete the file called LOGFILE.FIL The next time you open your interface, make sure to open the diagnostics screen. Opening the diagnostics screen forces a new LOGFILE to be created. Run your code, and when you close your interface, a new log file will contain all the commands and actions your program did and how the camsoft interface reacted to them. The LOGFILE was created for exactly this purpose. Here is a tip about camsoft. (Maybe I should just keep my mouth shut but here goes anyhow). My own experience has shown that when it comes to the very basic stuff that is explained and shown in the book, they tend to stay mute to questions. When it comes to advanced questions that are not addressed in the instruction book(s), they tend to speak up and answer. I know your fustration.. Believe me I know it.. Just hang on and keep asking questions and you WILL figure it out shortly. Once you figure out the basics, you will begin to love this program. Murphy |
| Sponsored Links |
|
#11
| ||||
| ||||
| Here is a tip about camsoft. (Maybe I should just keep my mouth shut but here goes anyhow). My own experience has shown that when it comes to the very basic stuff that is explained and shown in the book, they tend to stay mute to questions. When it comes to advanced questions that are not addressed in the instruction book(s), they tend to speak up and answer. I know your fustration.. Believe me I know it.. Just hang on and keep asking questions and you WILL figure it out shortly. Once you figure out the basics, you will begin to love this program. Murphy[/QUOTE] Both points here are right on. Put yourself in the techs. shoes for a second; they are not there to teach programming 101. Their purpose is too help with technical problems. For this, THOSE CAMSOFT GUYS ARE THE BEST! Don't wear out your welcome on the basics. Learn on your own and ask here. The CBK you have will run a machine right out of the box. But it won't be exactly right for your appication. If I were you, I'd pick a very simple modification to work on - say add a light to the display - read everything and try it. Be sure and keep backups so you can alllways go back. Learn one thing a day - in a month it will all make sence and seem easy. Karl |
|
#12
| |||
| |||
I found it much easier to scrap EVERYTHING and start from a blank slate with no code in any files... (maybe it's just my way of learning) My disclaimer would be that my machine is so far removed from any Mill CNC type application that none of the code would help me anyhow.... I did however use the old codes to check syntax examples when the book did nothing to help. Murphy |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |