Saturday, February 7, 2009

PROGRAMING FX9860-LEVELING

its nice to be back after such a long-long time. been busy with work, travelling and other things. one of my staff a land surveyor recently bought a casio fx9860 calculator and was at a lost to programing the new toy.

the manual that came with it was useless and no help. i had a look at it, took me about two hours to understand the menu systems and keys (the most difficult part). but once you understand this then programing this calculator is a breeze!(that is if you understand programing concepts).

well anyway if you are keen to learn how to program(i.e not just become a parrot and copy other people's program), i have listed below a small program for land surveyors who use the level machine to fly levels frequently, with explainations on the steps involved. hope its useful to you.

1. Once your calculator is turned on, enter the PRGM mode, using either the arrows on your keypad and press the blue EXE key, or simply press the button which corresponds to the letter B (log).

2. Most likely, the program list is empty. If there are programs present, just ignore them for the moment. To start a new program, press NEW (F3).

3. Enter in a name for your program. For starters, we’ll call our new program "LEVELING". To enter in the letters, use the buttons that correspond to the letters above the keys. Once the word "LEVELING" is written, press the blue EXE key to enter it. You will be moved then to the working area of the TEXT program. This is where the program writing begins.

4. Let’s enter in the text "-99 TO STOP".

5.Notice that the text is in inverted commas. This is intentional because when you enter text, which is to be displayed, you must encase it in inverted commas.
The " is found in the CHAR option (F6), located in the bottom right hand side of the screen. In this menu is the " option (F2).(if don't see CHAR, press the exit key until you see it)

ok this is the program code that we are going to type into the calculator.(leave out the number and brackets, i am using  it to explain the program by line numbers. ) e.g line 1 should be typed as "-99 TO STOP"in your calculator.( i.e. all the blue lines)

1) "-99 TO STOP"      (char(f6 key), sybl (f2 key) then select " and press exe key,  then - 99 shift-alpha, . (the fullstop creates a space ), to . stop , then f6 key select " exe and exe ,alpha key to release text mode.

2) Clrtext        (this is a command, not typed, to search for this command do the following. press shift then the vars key, you will see the menu at bottom of the screen has changed. press f6, then press f1 and f1 again , the clrtext should be on your screen. press exe key.
 
3) ClrList      (while still on the same menu press f3 key , you should see clrlist on your screen, then exe key. note it is important to press the exe key after every line

4) "TBM"? →A    (ok this you can do yourself.(hint press the exit key until you come to required menu. (see line 1 if you forgot how to go to the char menu).  the 3 new items here is the ?, →, A . to insert the  ? mark, use shift, vars, f4, to insert →, use the key on your calculator(found below the "tan" key. to insert the letter A, press the alpha key and press the key showing the letter A, shown in red (below the alpha key), then don't forget to  press the exe key. 

5) "BS"? →B    (key in as shown abve)

6) Clrtext           (key in as shown abve)

7) A+B →C         (key in as shown abve) 

8) 0 →K              (key in as shown abve, the 0 is zero not the letter "o")

9) Lbl 0              ( the " lbl 0 (zero not letter "o")"  is found at shift,vars,f3,f1, then use the keypad for zero, and press exe key.

10) Isz K           (under same menu, f4( for isz command), use keypad for letter k, dont forget to press alpha first to get the letter k, and press exe.

11) Clrtext         (key in as shown abve)

12) "FS"? →D    (key in as shown abve)

13) D= -99 => Goto 1     (key in as shown abve, the goto command found at shift, vars,f3,f2, use keypad for number 1)

14) C-D →E       (key in as shown abve)

15) "LEVEL=": E ◄    (key in as shown abve, the symbol at the end of E is a command ,found at shift,vars,f5. in this case the after this symbol the cusor automatically moves down on step, so the exe key is not used for this line.)

16) E →List 5[K]        ( the "list" command is found at optn,f1,f1, the brackets from key pad)

17) "BS"? →B              (remember to press exe after evry line!!!!!)

18) B= -99 => Goto 1

19) B+E →C

20) Goto 0       (0 is zero)

21) LBL 1

22) List 5 ◄     (exe key not necessary when using this symbol "◄")

ok now that you have typed in the commans, hopefully without any mistakes, you should test the program. go to menu (found in the keypad) , prgm, exe, look for leveling prog and exe it, if you are a surveyor you will know what values to input.  to exit just punch in -99 to exit the prog.

ok now lets lookunder the hood, to see how this engine runs.

line 1  instrusts the user to punch -99  to quit the prog. anything in between the quotaton marks are displayed. this is useful to give instructions to the user.


line 2 and line 3 are commands, to clear the screen

line 4,5  is requesting the user to input some value. Entering the ? symbol tells the calculator to pause while the user enters a number. The  A then tells the calculator to store the value in the memory A. This storing is essential to programs, so that we can recall this data to perform other tasks.

line 7, adds the values stored in a and b and stores it in memory c

line 9, is a command . "lbl 1" is a label. when the prog encounters a "goto" command, it will search for a lbl label to go to. e.g. when the prog comes to a goto 1 command, it will stop and jump to Lbl 1 and start execution from that line.

line 10, isz, is a command to increase the vaue of the memory k by 1 every time it comes to this line. this is like a counter. i use it to put all the results in the calculation to form a list at the end of the prog. its a bit difficult to understand, if you are not a programer, but i suggest you to google it to find out more.

the rest of the lines you should be able to figure out by yourself. 

hope it helped someone out there....................... cheers


1 comment:

Min said...

hi! Paul,
I can't find the symbol on key pad shown in bracket ( : ) in step 15. I'm trying for CFX- 9850GC PLUS. But it almost same function and key pad.I can key in all of your step except above mentioned.