This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Monday, March 31, 2008

[oopic] Re: URGENT - OOPic Events not functioning

Thanks for your help - I got the events working in time for the
presentation. Here's the general process I used (based on what others
said in this thread) in case anyone is still puzzled:

-Write code as if oEvent worked
-For each event, add these lines (or something functionally similar)
into your definitions section:

Dim RAM_Access# As oRAM
Const Event_Obj_Location# = 41 ' oEvent "Event" memory location
Const EventCode_Location_Hi# = 0 ' Event_Code EEPROM location High
Const EventCode_Location_Lo# = 67 ' Event_Code EEPROM location Low

(Where # is replaced by the event number)

-Event_Obj_Location can be found in the compiled code (with OOPic 6
compiler after making the code, this can be seen by going to
View->Compiled Code or the C tab, or Ctrl-F2). It's in the
Constructors.Begin section where the oEvent you're linking is defined
(e.g.:
C0039:008 ;Loc 52 Dim Event_Name As New oEvent
In the above code, 52 would be the relevant location).

-To find the Event Code location stuff, download and extract the Sub
Address Finder from the Files section in this group. Run this and load
the .OPS file that is generated in the code directory after you make
the code. It should give a list of subprocedure names and their memory
addresses. Look for the one corresponding to the event you're setting
up. It will give you one number. If this number is less than 256, then
EventCode_Location_Hi will be 0 and EventCode_Location_Lo will be the
number. If it's equal to 256, Event_Location_Hi will be 1 and
EventCode_Location_Lo will be 0. If it's 300, then Hi will be 1 and Lo
would be 44. As the guy who came up with this fix said, Hi is (the
EventCode address)/256 (dropping everything after the ones place) and
Lo is (the EventCode address)-Hi.

That doesn't really explain what's going on, but others in this thread
have explained that pretty well.

I am having problems getting other stuff working, but the problems are
kind of all over the place. I'll work on it a bit more tonight and may
post another question tomorrow if I'm still stumped.


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

No comments: