00:00:14 until the enumerator releases it 00:00:18 sure ... 00:00:49 question - how does linux handle directories... same problem... someone may delete or add a file while in another shell they're ls'ing the same directory 00:00:58 what other languages do is have each 'thing' hold a referecne counter 00:01:14 seems nifty... I have recently worked some with tcl, which converts everything to strings, and unfortunately that's left a bad taste in my mouth for strings... but... I'll try to get over that ;) 00:01:36 zwisk - the only strings are object names 00:01:55 like stepgen.0.step 00:02:04 we want human readable names for those things anyway 00:02:06 so, thing A is created and a referecne is held in a list, thing A knows that one thing holds a reference to it 00:02:43 when the array deletes that ref, it shoudl inform A that its no longer holding a reference 00:02:55 when A's reference counter hits zero, it deletes itself 00:03:11 ewwww 00:03:25 otherwise, you could be about to do someting to A, and soemthing else could delete it 00:03:59 many languages work this way internally 00:04:05 my plan is that you say "do foo to A" 00:04:21 the code will get a mutex, look up A, do foo to it, and release the mutex 00:04:24 atomic operation 00:04:57 if someone else says "do delete to A", then either you get there first, and your op succeeds, or they get their first, and your op says "A not found" 00:05:07 no chance for lockup or crash in either case 00:05:21 get me a list of things in A 00:05:26 how many things are there? 00:05:28 15 00:05:34 ok lets do stuff to these 15 00:05:40 oh theres only 14 now 00:05:43 but if you were able to do "get me a pointer to A" and then later "modify the thing pointed to by this pointer", you can have trouble 00:06:08 sure 00:06:24 as I say, many languages do the reference counter thing 00:06:59 so you're saying that if somebody had said "get me a pointer to A", then until they say "I no longer need this pointer to A", that A would be locked? 00:06:59 but mutexs are another way 00:07:10 not locked no 00:07:15 but not deleteable 00:07:20 well you wouldn't be allowed to delete it 00:07:30 correct 00:08:16 if the thing is an integer or a float, then deleting it is simple 00:08:33 if its a more complex tihng, then it will likely have its own delete routines 00:08:37 in this case, the thing is a struct containing everything the HAL knows about a module 00:08:59 (which may write stuff back to a file or a db before it hits the bit bucket) 00:09:35 no need for that here 00:09:39 quite 00:09:57 but there is much cross coupling 00:10:01 there is a list of components 00:10:02 but delete routines or destructors are there if you need them in many languages 00:10:21 well, if theres lots of cross coupling 00:10:31 there is only one language relevant here - C 00:10:41 isnt the risk of someting wanted by one thingm being deleted by another thing there? 00:11:05 at least until you can reliably write kernel modules in Python, or Java, or such, at which point I quit programming again 00:11:16 well, you are trying to build waht is effectively a language .. HAL, on top of C 00:11:23 yes, in a way 00:11:30 so ... 00:11:57 you can either say "there is nothing out there that is relevant or similar .. all the problems here are unique" 00:12:11 or you pick bits that work from hopw other people have solved stuff 00:12:21 miscommunication 00:12:32 the trick is to pick the tight bits :))) 00:13:13 I'm trying to figure out _how_ to implemnet such things in the language I have 00:13:47 I thought you were telling me that "they are already implemented in language J" which isn't usefull to me 00:13:57 right, but these same problems have been solved before 00:14:02 agree 00:14:08 quite, 00:14:17 I wasnt suggesting you USE the other random language 00:14:36 but the implementation may be useful 00:14:54 true enough... for example, today I don't use reference counting 00:14:57 or at least worth looking at so you can say "yuck" :) 00:15:30 when someone says "delete signal foo", I must traverse the pin list to see if any pin is connected to signal foo, and if so disconnect it before deleting foo 00:15:58 although a ref count wouldn;t really help there, I need to know _which_ pins are linked to foo, not just how many 00:16:11 sort of 00:16:19 you could just never say delete_foo 00:16:36 what do you mean? 00:16:54 reference counting just says, "well, theres pins connectoed to it still, I guess its still neeeded 00:17:08 when you disconnnect the last pin, it deletes itself 00:17:16 but I don't want it to 00:17:29 well, thats fine, its an architecture decision 00:17:41 as a user, I want to declare the signal, then connect as few or many pins as I wish to it 00:18:01 if I disconnect them all, the signal should stay around, so I can connect more things to it later 00:18:09 ok 00:18:22 imagine you create a timer, and connect someting to it 00:18:26 OTOH, if I delete the signal, all the pins connected to it need to disconnect automatically, the user shouldn't have to do that 00:18:38 as you say, architecture issues 00:18:46 some other ting also conencts someting to the timer 00:19:07 the thing that created the timer beleives its now no longer needed and dleltes it 00:19:22 leaving the second thing now broken and timerless 00:19:34 so it goes 00:19:44 indeed 00:19:50 in HAL, the tings doing the creating and deleting are humans who are designing a system 00:20:18 tings wont get added, modified or deleted in realtime? 00:20:24 if I have an emc running and I choose to delete the step generator, it's gonna get deleted 00:20:38 actually, you might have something there 00:21:09 I still insist that if I truly want to delete a step generator even tho its got stuff connected to it, I should be able to 00:21:22 however, there might be benefit to warning the user that stuff is connected to it 00:21:38 indeed 00:21:56 if you did have that ... 00:21:58 the warnings could become a PITA very quickly 00:22:16 you could implement what many languages call a 'garbage collector' 00:22:30 walk the tree, find tihngs with no connections and bin them 00:22:30 no, never, no way 00:22:45 or, even as a user thing ? 00:22:58 'find me spare stuff ive forgeotten to connect'? 00:23:20 maybe a "delete unused" command or something, but certainly not as the primary method of freeing stuff 00:23:50 as seeen in a million an one pcb layou packages "wanirng: resitor R34 has no connections" 00:24:03 right 00:24:43 but again we're drifting away from the details that I was focused on 00:24:49 true 00:25:19 ref counts alone won't work because you almost certainly need to know _which_ things are referencing you, not just how many 00:25:21 mutex or reference count .. just dofferent answers to the same problem 00:25:31 nope - different problems 00:25:57 most languages just ahve an integer count 00:26:03 mutex is used to prevent simultaneous access while you are making changes 00:26:10 true 00:26:12 the changes may in turn change a reference count 00:26:33 for instance the linksp command links a signal to a pin 00:26:54 the command must verify that both signal and pin exist, then establish the linkage... in the process, the pin 00:26:57 oops 00:27:14 the pin's refcount and the signal's refcount will increase 00:27:58 but the entire process of verifying pin exists, verifying sig exists, verifying that they're compatibla, and connecting them, must be protected so somebody can't come in and delete the pin in the middle 00:28:10 quite 00:28:33 threads, 'synchronized' etc 00:28:45 the binary tree scheme is just a way to make the "verify pin exists" a little faster 00:29:22 you are going to ahve a fun time with all this you know :) 00:30:25 why do you say that? 00:31:20 you are going to go through pretty much all of writing your own high-level languiage ... 00:31:23 no mean feat 00:32:01 already did it once.. this is the HAL "refactor", remember 00:32:10 indeed 00:32:43 'plan to throw at least one away' :) 00:33:32 woner haow les is getting on with segmot 00:33:50 wonder how his mexican is getting on with sanding? 00:33:57 dunno 00:34:26 you have a terrible way of distracting me... I barely remember what zwisk and I were discussing ;-) 00:34:38 hm.. 00:35:00 you were traversing a changing list :) 00:35:18 right... changing from linear lists to binary trees 00:35:19 wata 00:35:33 * jmkasunich digs out his ancient balanced binary tree code 00:35:38 I think I got my self into to much stuff 00:35:39 again 00:35:45 :) 00:35:49 gezr: you are in a maze of twistign opassages, all different 00:36:30 hu? 00:37:03 old game on early mainframes 00:37:14 yeah, my prusit of C I think is going to have to go onto the back burner, I should work just on the bike and the emc ploter 00:37:31 this past week seems to have flown by 00:37:36 is that good? 00:37:52 and Im not sure I got anything done, I know I forgot to pay some bills, thats not a good thing 00:38:04 I did manage to clean up 1/2 my shop 00:38:39 Ide love to learn how to program, but I cant stay simple, im not ready for it yet 00:39:32 emc is proably not hte thing to cut your teeth on anyway 00:39:42 no and im not using it to do that 00:39:52 heh:) 00:39:56 its eventually a goal but not part of the learning 00:40:18 so ... how is the EMC powered plaotter going? 00:40:21 its like mastering the stroke but all were after is the grand fanal 00:40:45 I bought a 2x2 foot 1/2 thick plywood sheet to mount it to today 00:40:51 good call 00:41:00 Y is finished 00:41:01 I used 40mm MDF for my router 00:41:05 or its X 00:41:13 kew; 00:41:20 got a motor and a drive? 00:41:28 maybe tonight while im watching cartoons ill make the other slide 00:41:35 :) 00:41:52 yeah, drive is just my good ole ucn8054b chips 00:42:02 motors are just oh that should work, 00:42:06 nema23's 00:42:30 powersupply is computer standard, at style with a switch 00:42:47 lighting provided by 2 special light bars out of an old scanner 00:42:48 hm, could I just put in the pin definitions into the generic.ini and run? 00:43:19 since when I use the emc.ini the computer freezes.. 00:43:33 and im thinking I can use mr dremell as a fixed Z 00:44:24 whelp... I hit my kernel oops and had to reboot :) 00:44:41 gezr: are you going to hook it up and drive that first axis soon then? 00:44:42 how come you keep having oopses? 00:44:54 first one this project! :) 00:45:18 This time it's because I goofed up a return value and ended up in an endless loop inside the kernel. 00:45:20 robin_sz : yeah ive done that already 00:45:26 kewl :) 00:45:34 oh, I thought you said something earlier about expecting them 00:45:49 as if they were a regular occurance 00:45:50 thats a great ting to do .. once you see one move, you just ned two now to doa circle :) 00:46:34 hm.. 00:46:40 well... yeah, when you develop in the kernel, sooner or later you get the equivelent of a segfault in the kernel. If it's during module initialization, I haven't found a way to gracefully recover... 00:46:59 robin_sz : a circle, with an A in the middle 00:47:03 :) 00:47:13 cause once I get that taste my finacial situation may fall to anarchy 00:47:19 3d shapes are cool :) 00:47:37 zwisk: been there, done that 00:47:53 gezr: worry not, somehting will turn up 00:48:05 especially when I was working on RTAPI 00:48:51 hm, how far away is the vital cards from being usable? 00:49:09 * robin_sz passes anonimasu a piece of string 00:49:09 emc1 or emc2? 00:49:27 robin_sz: I meant with the interference issues.. 00:49:43 no eyed deer 00:49:48 jmkasunich: the default BDI one.. 00:50:58 emc1 then... I thought it already did work with emc1 00:51:06 * robin_sz nods 00:51:15 I thought it was 'testing' still ... 00:51:30 dunno - Paul and Abdul are involved in that 00:51:42 as in 'it appears to work, lets check to be sure' 00:52:11 ah ok 00:52:32 as soon as it's confirmed to be working good for a while I'll order one.. 00:55:07 it may have progressed since then, check with paul_c to be sure 00:55:56 ok 00:58:41 tired now, spent several hours assembling pallet racking and stacking stuff on it 01:01:06 if your going to bed goodnight 01:02:31 I'll be heading out for the shop in na bit 01:03:01 I think im gonna boot the emc box to win and watch some cartoons and play clean up some more 01:03:21 I need to get emc running if I am going to try this stuff out tomorrow.. 01:03:25 and then if I get that done I may do something else 01:03:53 Like work on getting the bike finished up 01:12:15 :) 01:13:46 gezr, remember those pictures... spent all day making a application/php script to gallery them for me. http://www.lloydleung.com/EMC 01:14:13 apt-get install gallery :) 01:14:24 Not what I watned. 01:14:36 gallery _can't_ just look at a directory and display thumbnials. 01:14:42 ah 01:14:47 I have to go through a whole process to enter them into the database. 01:14:58 I want something _simple_, thumbnails generation... 01:15:13 so I can just upload pictures, and wham done. 01:15:18 evreything is automated. 01:15:24 its cool 01:28:39 Imperator_ has quit 01:37:11 picnet has quit 01:43:34 ive got at least 100 feet of this stuff 01:44:59 18awg 300v 7pair with one coated, and one uncoated, I could call it 8 pair with a free ground I guess 01:45:16 good stuf? 01:50:08 what do you need it for? 01:50:09 :) 01:50:27 I hate when I have to maching small stuff... I have to go sooooo slow. 01:50:40 I wont need all of it :) 01:50:47 so Ill give whoever may need some some 01:50:58 machining O1 drill rod... with the diamter now down to 4.8mm... I'm going like 2000rpm or so, at 10mm/min 01:51:10 hmm 01:51:18 it's coming out very shiney. :) 01:51:21 if I don't... it chatters. 01:51:34 I have a live center supporting it already to. 01:51:39 thats good 01:51:43 whats your depth of cut? 01:51:48 0.05mm righ tnow. 01:51:49 and are you using an insert? 01:52:00 are you getting a stringy chip? 01:52:02 when it was larger I was doing 0.1mm 01:52:07 very stringy. 01:52:15 you need to take at least 1mm doc 01:52:16 I had a big clump of steelwool. 01:52:27 1mm?? 01:52:29 ONE!? 01:52:31 what sort of tool are you cutting with? 01:52:51 just a ground hss bit? 01:52:52 I'm using an carbide insert, that was originally good for ALuminium. 01:53:05 the stock was only 1/2" to begin with. 01:53:06 okay, whats the corner radius of the insert? 01:53:11 sec. 01:53:18 let me find the designation for the bit 01:53:52 toshiba tungaloy... DCGT 11T304 01:54:02 these puppies were $10USD a bit. 01:54:08 oh man 01:54:18 looking it up. 01:54:37 I cant tell the raidus for that, the 4 would be it, but thats like .063inch radius 01:54:59 http://www.carbidedepot.com/detail.asp?product_id=TT%20DCGT11T304PPH10T 01:55:11 err... maybe I paid 12.53 for them. 01:55:16 I bought them from that place. 01:56:12 yeah, you need to get your doc up there, so that you break your chip 01:56:13 radius maybe ~0.5mm... I'm comparing it to pencil lead. 01:56:31 the stringy stuff is okay for a finish pass, but those chips are deadly 01:56:37 gezr, does it matter? 01:56:44 I'm just curious as to why? 01:56:52 I've always machined stuff to be stringy... 01:57:00 we had a tech almost get his foot cut off by a stringy chip 01:57:07 it only stopped when it hit bone 01:57:24 this is string, not ribbons. 01:57:29 it's really soft. 01:57:45 I hate strings 01:57:51 and I have an encloser for my lathe as well. 01:57:54 they are razor blades that never end 01:58:21 I guess I could put pauses in my code to stop this kinda stuff. But they don't bother me so much. 01:58:23 that stuff should be chipping 01:58:29 chips get stuck to the bottom of my slippers. 01:58:39 yeah 01:58:40 robin_sz has quit 01:58:53 strings don't... they just get smooshed. 01:59:06 im not saying its wrong to have them, but you really want to be maching, 01:59:22 limitations are one thing, that is the first thing to be addressed 01:59:40 the little chips suck, I get them everywhere 02:00:16 but you can increase your machining time greatly 02:00:16 well... I was maching at these specs... 6 to 4mm radius, I was going at .2. 3-4mm I was going .15, 3-2.5mm I was going at .1. now I'm finishing at 0.05mm DOC. 02:00:30 gezr, I probably could... 02:00:44 realize that my spindle is 1:1 geared, and my spindle HP is rated at 1hp. 02:00:55 yeah limitations :) 02:01:16 if I had american iron, I'd definitely be maching with a higher DOC. 02:01:21 hahahaha 02:01:33 but hey... it's only my lathes time... and I can watch TV in the other room, or chat in here. :) 02:01:38 just work at a depth at least the radius of your tool 02:01:46 this is a swiss watch lathe... only so much abuse I can dish to it. 02:02:11 at lighter depths of cut, the part tends to want to push away from the insert 02:02:50 even when doing very light work 02:02:58 1/64 is the radius 02:03:21 0.016mm, 02:03:27 so .016inch 02:03:29 err. 0.016". 02:03:30 :) 02:03:49 I could do .4 DOC. 02:03:53 .4mm DOC 02:04:03 yeah 02:04:42 and you could feed at .4mm/rev 02:05:22 I cant remember the calculation right off the top of my head 02:05:39 rpm * mpm * .262 maybe it 02:05:54 slomo has quit 02:06:21 I cant really remember, its been a while 02:08:31 well... I'm right now making a shaft for my wormgear... dang it is time consuming... I'm getting it close to size, and using sandpaper in an 1" strip, to grind it down to size... 02:08:43 thats the best way :) 02:08:55 getting within 0.02mm and then grind. 02:09:21 press fit the worm on... and use a #53 drillbit on the shaft... stick a spring pin in. 02:14:32 I dont like stringy chips 02:14:54 then again, ive had a few #9's or sixes stuck in the bottom of my foot ouch 02:15:47 #9's or sixes? 02:16:02 this stuff I have is like steelwool... 02:16:05 very very fine. 02:16:36 oh cool 02:23:09 03zwisk 07halrefactor-0-1 * 10emc2/src/hal/ (hal_lib.c hal_priv.h hal_procfs.c components/blocks.c): (log message trimmed) 02:23:09 [root hal]# insmod hal_lib.o 02:23:09 [root hal]# insmod blocks.o 02:23:09 [root hal]# echo "blocks mux2" > /proc/hal/create 02:23:09 [root hal]# cat /proc/hal/show_blocks 02:23:11 0: blocks mux2 02:23:13 [root@vader hal]# cat /proc/hal/show_components 02:36:00 hmm... stupid spring pin is 1mm too long on either ends... looks like I'm gonna have to get the dremel out and grind the spring pin just a tad. 02:52:17 dremel is my friend. :) 03:05:23 http://lloydleung.com/EMC/Worm_Spindle/ 03:05:52 thats cool 03:08:30 jmt, are you still about? 03:08:37 urr... jmk I mean... 03:08:38 yeah 03:08:51 was away for a while, just got back 03:09:00 I've either wrapped my brain in a knot or found somethin' interesting... (to me anyway...) 03:09:17 I should probably have it change cursors when mouseover... 03:09:18 comp_t corresponds to things that call hal_init, not to individual 'parts'. Is that right? 03:10:22 right 03:10:28 hmm.. ok. 03:10:57 I think we want to change it such that comp_t (or block_t or part_t) corresponds to the specific part.... 03:11:09 we'll need both 03:11:42 one for the module (or library, or collection, or whatever we call the thing that makes multiple part types available) 03:11:50 and another for the individual parts 03:11:55 ok. What's the limitations on shared memory? How much can we get, and what's a good policy? Does severy part get it's own block? Every 'library' ? 03:12:20 right now all HAL shmem data is in one big block of shmem 03:12:34 we really don't want to be getting lots of different blocks 03:12:45 the block size can be pretty big 03:12:45 hmm.. ok. cool. 03:13:00 at one time I thought there was a 64K limit, but I don't think that's actually true 03:13:26 (though you'll notice that HAL uses a block that is just under 64K) 03:13:42 ok... that all seems good... 03:14:03 the only thing in HAL that uses a separate shmem block is halscope 03:14:27 the RT part of halscope captures data and sticks it in a shmem block, the user space part reads that data and displays it 03:14:42 ok... 03:14:46 picnet has joined #emc 03:15:16 doing another cvs up right now 03:15:41 fargle 03:15:59 fargle? 03:16:13 "rcsmerge: warning: conflicts during merge " 03:16:23 doh.. 03:18:06 found it - remember I said I fixed the declarations in the middle of the code... you did two, and we didn't use exactly the same whitespace, etc 03:18:20 ahh... 03:18:28 just deleted my copy, and cvs up again to get the official one 03:41:01 yuck 03:41:24 looks like kmalloc allocates memory in binary chunks, the smallest is 32 bytes 03:42:04 I'm gonna be allocating lots of 14 byte structs, with 18 bytes of waste in each one 03:45:05 unless I use kernel lookaside caches.... 03:57:14 picnet has quit 04:31:54 32 bytes minimum?? Ugh.... Tjat 04:31:57 isn't good... 04:32:39 this old code I'm reformatting and updating actually used some even older code that implemented a primitive "slab cache" 04:32:50 although I didn't call it that at the time 04:33:07 but I don't know if I want to port that stuff over 04:33:16 for now I'll just let it waste memory 04:34:05 I wrote the old code back in the days when you had to deal with near and far pointers and all that fun segment stuff 04:35:06 hmm.. sounds mac-like ... Didn't the 68k do some bank switching or something? 04:35:17 this was X86 04:35:30 16 bit X86 that is 04:35:44 Turbo-C originally, later ported to watcom 04:35:59 ahh... ok... then my comparison point is the 65816 with a bank register... :) 04:36:11 near pointers were stored as 16 bit, and could only address 64K 04:36:29 same thing on the 65816 04:36:30 far pointers were stored as segment:offset (32 bits) and could address 1 Meg 04:36:43 and beyond 1Meg wasn't available 04:37:28 that's one part of the old days that I _don't_ miss at all! ;-) 04:37:45 hmm... the 65816 had a higher limit... I had 4megs in mine... 04:39:07 what system was that? mac or something? 04:39:38 apple //gs 04:39:46 wow 04:40:03 for some reason I thought you were a young feller 04:40:17 haha... so, that dates me? ;) 04:40:35 somewhat... I can't pin it down too tightly cause I don't know apples 04:40:47 but it had to be pre-1990, right? 04:41:01 yup... 04:41:16 I was tinkering on the apple ][ in '81... 04:41:27 first computer I ever programmed on was a TRS-80, circa 78-80 04:41:39 I still have one of those :) 04:41:53 first one I ever owned was a Kaypro2 (Z-80, 64K) in 84-85 04:41:56 It's in Illinois, and I'm in California now, but ... it's fun to look at. 04:42:08 I still have the kaypro 04:42:30 Hmm... we may be about the same age then? 04:42:33 42 04:42:49 or not :) 30... 04:42:51 (the answer to life, the universe and everything) 04:43:29 you were 7-8 when you started appleing? cool 04:43:58 yup. dad told me I couldn't play "little brick out" (like breakout) until after I learned to write code in basic. 04:44:06 lol 04:44:28 I wanted to program... my parents didn't know anything bout puters 04:45:11 dad taught at an elementary school and was able to bring a computer home one summer; that's how I got my start. 04:45:17 cool 04:45:46 yeah, I was already in HS before I laid hands on a computer 04:45:55 got the Kaypro after graduating college 04:46:06 learned C in college, on a PDP-11 04:46:54 The high school in dad's district had a pdp 11/44 that I played with when Igot the chance. Always in basic on that thing though. 04:51:02 oh boy... I'm makin' a mess out of your little hal... :) 04:51:47 gotta make it worse before you can make it better 04:52:02 glad you understand that! :) 04:52:10 that's the definition of refactoring... if you can just incrementally improve things, it's not a refactor 04:52:28 when you tear it down to the bare bones and rebuild it, that's a refactor 04:53:12 I hope you aren't writing too much code that traverses the linked lists... 04:53:43 my goal for tonight is to get the btree library cleaned up and tested 04:53:51 nope. not a lot. And most of that code ends up being a 2 line for statement that's easy enough to replace with the btree... 04:54:10 then I'll start moving those lists to kernel memory and accessing them with the tree stuff 04:54:31 I am moving a lot of stuff into the kernel though... 04:55:08 so then halcmd is broken (at least for now) 04:55:28 since it can't access the stuff you've moved 04:55:34 oh yeah... In my branch that I haven't checked in, I've disabled building the non-kernel stuff.. 04:55:48 ok 04:56:00 "branch that I haven't checked in"? 04:56:14 uh.. sorry. my bad. Sine my latest cvs commit ... 04:56:19 s/Sine/Since/ 04:56:20 ok 04:56:31 I want to avoid lots of uncommitted work 04:56:54 me too... but I always want things to at least compile when I check in. 04:57:12 good plan... and for those things that won 04:57:15 dammit 04:57:25 that won't, comment them out in the makefile 04:57:30 yup. 04:57:38 I always tend to hit enter instead of ' 04:57:44 I do that too. 04:57:50 it must be a keyboard design problem. 04:58:06 So, am I right to be thinking we want to minimize what goes in shared memory? 04:58:11 yes 04:58:41 take a look at hal_priv.h 04:58:55 AT the moment, it seems like only the signal's "data_ptr" needs to go in shared memory... 04:59:26 yes 04:59:34 Everything else seems to just point to it. If the kernel is always doing the configuring of where things point, it can be in kernel space... 04:59:48 for a pin, it would be data_ptr_addr _and_ dummysig 05:00:16 right... ok... 05:00:57 actually, even data_ptr would go in kernel memory, but data_ptr would point to a location in shmem 05:01:20 right... Is there a 'generic' way to deal with dummysig? 05:01:23 it's not settable, right? 05:01:45 Can 1 dummysig per type be created and shared across all things of that type? 05:01:49 nope 05:02:00 that would work for pins that are inputs to parts 05:02:14 but for pins that are outputs to parts, dummysig gets written on a regular basis 05:02:25 (if the pin isn't linked to a real signal) 05:02:33 Oh... so 1 for input and 1 for output ? 05:02:42 hmmmmm 05:02:46 didn't think about that 05:02:58 there are also bidirectional pins 05:02:59 the input would never be written, and the output would never be read... 05:03:27 and nothing prohibits a part from reading it's own outputs 05:04:11 hmm.. ok. Well, is a pin that's not hooked to anything 'floating' or is it guaranteed to keep the state it wrote? 05:04:39 for example, a counter "part" might do something like "(*output)++" to increment the counter (although it would be more robust to increment an internal value and copy it to *output 05:05:02 with the existing scheme, it will keep the state it wrote 05:05:33 I agree that getting rid of dummysig would be nice, cuts shmem usage in half 05:06:50 have to look closer at that... maybe for read only and write only pins we can use global dummysigs 05:06:55 yup. There is something a bit elegant about having it there too, though... I dunno... not a big deal either way I guess. Is dummysig always a long? Any thoughts of any sort of larger pin type? 05:07:05 read/write pins would still need individual dummysigs, but they are rare 05:07:27 so far all HAL types fit in 32 bits 05:08:14 because on X86 machines (and most other modern machines) a 32 bit value can be read or written atomically 05:08:47 I'd like to have double instead of float signals, but I'm not sure if doubles are read and written atomically 05:09:10 if they're not, it can cause the kind of rare and intermittent problems that drive you crazy 05:09:14 oh yeah... hmm... 05:11:58 Are your btree implementations generic such that you just put a "void *left; void *right;" at the top of a struct and it'll arrange them with some typecasting, or a macro or two? 05:12:29 here's the API in a nutshell: 05:12:40 bbtree *bbtree_create(int(*cmp_func)(void *data1, void *data2)); 05:13:15 creates a tree... cmp_func must compare data1 and data2 and return positive, 0, or negative (like strcmp) 05:13:24 void *bbtree_insert(bbtree *tree, void *data); 05:13:29 puts 'datqa 05:13:30 oops 05:13:37 puts 'data' into the tree 05:13:45 spiffy. 05:13:48 void *bbtree_delete(bbtree *tree, void *data); 05:13:58 removes an item matching 'data' from the tree 05:14:05 void *bbtree_find(bbtree *tree, void *data); 05:14:11 finds an item matching 'data' 05:14:19 void *bbtree_first(bbtree *tree); 05:14:24 finds first item 05:14:32 void *bbtree_next(bbtree *tree, void *data); 05:14:47 finds item that follows 'data' (even if 'data' itself isn't in the tree) 05:15:01 there is also last and prev counterparts to the last two 05:15:03 and finally 05:15:11 void bbtree_destroy(bbtree *tree); 05:15:24 I don't suppose their's any super slick way to get type casting somehow? 05:15:24 picnet has joined #emc 05:15:35 insert and delete functions automatically balance the tree if it gets unbalanced 05:15:52 not if you want to be generic at the same time 05:16:02 Very nice and complete sounding. 05:16:08 Yeah... generic and type casting... hmm. 05:16:13 we'll have one tree with comp_t structs, one with pin_t structs, etc 05:16:26 very cool. 05:16:36 we could have wrappers like find_pin(pin_t *pin) that call the generic ones 05:16:39 What do you think about putting the pin_t structs inside the comp_t structs? 05:16:53 one comp can have any number of pins 05:17:04 yup... 05:17:13 so how do you put em inside 05:17:40 uhh... I guess inside comp_t would be a "bbtree *pins;" 05:18:11 * jmkasunich looks at hal_priv again 05:19:01 hal_pin_t has a pointer to the component that owns the pin 05:19:18 I'm really digging your bbtree concept... I'm off and running about how useful that would be in a lot of places... 05:19:19 the hal_comp_t struct does _not_ have a pointer to the pin(s) it owns 05:19:31 cause there can be more than one 05:19:47 I'll be committing bbtree.h and bbtree.c sometime tonight 05:19:51 one pin can be owned by more than one hal_comp_t ? 05:19:55 nope 05:20:08 ok.. so it makes sense that the pins are inside the hal_comp_t. 05:20:18 each pin has only one owner, so a ptr to the owner is easy 05:20:20 ugh... we need to resolve our terminology too.. :) 05:20:31 but a comp can have many pins, so it can't point to all of them 05:20:47 Yes, but with your b-tree, no pointer is required if the 'component/part" owns it's pins. 05:21:03 currently the only way to find all of a comps pins is to traverse the list and look at the "owner" pointer 05:21:04 your b-tree is a collection of n objects. 05:21:34 * jmkasunich sees the light 05:21:36 (I think) 05:21:40 right... and I'm asserting that the way it is currently is backwards. You want to go from a component down to it's pins. 05:22:18 I had been thinking of using a btree _only_ to maintain the list of _all_ pins in the system (analogus to the "next_ptr" linked list now) 05:22:23 The only time you ever care about the pins and their relationship to parts (or 'libraries') is when connecting things up 05:22:56 but we could have one btree to do that, and another one listing only the pins that belong to a the component (one btree per comp) 05:23:20 I see using your btree generically for a list of all of the "modules", a list of all of the "objects/parts", a list of all the "signals", and a list of all of the pins for a specific part. 05:23:25 well the existing way is only half backwards... sometimes you want to go one way, sometimes the other way 05:24:08 true, but I'm changing the way things are named :) 05:24:27 yeah, I was planning to use it for multiple things, but I didn't think of having one btree per comp... that's a good idea 05:24:34 Instead of having fixed length strings, I'm allowing the system to enforce the hierarchy... 05:24:51 so, help me out... "comp" = library, or part? I keep flipping it back in forth in my head... 05:25:08 I'm using it in the present sense, where there is really no distinction 05:25:43 Today it's a library... I guess... A big library with an arbitrary number of legs (pins)! :) 05:25:51 we still don't know what we're gonna call them when talking with others, but for our own purposes, lets start using library and part, and drop comp 05:26:05 ok. I'm good with that. 05:26:07 library contains parts 05:26:14 parts contain pins and params 05:26:25 and functs 05:27:28 So... libraries register with hal. The libraries register their part types with hal. Hal instructs them to create parts. Parts create pins. Pins belong to parts. Parts belong to libraries. Signals belong to hal. Parameters are like pins; created by parts. functs belong to ... libraries?? 05:27:43 functs belong to parts 05:28:15 if you have an instance of an summer, there is a line of code somewhere like: 05:28:21 right.... functs belong to parts. Is that true? Can a part of the same type have different functions for the same think? Yeah... I guess so... ok.. 05:28:37 *(part->out) = *(part->in1) + *(part->in2); 05:28:44 gotta execute that at the proper time 05:28:52 that line of code is the funct for the summer 05:29:21 there can be more than one funct for one part 05:29:24 for instance, a parport 05:29:50 one funct reads the input bits, you would execute that near the beginning of the thread... the other funct writes the outputs, and would execute near the end of the thread 05:30:25 sure... But can part "parport1" and part "parport2" which are both parallel ports of the same type from the same module have different functions? 05:30:39 they will have different instances of the same function 05:30:59 calling parport.1.read will read port 1, parport.2.read will read port 2 05:31:14 same code, but it gets passed different args so it reads different ports 05:31:14 OK. If it's different instances, then the functions belong in the definition of the "part type" and belong to the library, not the individual part itself... 05:31:39 ummmm... I'm not sure I understand you 05:31:54 the "create" function is called for each instance, 05:31:59 and will export pins for that instance 05:32:10 it will also export a funct(s) for that instance 05:32:31 both pins and funct(s) will belong to the instance, not the library or parttype 05:33:09 yes... create is called for each instance. But the instance that is created doesn't need to have functions associated directly with it. It only needs to know that it's of type "summer" and a "summer" takes these 5 functions... the functions themselves are not different like the pins are. The pins are data, which are unique per part, but the functions are the same for any 2 parts of the same type. 05:33:33 the _code_ is the same 05:33:51 but suppose you have one summer adding two signals that are updated in the servo thread at 1mS 05:34:05 ok... 05:34:07 and another summer adding two signals that are updated every 10mS in the traj thread 05:34:18 and a third that adds the outputs of the other two 05:34:39 you need to execute the first and third ones in the 1mS thread 05:34:45 and the second one in the 10mS thread 05:34:48 sure... but now you're talking about threads, right? The threads need to work on a specific part, but they'll call the functions for the part's type, not the part itself. (We do need pictures.) 05:34:57 and you need to make sure the third one runs after the first one 05:35:25 yeah, we need pictures 05:35:29 yup. (Is the concept of a function and a thread bound into one unit in rtai? maybe that's the concept I'm abusing.) 05:35:48 a function is just a normal C function 05:36:19 ok... so the library will have code that implements the functions for each of iut 05:36:24 a HAL thread contains (and executes) any number of functions, in a user specified order, and at a specific repetition rate 05:36:25 doh... ' vs return ... 05:37:43 the library has functions for each type of part it knows how to create. When it registers it's ability to create those parts, it can register the functions that it has available for each type of part. When it creates a specific part (of a particular type) it need not associate functions directly with that part, as the system already knows the functions to use for that part type. 05:37:49 hal_parport.c:440 05:38:21 Threads need to be set up to call those functions for the specific part in the right order and with the right arguments, but that's seperate... 05:38:39 read_port (440) ... ok ... 05:38:50 that's the execution part of the HAL (functs & threads) where pins and signals are the data part 05:39:31 read_port is called with arg pointing to a parport_t struct that is unique to a specific instance 05:39:53 which results it it reading only _that_ parport 05:39:53 yes... 05:40:03 sure. 05:40:48 if you have two parports, then "show funct" will show two read functions, one for each port 05:40:54 but that *arg is standard. *Every* function takes an *arg* which is standardized across all hal, right? *arg is just the part structure that was created when hal told the library to create a part. 05:41:25 line 240 05:41:56 the third arg passed to export_funct is what is later passed to read_port as "arg" 05:41:57 yes, but we'll never say register "read_port_usb" to the object "pport" and register "read_port_serial" to "pport2" without pport and pport2 being different types. 05:42:47 hmmm. so you really do have functions bound to the instance. Hmmm.. 05:42:53 agreed, I think... the C function that is passed as the second arg of export_funct() will be the same for all instances of a part 05:43:01 but the third arg will be different 05:43:38 sure. But if a particular part has 10 functions, all 10 functions for that part will take the same argument as well,right? (They don't have to the way thing are, but I can't imagine them not all being the same.) 05:44:03 right 05:44:19 So all we have to keep for each part is the argument. 05:44:21 ultimately it's up to the writer of the module/library/part 05:44:33 Each part_type can have the list of functions to call with that argument. 05:44:58 look at the hal_funct_t struct in hal_priv.h 05:45:06 yeah... ok ... Your way uses more memory, but is more flexible. 05:45:39 ok... hal_funct_t 05:45:50 change owner_ptr right away to point to the part, not the library. 05:45:59 right 05:46:11 there is one of these for each instance of a function 05:46:22 an instance of a function is bound to an instance of a part 05:46:54 probalby the only fields needed on a per instance basis are: 05:46:56 owner 05:46:59 arg 05:47:03 funct 05:47:09 yes... It is now. But that's because the thread is also wrapped in hal_funct_t as well, right? (runtime and maxtime define thread attributes) 05:47:29 actually runtime and maxtime apply to this function instance only 05:47:47 waitaminnit 05:47:48 yes. absolutely. 05:47:53 I'm forgetting my own code 05:48:09 (I do that all the time... forget my code...) 05:48:21 the structure can be improved... 05:48:35 excellent thing to hear when doing a refactor! :) 05:48:55 one "feature" of the existing design is that a function can be called from more than one thread, or multiple times from the same thread 05:49:10 I know of no reason why somebody would actually want to do that 05:49:28 there may be some insane ordering situations where that could be beneficial. 05:49:35 I have my doubts 05:49:48 (me too, actually, but ... who are we?! :) ) 05:50:01 anyway... each call to export_funct() creates one funct_t struct 05:50:16 creating a thread creates one thread_t struct 05:50:43 when you do an "addf ", you create a funct_entry_t struct 05:51:09 ooh... hal_list_t funct_list can be your btree again.. 05:51:24 all functions in the thread are linked thru the links field of the funct_entry_t, and the funct_list field of the thread_t 05:51:49 meanwhile the funct_entry is linked back to the exported function thru the funct_ptr field of the funct_entry struct 05:52:05 there is also some reduncancy for speed reasons 05:52:21 when executing the thread, the code starts at thread_t->funct_list 05:52:32 traverses the list of funct_entry_t's 05:53:11 the code could execute *(list->funct_ptr->funct) 05:53:33 but list->funct_ptr is one of those annoying offset things 05:53:34 slow 05:53:43 so instead it does list->funct 05:54:11 right.. but with the kernel doing all that, it doesn't need to be in shared memory, right? 05:54:11 a funct_entry_t->funct is exactly the same as the corresponding funct_t->funct 05:54:36 right... so we make reduce funct_entry_t smaller 05:55:05 arg and funct can go away 05:55:16 and funct_ptr can become a real pointer instead of an offset 05:55:29 woohoo! 05:56:26 now that I think about it - NOTHING in the funct/thread API needs to be in shared memory (except possibly the performance monitoring stuff (runtime and maxtime) 05:56:42 woohoo again! 05:57:46 right now, runtime and maxtime are params, just like any other... I like that cause you can use halscope or halmeter to monitor them, but they will also clutter up listings 05:58:34 I wonder if they should be a different kind of object 05:58:51 we can worry about that later 06:00:13 I'm about to call it a night I think... 06:00:30 ok 06:00:38 isn't it only around 10pm there? 06:00:50 yup... but I got a hot tub with my name on it :) 06:00:58 and a girl in it? 06:01:14 (ANd while I do have a waterproof keyboard now, I haven't quite figured out how to get the monitor out there...) 06:01:32 well, yeah, probably a girl too... but tonight the girl is married, so ... no go there. :) Tomorow night may be more interesting :) 06:01:52 well enjoy... 06:02:19 tonight's probably the only night I'll get to stay up for the next few days 06:02:34 I'm gonna get this btree thing converted and hopefully tested tonight 06:02:38 ok... I'll look for the btree! :) 06:02:41 cool 06:02:49 question 06:03:02 back when I wrote it I called it BTREE 06:03:09 (used upper case alot then) 06:03:19 now I'm calling it bbtree (balanced binary) 06:03:26 should I drop one b? 06:04:00 I dunno... I'm horrible with names, and even self-referentially inconsistent! :) bbtree seems fine. Not likely to collide with anything someone else has written. 06:04:13 right 06:04:15 bb it is 06:05:30 g'night! 06:05:34 goodnight 06:06:33 night zwisk 06:06:43 or jmkasunich 06:06:49 ive been cleaning 06:06:55 you guys have been busy as well :) 06:07:11 yep, coding away 06:07:30 I wish I was on that level, in time :) 06:11:21 im pretty sure im 90% finished with the cleaning 06:19:15 gezr, what are you cleaning? 06:19:34 my whole shop 06:19:41 been tossing out ould stuff 06:19:51 moving stuff around 06:20:44 I made room on my shelves so I can more readly work with the bike 06:21:37 i have maybe 40lbs of stuff on a few chairs, and then some odds and ends to sort through 06:22:58 im going to rest the rest of the night I think, ill finish the rest of stuff I can do in the morning, and then I can start working with the head, gonna try my hand at lapping valves in 06:23:56 then I dont really have to much to do I dont guess, more blasting and assembly 06:26:42 sounds like fun 06:26:46 what kind of bike? 06:29:00 bmw k100 06:29:02 tbl has joined #emc 06:33:58 I only see a picture from 1985 model. 06:36:12 good, then you know what mine looks like :) 06:37:36 mine was an rt then after an accident it became an rs sorta, then after the fire and neglect it became a dust magnet 06:37:51 now its being reborn 06:39:00 im pretty sure its comming up on its 20th birthday 06:39:20 not exactly sure what month my dad purchased it in, 06:41:18 any of you guys watch adult swim on cartoon network? 07:03:34 ill catch you guys later 07:12:06 picnet has quit 07:16:03 picnet has joined #emc 07:47:39 tbl has quit 07:56:11 picnet has quit 08:40:44 jmk, how goes that bbtree code? :) 08:49:04 seems to be working 08:49:28 the balancing isn't as good as I expected (but still far better than an unbalanced list) 08:49:45 a list with 10000 items will be a maximum of 18 levels deep 08:50:10 which would happen only with a particular rather pathalogical insertion order 08:50:19 if perfectly balanced, it would be 12 levels deep 08:50:37 inserting the items in sorted order would give 13 levels 08:50:45 how do you mean balancing isn't as good as you expected? You are doing the rotations and... oy... it's been a while... red/back balanced trees? 08:50:58 inserting the items in sorted order into an unbalanced tree would give you a tree 10000 levels deep 08:51:25 it's beem a while for me too - I derived this stuff back in 1994 08:51:57 but yes, I'm doing "rotations" if that's what they're called 08:52:32 if the max depth on one side of a node is more than +/- 1 from the max depth on the other side of the node, re-organize things so they are the same 08:53:24 did you mean "red/black" balanced trees? 08:53:43 Yeah, I think I did... 08:53:48 but it may be avl tree's I'm thinking of... 08:53:50 http://www.cs.oberlin.edu/classes/dragn/labs/avl/avl5.html 08:55:11 well I'll be damned 08:55:21 those AVL trees are exactly what I did 08:55:44 but I never heard or read about them before... I derived it on my own in 1994 08:56:04 very nice! :) You've recreated a lab from... I dunno ... some undergraduate cs class? 08:56:11 probably 08:56:49 I wonder if my method is as efficient as theirs 08:56:55 Yeah, I think there's an optimal algorithm for 'rotating' left and right to get a balanced tree. 08:57:32 There's probably a good number of AVL implementations out there to check your against as well. 08:58:05 in other words, theres probably an implementation out there that I could have used instead of doing it from scratch 08:58:17 of course, in 1994 finding it was alot harder - no google 08:58:47 absolutely. 08:58:55 their algorithm is probably better than mine - they perform only one rotation per insertion or deletion 08:59:07 There was a "structures" book I had once that covered these extensively. I don't know who wrote it off hand. 08:59:15 I traverse the tree from top to bottom, and can potentially make a rotation at each level 08:59:34 don't know if it actually does more than rotation though 09:00:02 in theory, a properly balanced avl tree is (iirc) optimal. 09:01:09 a perfectly balanced tree is 1.00*log(n), an AVL tree is worst cast 1.44*log(n) (best case 1.0*log(n)) 09:01:16 same order, just the constant changes 09:01:50 ok... 09:03:01 I wonder if I should rename bbtrees to avltrees? 09:04:19 it's still balanced binary ;) 09:04:43 yep, but if the rest of the world calls 'em avl... 09:04:52 search and replace would make quick work of it 09:05:24 once I commit then the filenames are frozen - the contents could be changed, but it's awkward to rename a file in CVS 09:06:12 indeed. 09:06:18 I wish we were using subversion ;) 09:16:37 picnet has joined #emc 09:17:59 03jmkasunich 07halrefactor-0-1 * 10emc2/src/hal/ (avltree.c avltree.h Makefile): added an implementation of AVL balanced binary trees, to be used to manage object lists in the refactored HAL 09:21:42 on that note... I'm off to bed (4:30 here) 09:21:51 wow... 'gnight! 09:23:11 oops - one small mistake to fix first 09:31:15 03jmkasunich 07halrefactor-0-1 * 10emc2/src/hal/avltree.c: corrected an error in setting the tree depth, renamed some defined and enum symbols 09:31:23 goodnight' 09:31:26 jmkasunich has quit 10:25:17 Imperator_ has joined #emc 10:25:35 Imperator_ is now known as Imperator_away 10:42:46 picnet has quit 10:56:31 jf353 has joined #emc 11:17:19 picnet has joined #emc 11:39:50 alex_joni has joined #emc 11:40:14 * alex_joni waves 11:47:37 no one around? 11:48:01 here I am 11:48:22 picnet has quit 11:51:25 hello... don't think we've met before 11:53:04 yes 11:53:47 I'm from Romania, and I plan to use EMC for a plasma cutter (god knows when that's gonna happen) 11:54:21 I am from Germany and I am looking for a stable kernel/distribution 11:54:34 RT-enabled? 11:54:43 with RTAI 11:54:53 did you try the latest BDI ? 11:55:11 just reading: IRC-chat-2004-12-05.txt 11:55:16 no 11:56:44 well.. the BDI is the way to go if you want a fast install 11:56:47 with support ;) 11:57:11 other than that... you can choose your favorite distribution, patch a kernel, compile, install 11:57:20 and everything _should_ work... 11:57:33 but most of the time you run into smaller/greater problems 11:57:59 my EMC runs on SuSE 8.2 (2.4.21 & RTAI-3.0r4) 11:58:12 Thats interesting 11:58:40 because I use suse 11:59:24 maybe we can email: joachim.franek@pibf.de 12:00:02 alex.joni@robcon.ro 12:00:13 you can write in german if that suits your need better 12:00:15 ;-) 12:01:00 thanks very much 12:01:50 * alex_joni remembers the whole fuss it was to get EMC going the first time... 12:02:04 but once you did it... it's getting easier each time 12:02:55 jf353 away from keybord for a break 12:07:44 * alex_joni 'll be back later 12:07:47 alex_joni has left #emc 12:56:21 jf353 has left #emc 13:01:48 jf353 has joined #emc 13:17:52 picnet has joined #emc 14:02:44 slomo has joined #emc 14:02:48 slomo has quit 14:19:00 picnet has quit 14:43:39 alex_joni has joined #emc 14:44:05 alex_joni has quit 14:44:09 alex_joni has joined #emc 14:51:20 acemi has joined #emc 14:56:14 jf353: say when around... 14:57:35 Hello 14:59:10 I just wanted to respond to your mail.. but it's easier like this 14:59:15 with feedback ;) 14:59:51 I'm sorry but I can't seem to find the documentation I wrote to document the whole process.. but I'll tell you what I remember 15:00:05 Yes that would be nice 15:00:20 ok... so, what SuSE do you have installed? 15:01:00 different: suse82 on my server, other pc's with 9.0 and 9.2 15:01:21 * alex_joni knows 8.2, didn't try 9.x yet 15:01:36 on 8.2 there is 2.4.21 (or 20) don't remember exactly 15:01:37 suse82 is ok for me 15:01:56 9.2 should have 2.6... I think 15:02:09 anyways.. you could install any kernel on any of those 15:02:30 but _might_ get into trouble if modutils or other kernel-utilities are incompatible 15:02:50 2.6 and 2.4 have different type modules and loading options.. 15:03:09 my advise: download the same kernel your SuSE is running (same version) 15:03:15 I do not need really a a 2.6 kernel, but something stable! 15:03:23 make sure you download it from www.kernel.org 15:03:31 not the SuSE kernel included on the CD's 15:04:19 yes I know, on 9.0 the scheduler is exchanged and the rtai patches dont not fit 15:04:20 the main reason for that is that the kernel on the CD includes some patches by SuSE, and you'll get in trouble later when patching with RTAI 15:04:30 yes 15:05:01 you would want to get the same version (or similar) in order to use the SuSE config file for the kernel (if you don't want to manually configure all your kernel) 15:05:18 although that would be a somehow better solution... 15:05:33 Do you remember some of the difficulties with suse80? 15:05:42 8.2 is what I have 15:05:48 some I remember: 15:06:20 the main problem I had was to figure out how to make the initrd image (had never done that before) 15:06:43 that image is used to contain some kernel modules that need to be loaded before the complete boot 15:06:58 one driver I had to include there was the reiserFS module 15:07:27 if I didn't put it in the ramdisk the kernel could not mount the HDD, and the booting stopped... 15:07:50 but I figured that out after a while... 15:08:08 another solution is to build reiserFS support into the kernel (not module) 15:08:25 but this more or less depends on your hardware, and what you need... 15:09:00 hello 15:09:00 I use reiserfs with good experiences. 15:09:32 I agree, I also like reiserfs 15:09:45 but you need to make sure that the kernel can access your harddisk 15:09:56 hm, redefining your pinouts should work as supposed to in the config.. right? 15:10:38 if you build reiserfs as a module (located in /lib/modules/.../reiser.o) the kernel needs to read it from there 15:10:58 in order to read it, the kernel has to have some reiserFS capabilities.. right? 15:11:12 yes 15:11:17 so you either include the reiserfs on an ramdisk (initrd), or compile it into the kernel 15:11:29 anonimasu: what do you mean? 15:11:51 about the pinouts? 15:11:54 alex_joni: I didn STEP_INDEX=1 in my config file, but it seems that emc wont use that pin for step.. 15:12:04 emc1 ? 15:12:10 the one on the bdi cd.. 15:12:26 most likely emc1 15:12:27 bdi-4.08 ? 15:12:49 I mean this last BDI? 15:12:49 yeahyes 15:12:52 yes 15:12:58 downloaded it yesterday 15:13:01 oh.. ok... don't really know 15:13:04 :/ 15:13:09 * alex_joni didn't get a chance to try it out 15:13:27 I know that paul_c added support for the pin configuration from the INI-file 15:13:33 but I haven't seen the code so far 15:13:36 :( 15:13:36 rayh has joined #emc 15:13:40 hi ray 15:13:54 they are in the emc.ini atleasy.. however it dosent seem like it works... 15:14:05 I think they should work 15:15:11 hm, I'll be back in a bit going to mess some more with it.. 15:15:24 I'll look over it while you're gone 15:15:31 any luck with the feedback? 15:16:48 I still havent got the machine running due to this :/ so I havent had any chance to look at it while cutting 15:18:26 picnet has joined #emc 15:19:02 ahh.. ok ;) 15:21:33 Hi Alex. Sorry phone interuption. 15:25:38 Have we started conversations yet? 15:33:05 hm.. still wont work.. 15:33:36 I'll be further away from testing it out then, since I need to order new connectord and make another cable.. 15:36:07 rayh: did you try pin asignment from emc.ini ? 15:37:07 not much discussion yet... 15:39:47 I haven't tried it yet. 15:40:15 I've not compiled in a couple weeks. Is it in 4.08? 15:42:42 I think so, it's not in the emc1 CVS 15:43:48 it is in emc2 CVS, under pc_2_6_test (I think) 15:43:55 because it's an libnml based emc1 ;) 15:44:49 nope ... can't seem to see it there either .. anyways 15:45:16 I didn't see any references to it in the ini's in 4.08. 15:46:56 anonimasu said something about STEP_INDEX=1 15:48:09 * alex_joni has seen a lot of work from zwisk and jmk 15:48:14 on the HAL-refactor 15:48:19 Would this be in each axis definition. 15:48:25 don't know 15:48:37 * alex_joni defers the question to anonimasu 15:49:39 I talked a little to jf353 15:49:54 he's a german user, interested in patching a SuSE for realtime... 15:50:14 Certainly that should be possible. 15:50:22 * alex_joni has done it a few times ;) 15:50:33 but there are some small issues on the way... 15:50:39 The newer SuSE uses the 2.6 kernel. 15:50:52 didn't touch 2.6 yet 15:51:35 but it seems it becomes more and more neccessary ;) 15:54:52 * alex_joni thinks about IO-control for EMC2 15:56:35 I think that's a part that's still missing in EMC2 15:56:40 Something like classicladder? 15:58:13 I'm just looking into it 15:58:36 on emc1 there's minimill and bridgeport 15:58:53 was this left out in order to build in a PLC-controller? 16:00:04 The first PLC was written in C for a test. 16:00:19 It was never generalized. 16:00:45 So when Matt needed to run a bridgeport, they wrote bridgeport io. 16:01:01 yes 16:01:04 it's for each axis.. 16:01:08 I see... so what would be the way to go? 16:01:18 The minimill to fit the little mill they had at NIST. 16:01:33 We need a general io program system. 16:01:53 I thought classicladder could do a lot of it, 16:02:10 I defined step and dir for each axis, as done in emc.ini 16:02:28 I even tried using emc.ini and just changing the pins.. to match mine.. 16:03:57 alex_joni: if that's missing from emc2 I am running emc1 16:04:02 rayh: I agree on the long term 16:04:13 anonimasu: the stuff in BDI-4.08 is emc1 16:04:32 and I can see the emc.ini containing that parts you say 16:04:43 what pins did you use? 16:04:45 rayh: I hacked bridgeportio for my machine to allow you to select an emulated IO pin or actual parport IO pin for each bit in the ini 16:05:09 rayh: but for startes a minimill connected to hal would be ok 16:05:20 even bridgeport connected to hal 16:05:29 rayh: my machine has estop and spindle-forward as actual bits (above the step/dir outputs) but emulated bits for everything else 16:05:50 and the stuff you don't use (the user does not use) simply don't get connected, or get connected to default values 16:06:00 cradek: Matt and I did a similar thing for Smithy. 16:06:30 rayh: I can't decide whether I should check it in. 16:07:08 it's very simple. bits -n..-1 are emulated, bits 0..n are the parport 16:07:42 * rayh needs to work on food for a bit. Back in a few. 16:07:59 alex_joni: dont have the paper here right now 16:08:12 but it's the same pins i've been running when I ran turbocnc.. 16:08:36 wait.. 16:09:04 2 & 8 and 7 & 5 and 3 & 6 16:09:06 cradek: what does bridgeportio do besides setting a few pins on/off ? 16:09:21 anon: make sure those aren't used elsewhere 16:09:55 one single problem 16:09:57 alex_joni: they arent used elsewhere.. and still changing the values in the config should make a difference.. 16:09:59 looking at emc.ini 16:10:01 .) 16:10:06 for X there are used 0&1 16:10:20 that means D0 & D1 (pin 2 & 3 on the parport) 16:10:41 so you'll need 0 & 6 (for pin 2 & 8) 16:11:08 ah that might be the problem then 16:11:14 0&6, 5&3, 1&4 16:11:42 I need to run, going to look at it when I get back.. 16:11:44 thanks :) 16:12:32 you're welcome 16:12:38 cradek: around? 16:19:45 I'll be testing it as soon as I get back :) 16:22:12 cradek: when you'll be back, maybe we can talk about it... 16:26:22 robin_sz has joined #emc 16:26:36 meep? 16:26:38 meep? 16:26:43 :) 16:26:45 * alex_joni was faster 16:26:45 :D 16:26:52 hi robin 16:27:21 morning yall 16:27:46 hi 16:30:24 what's up robin? 16:34:05 alex_joni: I'm back now 16:34:20 got time/nerve to talk about IO control? 16:34:34 you're assuming I know something about it 16:34:41 I have a little time 16:34:49 well.. I don't know much myself 16:35:02 but I don't think it can be too tough 16:35:12 I don't think it is 16:35:55 anyways... I was wondering if I started (and I just did) to make a miniIoControl 16:36:04 which only exports some HAL-pins 16:36:13 and sets those accordingly to NML-messages 16:36:20 I think that would be enough to be used 16:36:38 sounds like 16:36:45 for IO to be 'adaptable' ... 16:37:10 you need to be able to assign an arbitary command to a IO pin 16:37:18 can you link a HAL pin to a C variable? 16:37:23 (via some intermediate hal logic) 16:37:37 you have a function which sets the pin 16:37:49 and that function read the variable and sets the value 16:37:58 s/read/reads/ 16:38:13 sounds pretty simple 16:38:30 it should be 16:38:31 almost ... but we;re screwed by the nml messages 16:38:40 why is that robin? 16:38:44 because ... 16:38:49 they're fixed 16:39:19 if I want to add a new message ... how can I, *without* recompiling emc and a weeks worth of hacking? 16:39:33 but the g-code is fixed too 16:39:40 we're only as screwed by NML as we are by g-code 16:39:53 NML is the core problem, 16:40:00 what message would you wanna add? 16:40:08 spindle wibble 16:40:19 and a GUI button for it? 16:40:34 possibly, and a Gcode to drive it 16:40:46 seems you still have to hack a few places 16:40:47 and you want to do that without hacking and recompiling? 16:40:53 lots of places 16:40:58 Interpreter, GUI, NML, etc 16:41:01 cradek: absolutely 16:41:14 sorry, but I don't think that's reasonable 16:41:23 robin: too good to be ever true ;) 16:41:33 oh, I'll stick with mach2 then 16:41:37 * alex_joni favors executable GUIs 16:41:51 and you need to recompile those when you add a button 16:42:12 so ... how come others manage it then? 16:42:32 don't know ;) 16:42:42 but.. how often do you do that? 16:43:02 lets try "everytime you install a new machine" 16:43:02 does it really pay off to reimplement the way of things, only to make it more flexible 16:43:12 and then use it once or twice? 16:43:28 once or twice? 16:43:30 not that sure robin, that every machine needs custom buttons 16:43:48 ok, perhaps Im unlucky in all of mine needing that 16:43:57 mine do 16:44:01 can you give me some examples? 16:44:16 every comercial machine ive been involved with has had a customization added 16:44:21 perhaps we should rename it to "enhanced bridgeport look-alike controller" :? 16:44:46 robin_sz : what are you talking about? 16:44:59 alex_joni: sure,. plasma on, torch up, torch tip touch? any more 16:45:15 alex_joni: and what about if I want to cnc a press brake? 16:45:20 plasma on you can do with G43 (if I remember it right) 16:45:27 alex_joni: does emc have ANY signals for that? no. 16:45:29 robin_sz : I get it, yeah your right 16:45:39 I agree on the CNC brake... 16:45:49 so ... 16:45:50 but only because I don't know what signals are needed there 16:45:51 :D 16:45:55 so ... 16:46:01 so... ;) 16:46:11 have a file that links integers to IO functions 16:46:24 01 spindleOn 16:46:31 02 spindleOff 16:46:33 integers as in G-variables? 16:46:40 03 coolantOn 16:46:43 robin_sz, there are m-codes for those. 16:47:02 A-L-P-H-A: no there iarent 16:47:03 m-codes are machine codes defined by the manufacture 16:47:17 oh. 16:47:25 they tend to always be the same but do not have to follow any particular standard 16:47:28 well... there are m-codes in turbocnc that does all those... 16:47:37 A-L-P-H-A: probably 16:47:47 spindle-on-CCW, spindle-on-CW, coolant A, coolantB, coolantsOFF 16:47:52 spindle off. 16:48:01 emc has those too, of course 16:48:04 no use to me at all on a am,chine without a spindle 16:48:20 cradek, if there are, then why is robin_sz tellming there isn't? 16:48:23 cradek: does it have laserGasReflowControlHigh? 16:48:34 A-L-P-H-A: no idea. 16:48:43 cradek: does it have laserGasReflowControlLow 16:48:46 robin_sz : does mach5? 16:48:50 robin_sz: what use to me is that on my mill? 16:49:03 i dont know much about mach5 16:49:08 robin_sz: is it necessary to have this argument before alex_joni works on spindle-forward and estop in emc2? 16:49:10 cradek: sorrry, is this thing a mill controller or a generic CNC? 16:49:17 cradek: robin talks about a way to be able to add those simply 16:49:20 surely we all agree estop is useful and it would be nice if it worked. 16:49:31 and, there should be a framework for digital IO 16:49:37 in case one of you wants to work on extending it. 16:49:38 cradek: I'll limit myself to estop for now... 16:49:43 how about that? 16:49:43 :D 16:49:46 * A-L-P-H-A is it just me... or does some members of this conversation seem very passionate about the debate. 16:49:55 robin_sz : what your talking about is a "base" that a face could be put on top pending configuration 16:49:58 passionate is good 16:50:09 A-L-P-H-A 16:50:10 oops 16:50:19 A-L-P-H-A : to some emc puts food on the table 16:50:23 what is needed is to link a button to a message 16:50:46 robin: what if you'd have say 20 unused messages 16:50:51 gezr. true. I've got no issue with EMC. just that I haven't used it to my machine yet. 16:50:52 build already into emc 16:50:57 all going to HAL 16:51:06 and you simply link a button to usermsg01 16:51:08 why twenty? 16:51:21 and usrmsg01 to a HAL->parport.0.15 16:51:22 why not 255 and by defualt none of them assigned to anyting? 16:51:24 turbocnc CNC still does all that I need... and probably could for all intended purposes. 16:51:31 20 as an example 16:51:32 all future 16:51:35 255 also ok 16:51:46 255 NML messages (not used by default) 16:51:46 soemwhere you have a spec file ... 16:51:52 robin_sz : so whats needed then is a fully generic startup, that when the thing is first ran, all parameters of the machine are set up via a fancy graphics, and the machine is then set at that point right? 16:51:57 though learning and using EMC would be just fun. 16:52:02 allocates message names to a integer say 16:52:13 besides those that are used normaly (estop, spindel, coolant, lube, etc) 16:52:26 gezr, did you said you don't have a CNC machine _yet_? [meaning you are retrofitting one soon?] 16:52:39 A-L-P-H-A : im going to build one from scratch 16:52:40 alex_joni: spindle coolant and lube? surely not .. thsoe are rarely used 16:52:50 why make special cases? 16:53:03 well.. maybe some special cases would be usefull 16:53:08 why? 16:53:09 say: special case=mill 16:53:17 why have two ways of implemtning stuff? 16:53:22 it makes programming harder 16:53:26 gezr, cool... a CNC mill? overhead gantry type? or with the part moving or with the head? 16:53:43 A-L-P-H-A : multi axis mill 16:53:50 flying head 16:53:56 implement some way of linking a button an gcode or m code to a signal 16:53:57 flying table 16:54:12 implenent a way of linkign that (via logic) to a IO pin 16:54:23 gcodes are a fixed standard robin_sz 16:54:25 well.. once you have a signal HAL does the rest 16:54:34 gezr: yes and no ;) 16:54:39 then implement you spindle, lube, coolant etc etc etc using that framework 16:54:39 yes as in RS274 16:54:45 no as in a LOT of dialects 16:54:52 how are you gonna designing the 5th axis? the tiling head? 16:55:06 M_codes could be usefull 16:55:16 A-L-P-H-A : it probably wont have the 5th 16:55:18 this is the way ALL commercial controlers work 16:55:27 say M_01 - M_255 linked to NML_01 - NML_255 16:55:47 gezr, oh, so XYZ, and a rotary axis for the part? 16:55:48 jmkasunich has joined #emc 16:55:51 and NML_01 - NML_255 output iocontrol.0.1 - iocontrol.0.255 16:55:52 why not have a table : 16:55:56 A-L-P-H-A yeah 16:55:59 jmk: just the man was missing 16:56:10 I was up late last night 16:56:12 we are in heavy debate over IO control 16:56:13 rotary axis probably being a rotary table mounted vertically. 16:56:16 ? 16:56:22 seen that, and I really applaude the rework ;) 16:56:31 A-L-P-H-A : horizontally 16:56:34 a table to link varouis Mcodes to signal names 16:56:36 wait yeah vertically 16:56:36 I am thinking about some basic IO-control in EMC2 16:56:42 signal names are then linked to logic 16:56:43 it's gonna get ugly before it gets better 16:56:44 but it seems it got out of hand ;) 16:56:46 logioc to pins 16:56:52 but ALL that is configurabe 16:57:07 gezr, horizontally? why? are you intenting to make more circles, which the CNC machine could do already? 16:57:30 think we need to split up the discussions.. I'm not really following anymore ;) 16:57:37 I _need_ lunch... 16:57:41 alex_joni: I maintain that while the core of emc is full of switch statemnts based on indivdual message, were screwed 16:57:42 I should have started my logger last night so I could catch up 16:57:44 I'll be back after I hit the pizzeria. 16:58:02 ok A-L-P-H-A 16:58:08 robin_sz: maybe so, but it'll take a better man than me to fix that 16:58:18 jmk: shortly what has been discussed 16:58:35 I wanted to make IO work in emc2 16:58:48 good plan 16:58:53 so I thought an easy way would be to add some HAL pins to a minimillio 16:58:58 jmkasunich: sigh, yeah, me too .. I did try and start a long time ago, but gave up because it was too much for one man, and no one else seemed to be wanting to go in that direction 16:59:01 or even bridgeport.. 16:59:02 yep 16:59:12 I hope this is the way to go 16:59:24 but 16:59:30 there are a few issues 16:59:39 1. everything is pretty fixed in EMC 16:59:55 you need to change a lot of places (hardcode) in order to add/change signals 17:00:01 right now the emc2 io controller is simioControl.cc, I think 17:00:14 say you need some special signals for Plasma (or laser) 17:00:21 jmk: yes, only sim, and no output 17:00:24 jmkasunich: I just rememerb the mess I got into trying to add the plasma stuff using existing signals and trying to rememerb that spindle on is plasma start, coolant on is the arc_is_on signal back etc etc 17:00:42 robin_sz: ick 17:00:47 quite 17:00:53 so robin suggest a way to have it modular 17:01:07 what id like is to assing M06 => "plasmaOn" 17:01:18 have a gui button I attach text to "plasmaOn" 17:01:20 something like HAL (in a far way...) to link G/M-codes to functions/NML_messages 17:01:34 and the NML_message to a HAL_pin (from the IO controller) 17:01:38 and then send either the string or a integer lookup of "plasmaOn" into emc core ... 17:01:39 that would be done in the interp, right? 17:01:52 and the HAL_pin later to a hardware pin (either parport or whatever) 17:02:04 jmk: yes and no 17:02:06 if someting understands that, then "stuff happens" .. if nothing uderstands then it just drifts through and drops into the bit bucket 17:02:18 you need code in the interp, and in the IOcontoller 17:02:39 interp reads M code, and sends NML message 17:02:44 HAL answers a big part of that problem already 17:03:00 IO controller gets NML message and sets a HAL pin 17:03:05 the quick fix (but very ugly) would be to add 255 (or any number) custom messages to NML 17:03:14 jmk: yes 17:03:24 alex_joni: I suspect EMC has had enough "quick fixes" applied already :) 17:03:34 robin: I agree... 17:03:43 today, I think the interp already understands some M codes, and sends some specific NML messages 17:03:44 alex_joni: what we need is architecture :) 17:03:46 but I don't think you could do it better without a NML rework 17:03:53 you are talking about making it more generic? 17:03:56 I agree 17:03:58 robin is 17:04:11 why does each custom function need its own message? 17:04:18 quite 17:04:25 good question cradek 17:04:38 cause that's how NML works... the C++ idea of methods 17:04:38 how about an M-code message 17:04:50 that tells the IO-controller M-code x was called 17:04:59 alex_joni: that's the ticket 17:05:00 and the IO-controller knows what to do 17:05:05 configurable 17:05:06 suddenly there's no C++ mess to write 17:05:21 I'd be able to live with that 17:05:23 alex_joni: how about a NML_IO_message 17:05:25 well you just move some of the mess from the interp to the iocontroller 17:05:27 there's just the M-handler 17:05:28 cradek: well spotted 17:05:38 sounds great 17:05:50 jmkasunich: I think it would simplify both 17:05:55 I do have some specific questions for jmk, before I start to code 17:06:04 I dotn think there would be a mess 17:06:07 I don't think you want to generic-ize the ones that are already there 17:06:19 I'd leave those as they are 17:06:27 don't think a double message would hurt 17:06:47 so use M over 100 for custom or something 17:06:48 cause some might have preconditions, postconditions, all that other stuff that task handles 17:06:54 say M1 comes (don't really know what M1 is, but assuming it's NML_SPINDLE_FORWARD) 17:07:12 jmkasunich: why not genericize them all? what do you see as the advantage in having two ways to implemnent a lot of things 17:07:21 * robin_sz must go soon 17:07:23 g-codes must remain the same, but an m-code .ini type file would basically define the machine type, mplasma.ini mlathe.ini mmill.ini 17:07:29 say M1 is spindle forward 17:07:35 it would be nice to maintain NML compatibility for the old messages 17:07:44 if all you want it to do is turn on a single bit, thats no prob 17:07:55 why? the old ,messages are for EMC1 surely? 17:08:02 but suppose the motion controller needs to pause until the spindle is up to speed 17:08:14 then thats a HAL task right? 17:08:18 isn't there already code that handles that? 17:08:23 thats a g-code function jmkasunich 17:08:32 you sure gezr? 17:08:34 jmkasunich: there is a hard-coded pause between brake-off and spindle-forward 17:08:41 jmkasunich: it's specified in the ini file 17:08:46 alex_joni : acording to what i know about g-codes 17:08:53 coded where? in the io controller, or in task, or in the interp? 17:08:54 jmkasunich: I don't think there's a built-in pause AFTER spindle-forward 17:09:11 cradek: you wanna know how much trouble that caused when I used the various brake and spindle message to try and control a plasma? 17:09:16 don't know, I haven't looked for it 17:09:19 my point is that there is "stuff" other than just turning on a HAL bit 17:09:21 robin_sz: no 17:09:32 I got into a REAL mess 17:09:33 ok.. let's settle 17:09:45 for a turn-bi-on/off it's easy 17:09:46 right? 17:09:50 just set a bit 17:09:53 to HAL 17:09:58 ended up adding my own messages, which meant I was stuck with my version of emc, no upgrades 17:10:00 and ack the NML 17:10:02 * robin_sz shuts up 17:10:18 alex_joni: yes, sounds like 17:10:30 I'd start with simioControl 17:10:49 the skeleton is there, just modify it so it tweaks some HAL pins 17:10:52 I just want to add estop first to simioControl 17:11:01 and we'll see after that 17:11:05 right - add an estop pin 17:11:10 but the debate is right... 17:11:16 it should get discussed 17:11:25 one quick question: 17:11:26 emc should be fully configurable 17:11:29 did you see my "FIXME FIXME FIXME", I think its in emctaskmain? 17:11:41 I've never played with HAL in non-rt mode 17:11:44 robin_sz has left #emc 17:11:49 does it work the same? 17:11:55 pretty much 17:12:01 no functs or threads tho 17:12:04 register pin & such? 17:12:07 yes 17:12:12 ok.. 17:12:20 then it should be pretty simple 17:12:38 you can take a look at the parport driver (or Martin's skeleton driver, I think) 17:12:39 so you can then link a signal from a non-rt HAL pin to a rt HAL-pin 17:12:48 it can be built for user or RT 17:12:51 * alex_joni kinda remembers 17:12:52 ;) 17:13:01 damn it;s hard to type with a cat on the keyboard 17:13:17 jmkasunich: use a sunbeam to lure the cat away 17:13:19 it's ok.. I have a cat-filter 17:13:50 cradek: I'm in cleveland and it's between november and may - we don't have sunbeams 17:13:53 that filters out unusual keystrokes 17:14:10 jmkasunich: surprisingly I have one today, which has immobilized my cat. 17:14:21 she's not stepping on the keys, just standing between me and the keys/screen 17:14:39 jmk: no FIXME in simIoControl.. ;) 17:14:40 I'm not a true touch typist - need to be able to at least glance at the keys 17:15:03 I'm off to "breakfast" (that's what you call the first meal of the day, right?) 17:15:13 cradek: I call mine lunch 17:15:24 because it's usually around 12 am ;) 17:15:27 emctaskmain line 2607 17:15:34 I call this, Pizza. :) yummmy. 17:16:00 12am is midnight 17:16:10 jmk: I would have looked for that ;) 17:16:20 but thanks for pointing it out 17:17:01 you saved me some debugging 17:18:28 what's iotaskintf.cc ? 17:19:18 damned if I know ;-) 17:19:50 I think it's the NML to IO-controller interface 17:20:07 then what is simioControl.cc? 17:20:37 same thing.. but simulated 17:20:50 the iotaksintf.cc is just some framework? 17:21:02 not connected to an actual io-control task 17:21:49 simioControl is the big honkin switch statement that decides what to do with a message 17:22:00 hmmm... milltaks is built from iotaskinf.cc 17:22:04 milltask 17:22:14 iotaskintf is a bunch of little functions that actually do stuff (I think) 17:22:44 waitaminnit - I think I've got it ;-) 17:23:07 iotaskintf is a bunch of functions that are called by task to SEND the NML messages 17:23:20 simiocontrol is the one that gets the messages 17:24:03 yeah.. sound likely 17:24:32 sounds 17:25:57 * alex_joni starts adding HAL-pins to miniIoControl.cc 17:26:35 miniIoControl.cc? 17:26:50 where'd that come from, copied over from emc1? 17:26:56 nope 17:27:03 that's the one I'm writing 17:27:09 copied from simIoCOntrol.cc 17:27:19 do we really need a mini and a bridgeport io? 17:27:22 think a different name would be more explicit? 17:27:37 ioControl.cc ? 17:27:39 I'm hoping that we can have just one (or at least just one for all mills, another for lathes) 17:27:57 it can export a whole bunch of pins, if you need the mini version, just don't hook them up 17:28:08 I agree 17:28:18 then without the mini 17:28:22 ioControl.cc 17:28:28 IoControl.cc ? 17:28:33 sure 17:28:43 io or Io 17:29:01 * alex_joni chooses io 17:29:16 oh hell, I dunno... I'm not to fond of mixed case in names 17:29:39 maKes me fEEl like some wAreZ d00D 17:29:58 lOl 17:33:58 jmk: can you give me a crash-course what I need to do? 17:34:34 I'm not sure about the shared-memory 17:35:06 lemme take a look at simiocontrol.cc 17:36:18 probably want to define a struct that contains hal_bit pointers for each HAL pin you intend to have 17:37:32 you'll need a funct that does init on the hal side and one for cleanup 17:37:57 call the init one from somewhere around simiocontrol.253 17:38:29 and the exit one from about line 509 17:38:32 ok.. thx 17:38:46 the init one needs to call hal_init("iocontrol"), 17:38:56 yup 17:39:09 then hal_malloc(sizeof(the_struct_with_all_the_pins) 17:39:17 then do all the pin export calls 17:40:22 once the init is done, and you get into the while loop at line 267, each case needs to modify whatever pins are appropriate 17:43:18 time for lunch 17:43:22 jmkasunich is now known as jmk_away 17:43:24 enjoy 18:15:44 anyone still around? 18:21:04 http://slashdot.org/article.pl?sid=05/01/14/1815251&tid=222&tid=149 _ and _ http://www.makezine.com/ I think alot of thepeople in here would be interested in this magazine/book subscription. 18:24:17 picnet has quit 18:27:23 I'm not around, I'm a square 18:27:45 lol 18:28:00 * alex_joni wonders if anybody tried to use HAL with c++ 18:29:46 rayh has quit 18:34:52 A-L-P-H-A: pretty expensive ;) 18:38:03 jmk_away is now known as jmkasunich 18:38:11 hello back ;) 18:38:20 me had a small problem but fixed it 18:38:27 I had to link hal to the .cc 18:38:47 never thought about that 18:38:48 and the linker didn't see the functions because of a missing extern "C" ;) 18:38:58 I added that to hal.h 18:39:02 cool 18:39:07 #ifdef __cplusplus 18:39:13 extern "C" { 18:39:15 #endif 18:39:38 but it didn't work ;) (because I forgot to cp hal.h to emc2/include :D) 18:39:45 silly me.. :-)) 18:39:58 ? you shouldn't have to, the make should do that 18:41:00 not the make inside src/emc/iotask/ 18:41:15 oh 18:41:30 I tend to always work from the top level emc2 dir, and use the make there 18:42:30 should I commit? 18:42:34 when it's done? 18:42:34 sure 18:44:11 alex_joni, yeah... but you're paying for content... it's a quarterly publication that's a small book... not just a mag... 18:47:14 jmk: to actually write to the HAL pin, I only need to change the value of iocontrol_data_array->estop_pin .. right? 18:47:45 where iocontrol_data_array = (iocontrol_t *)hal_malloc (size_of(iocontrol_t)); 18:48:31 pretty much 18:49:01 if it's a pin, you do "*(iocontrol_data_array->estop_pin) = newvalue;" 18:49:14 cause pins are actually pointers to the linked signal 18:49:48 if it's a param you skip the *... "iocontrol_data_array->some_param = newvalue;" 18:53:51 seems some bits are still missing 18:54:00 for example the aux-channels 18:54:05 what's missing 18:54:17 aux-command and aux-status 18:54:30 I'm afraid I don't know anything about them 18:54:51 well.. it's not that complicated 18:55:08 there are 5 things involved in IO-control 18:55:20 tool (is implemented in simIoControl) 18:55:21 lube 18:55:28 spin 18:55:33 cool 18:55:34 cool 18:55:36 and aux 18:55:41 aux handles estop 18:55:54 ok... I was looking at emc1, and saw bridgeportcool, etc 18:56:11 didn't understand the connection, or why simiocontrol only had one file 18:57:14 well because simiocontrol only takes care of tool right now 18:59:54 although the NML types are all defined in the main loop 19:00:18 but the feedback channel for ESTOP I don't seem to find 19:02:43 feedback channel? 19:04:31 yes.. a channel to send ESTOP is on to EMC 19:04:42 but I'll figure that out in a second 19:04:45 anyways... 19:04:56 I was thinking about one thing I wanted to discuss with you 19:05:00 involving HAL 19:05:06 ok 19:05:15 I think there are components which can't have floating pins 19:05:21 like in hardware 19:05:34 you need to tie those pins to a certain value 19:05:40 like tie them to 1 or 0 19:05:52 which results in different behaviour 19:05:57 when a component is first created, all it's pins are ties to dummy signals 19:06:06 the dummy signals are normally set to zero 19:06:18 but can you define the value to be different from zero? 19:06:32 * alex_joni was thinking about a hal component named constant 19:06:39 who is "you"? the guy writing the component, or the user? 19:06:49 the user 19:07:09 a component constant (with one pin output), and a parameter (to set it's value) 19:07:27 but I'm not sure it's needed (e.g. you can get the same behaviour somehow else) 19:07:38 e.g. ESTOP 19:07:56 let's say I don't want to edit emc.ini (to alter ESTOP_POLARITY) 19:08:07 I think halcmd has a "sets" command that lets you set a signal 19:08:35 or maybe there is a case where I can't do this (alter polarity) 19:08:46 now I want a machine without actual ESTOP HW 19:08:56 and I might need the default value for ESTOP 19:09:11 once things are HALified, there shouldn't be polarity associated with things like ESTOP 19:09:41 instead, ESTOP should always be active HI, and if the external signal is active low, you set the polarity at the hardware driver 19:09:49 I agree 19:09:51 parport.0.pin-01-out.invert 19:09:54 or whatever 19:09:55 yup 19:10:06 * alex_joni saw that sets exists 19:10:12 that would do the trick 19:10:16 even if it's needed 19:10:22 but sets won't let you set a pin unless it is connected to a signal 19:10:30 sets (set signal) 19:10:39 create a dummy signal (just for value) 19:10:50 and connect it to thepin you need to tie (high or low) 19:10:52 then sets 19:10:58 to set the value 19:11:02 yes, but kind of messy 19:11:38 being able to set an unconnected pin directly would be nice (it would modify the dummysig that an unconnected pin is connected to) 19:13:09 iab 19:13:24 "setp" is already used for set parameter, but perhaps "setpin"? 19:13:44 setpinvalue? 19:13:52 setpin is too generic IMO 19:14:02 shorter is better, people type these things 19:14:47 (I'm talking about halcmd commands, not API function names) 19:15:21 I'll be back in a bit, going to try theese other pins on the mill 19:15:26 hmmm.. halmeter doesn't see the HAL pin I just created 19:15:44 strance 19:15:49 strange 19:15:49 does halmeter connect to non-rt pins? 19:15:54 should 19:16:02 try "halcmd show pin" 19:16:59 I often use "halmeter show pin (or whatever) | grep " to filter the long list 19:17:11 I did halcmd show comp 19:17:13 for instance, to see all pins associates with axis.0, but not the rest 19:17:17 and iocontrol doesn't appear 19:17:21 gotta dig into it 19:17:44 you checking the return values of hal_init(), etc? 19:17:51 yup 19:17:55 strange 19:17:58 it aborts without hal_init 19:18:45 ChanServ has quit 19:19:50 picnet has joined #emc 19:20:28 ChanServ has joined #emc 19:29:58 what do you know... 19:30:02 it seems to work ;) 19:30:07 at least one way :D 19:30:20 what was wrong? 19:30:34 didn't compile last version *g* 19:30:44 ;-) 19:30:49 the one that actually called hal_init 19:36:10 03alex_joni * 10emc2/src/hal/hal.h: 19:36:11 added some initial support for HAL-based IO. right now a new iotask called io 19:36:11 (not simio) exports HAL-pins for estop and sets those when a NML-estop message 19:36:11 arrives. work needs to be done to get an estop through NML to EMC, and to 19:36:11 implement other signals as well (coolant, lubrication, etc.) 19:36:18 03alex_joni * 10emc2/ (3 files in 2 dirs): 19:36:18 added some initial support for HAL-based IO. right now a new iotask called io 19:36:18 (not simio) exports HAL-pins for estop and sets those when a NML-estop message 19:36:18 arrives. work needs to be done to get an estop through NML to EMC, and to 19:36:19 implement other signals as well (coolant, lubrication, etc.) 19:42:33 yay! 19:43:44 hmmmm... 19:43:48 a dilemma 19:43:50 well.. it only gets estop out to hal 19:43:56 jmk: shoot 19:44:05 I have this little avltree library 19:44:22 and inside the .c there is also a main() that can be used to test it 19:44:34 with a #ifdef to turn it on or off 19:44:48 but to build the test prog, the makefile also needs to be changed 19:45:06 the dillemma is do I leave such cruft in the makefile, or should it just build the lib 19:45:27 and I build the test binary manually when needed 19:45:56 this sounds resonable 19:46:27 bummer 19:46:28 which one? 19:46:42 build the test binary manually 19:46:46 ok 19:46:53 * alex_joni forgot to clean up emc.run :( 19:47:04 I changed the values for DEBUG_FILE & PRINT_FILE 20:00:56 I _really_ like this NML stuff :( 20:07:50 03jmkasunich 07halrefactor-0-1 * 10emc2/src/hal/ (Makefile avltree.c): improved test program for AVL trees, fixed a bug in the first() and last() functions, added an avltest target to the HAL makefile to build the test program 20:09:59 Imperator_away is now known as Imperator_ 20:10:03 Hi all 20:11:00 hey Martin 20:12:52 Alex it seams that you know how to handel NML ?? 20:13:27 sortoff... but only a little 20:13:43 right now I'm not doing anything NML 20:15:46 you have added a estop output, right 20:15:53 yup 20:18:01 picnet has quit 20:19:40 still some weird things ;) 20:19:48 * alex_joni is missing for half an hour 20:21:12 alex_joni has left #emc 20:55:02 * anonimasu sighs 21:04:07 alex_joni has joined #emc 21:04:15 * alex_joni is back 21:05:47 wb 21:05:51 my machine refused to work 21:05:52 :9 21:06:00 :( 21:06:56 so, no luck? 21:08:16 nope 21:08:47 what's wrong? 21:08:50 any idea? 21:09:29 no 21:09:30 :/ 21:09:40 I tried moving the pins aswell on the amps.. 21:09:53 does EMC start? 21:10:00 yeah 21:10:05 it starts and moves my Z axis.. 21:10:12 when I try running my X axis.. 21:10:13 :) 21:10:22 and only in one direction 21:10:25 I moved the direction pin.. 21:10:39 but it still wont change which way the axis goes.. 21:12:02 it could be that my calculations were wrong 21:12:18 the direction you can easily measure 21:12:20 0/5V 21:12:24 I tried running with the generic.ini unmodified.. 21:12:26 doesn't change too often 21:12:30 yeah, I did that.. 21:12:35 and? 21:12:44 I find the direction pins.. 21:12:59 but the axis dosent move in the other direction.. 21:16:27 does the polarity change on the parport? 21:16:41 no 21:16:44 just 0-5v 21:17:04 what do you mean 0-5V ? 21:17:17 it should be 0 if you go one way 21:17:20 logic 0 and 1 21:17:20 yeah 21:17:24 and 5Vif you go the other way 21:17:28 I know 21:17:34 is it like this? 21:17:39 that does work, but emc only outputs pulses when I go one way.. 21:17:42 or does it always stay the same? 21:17:52 ohh... and no pulses theother way? 21:17:56 yeah 21:18:04 you sure there are no pulses? 21:18:31 well, if the axis moves in one way, and I push the other key, isnt emc supposed to output the same pulses.. 21:18:47 with the dir pin 0 or 5v... 21:18:57 depending on which way I try to move.. 21:18:58 :) 21:20:08 slomo has joined #emc 21:21:12 err to put it simply, the dir pin works, but I only get movement when I run the axis one way.. 21:23:40 cant really measure it though 21:23:48 what pins ar eyou using? 21:23:57 the default ones 21:24:05 123456? 21:24:05 right now 21:24:13 I have no idea what they are.. 21:24:18 I just tried running with generic.ini 21:24:24 and measuring the pins.. 21:24:41 yeah, 1dirx 2stepx 3diry 4stepy 21:24:44 i believe 21:24:47 yeah probably 21:26:02 I'll grab the scope off work and measure it tomorrow 21:26:35 use headphones 21:26:42 if you have an old set you can sacrifice 21:27:05 you can even measure with an voltmeter 21:27:22 if it's between 0 and 5 (around 1-4V) you're stepping 21:27:29 an analog one is best 21:27:33 just joined, so what driver board are you using 21:27:35 yeah, and you can hear the stepps 21:27:37 if you have one ;) 21:27:37 yeah, but why's it stepping in one direction.. 21:27:41 geckodrives.. 21:27:51 I've been running the same setup with turbocnc for long while now :9 21:28:10 you will need to change your cable I believe 21:28:20 turbo uses a different pin out 21:28:37 it uses a user defined pinout.. 21:28:56 the weird thing is that I get steps when I move X+ but not X- 21:29:40 do the other axes work? 21:29:50 I can get z to move in one direction.. 21:29:55 and y 21:30:05 so each one only moves in one direction? 21:30:08 yeah.. 21:30:13 dfalck has left #emc 21:30:17 that is very bizarre 21:30:25 when I try moving the axis in the other direction I dont get any motion at all... 21:30:26 :) 21:30:41 I thought so too.. 21:31:01 it might be the case of emc + my cable but still where do the pulses go ;) 21:31:05 but it works with your other software? and you are SURE it's set up for the same pinout? 21:31:27 i measured to make sure the direction pins would be on the right driver.. 21:31:40 picnet has joined #emc 21:31:48 there is no pin 0 on a printer port 21:31:49 for use with xylotex board, i had to swap 1-2 3-4 5-6 dont know about gecko 21:31:53 just a side note 21:32:16 slomo: you mean 2-3 4-5 6-7 21:32:18 oopps 2-3 4-5 6-7 21:32:36 the # 1 pin goes straight thru 21:32:45 oh, I can use whatever pins I like as long as I get step / dir out 21:32:45 * alex_joni is lost... 21:32:46 :) 21:33:10 alex_joni: xylotex has the step pins and dir pins reversed from the normal emc way 21:34:23 I wasn't following the pins stuff 21:34:35 * alex_joni dived deep into rcslib 21:34:45 iocontroller 21:34:47 well, I'll measure it tomorrow and see if I get any luck.. 21:34:52 I am kind of tired :) 21:35:05 I am kind of annoyed :) 21:35:15 * anonimasu too 21:35:27 been messing for 6 hours with some stupid problem :9 21:35:38 I'll order new stuff and make a real cable. 21:37:29 that might help a bit.. 21:37:49 and take the scope home.. 21:38:06 anonimasu: so are you currently using pins 2,3,4,5,6,7 ? 21:38:40 yes 21:38:53 whatever the defaults are :) 21:38:59 123456 21:39:49 gezr: pin 1 isn't part of the step/dir output 21:39:54 gezr: it starts at pin 2 21:39:59 which is D0 21:40:14 i guess im on crack, your right 21:40:22 anonimasu: i think emc is for the signals on 2,3,4,5,67 21:40:42 ive been looking at valve #1 for the past 2 hours, 21:40:51 a70camaro has joined #emc 21:40:52 thats probably where im geting my thinking 21:41:32 :) 21:41:35 * anonimasu yawns 21:41:45 I'll be off now going to rest for a bit 21:42:11 laters everyone 21:42:52 * alex_joni found the problem 21:43:00 cradek: care to discuss it with me? 21:43:06 promise I'll not talk about NML 21:43:18 only about estop ;) 21:44:13 I'll try to help 21:44:23 well.. it's like this 21:44:31 there is an EMC_AUX_thingy 21:44:38 which takes care of ESTOP 21:44:49 and it has 2 variables 21:44:56 aux.estop 21:45:00 and auc.estop-in 21:45:03 aux 21:45:10 the first one is for output 21:45:16 and the second is the input 21:46:21 in emc1 the aux-thingy is a class 21:46:26 derived from NML_MODULE 21:46:39 that's a class with some state_machine in it 21:47:19 anyways... it goes through some states, and it returns the whole aux structure (including estop & estop_in) 21:47:24 is it clear so far? 21:47:49 yes, but I'm afraid you're going to start asking questions I don't know the answers to 21:48:24 we'll see ;) 21:48:29 in emc2 there aren 21:48:35 aren't any classes any more 21:48:55 it's a simple loop which gets a command (NML) and executes it 21:49:14 at the end it returns the whole status-struct (like emc1) 21:49:35 now... the problem I am facing now is that estop_in gets set (from HAL) 21:49:48 but the task controller only checks estop 21:50:01 I have 2 ways of doing things: 21:50:29 1. update estop from estop_in (if not set, and estop_in is set then estop=1) 21:51:00 2. modify the task controller to check estop_in (this way to run the machine a hal-loopback needs to be made from estop to estop-in) 21:53:29 I'd go with 2 21:53:36 what do you think? 21:55:26 isn't estop_in supposed to come from the hardware? 21:55:49 that's what I assume 21:56:17 ok, I see why you're saying use hal-loopback 21:57:50 I think you're asking the wrong guy, but having said that, I'm with you on using #2 21:58:21 part of the normal estop is hardware, so if you want to emulate the out->in you should do it at the hal level 21:59:58 bummer 22:00:05 wrong approach :( 22:00:12 ? 22:00:23 there is a while inside simIoControl 22:00:45 but in it there's a blocking read to NML_command 22:00:56 jf353 has quit 22:00:58 so that while can't be used for status output... 22:01:14 because the status outputs only when there's a new command 22:01:17 :( 22:03:17 and that's not the way to go... 22:12:13 a70camaro has quit 22:24:53 Imperator_ has quit 22:41:05 picnet has quit 22:43:25 cradek: do you know how I could debug the app? 22:44:10 alex_joni: what do you mean? 22:44:23 set a breakpoint, check some values... etc 22:44:30 I think gdb does the job 22:44:37 but I've never used it though 22:44:40 sure I know how to use gdb 22:45:04 basic operation is this: 22:45:08 start the program 22:45:15 attach to it with gdb, program operation stops 22:45:19 set breakpoints, etc 22:45:25 tell program to continue 22:45:48 now, do something that causes the breakpoints to be hit, debug 22:46:12 I see 22:46:25 so you want to debug simio? 22:46:35 minimilltask 22:46:42 ok, start everything up 22:46:53 milltask 22:47:00 running 22:47:01 then run `gdb /path/to/milltask 12345' where 12345 is the PID of the running milltask 22:47:46 ok it attached 22:48:03 (gdb) break some_function_name 22:48:11 I see that it stopped (heartbeat not increasing) 22:48:17 (gdb) continue 22:49:09 it said Continuing. 22:49:32 so now, do whatever in emc to make it call that function, and it will freeze there and give you back the (gdb) prompt 22:49:36 right after that it said Breakpoint 1, some_function_name (that means the breakpoint has been reached?) 22:49:41 yes 22:49:53 ok, what can I do now? 22:49:54 now you can use "next" to run one line 22:50:02 "step" to follow into called functions 22:50:11 "print" to examine variables 22:50:30 just hitting return repeats the last command (handy for step, next) 22:50:43 "continue" will let it continue running (until the next breakpoint) 22:50:57 danfalck has joined #emc 22:51:29 danfalck has left #emc 22:52:20 "finish" finishes this function and stops at the caller 22:52:37 "bt" show backtrace (who called who?) 22:52:45 and a million other things... 22:53:06 oh.. ok 22:53:16 can I set a breakpoint on a variable? 22:53:27 (gdb) watch variable_name 22:53:33 will tell you when it changes 22:53:54 you can set a breakpoint at a certain line of a file by file.c:1234 22:54:00 (gdb) break file.c:1234 23:05:21 danfalck has joined #emc 23:05:41 I really hate this ... 23:05:46 what? 23:06:08 I don't know how to send a NML message with the status 23:06:21 it just doesn't arrive where it should 23:06:23 ask me a gdb question instead 23:06:30 :-) 23:06:32 and I am convinced it's something I did ;) 23:08:22 btw.. you could add some debug info to axis 23:08:27 like heartbeat & such 23:09:50 yeah it doesn't have any of that stuff 23:10:12 I don't know if we should try to replicate everything tkemc has. It would be a lot of work and I'm not sure about the payoff. 23:10:16 that's why I switched back to tkEmc 23:10:21 for nwo 23:10:22 now 23:11:48 jmkasunich has quit 23:11:54 that's what I would do too 23:15:19 robin_sz has joined #emc 23:15:57 meep? 23:16:27 can i use emc with rtai without adeos patch? 23:18:10 you need some patch 23:18:28 adeos or the older rthal 23:18:43 meep robin 23:18:49 hmm 23:19:01 * alex_joni is near to going crazy bc of this NML stuff ;) 23:21:29 slomo has quit 23:28:38 robin: you still know a bit about RCS? 23:30:01 acemi has quit 23:38:02 sup robin_sz , I may need a bit of your knowldge later, 23:38:27 robin_sz : reguarding cvs 23:39:28 and I think I can win the valve seat battle 23:39:34 gezr: maybe I can help? 23:40:09 alex_joni : anyone can assist me, doesnt really matter, im just setting it up locally, and I want to wack at it a bit from howtos and such first 23:40:25 ask away 23:40:33 * alex_joni will be around for at least half an hour 23:40:57 I havent ran into enough problems just yet to ask a good question, I could fire off from the hip and get further lost :) 23:47:10 I'll think I'll commit what I have so far, and go to bed after that 23:47:41 alex_joni : youll be on tommrow wont you? 23:49:14 I hope so 23:49:24 depends on how I'll have time at work 23:49:37 but you could mail me if you get into trouble 23:49:49 although all CVS I did I was able to google out ;) 23:49:56 this isnt a pressing issue for me, it seems like just a permision type issue, I havent searched it out 23:51:36 I devoted 4 hours at least to the bike today :) 23:51:41 that makes me fell good 23:52:52 03alex_joni * 10emc2/ (3 files in 3 dirs): added some first support for HW-ESTOP. I'm not happy with the way to pass this to EMC through NML, this needs to be fixed. 23:55:20 gnight 23:55:27 take it easy 23:55:41 * alex_joni was beaten by RCSLIB ;) 23:56:00 alex_joni has quit