Re: EMC: delay fucntion in TCL/TK ?
Posted by
Asim Khan
on 2003-11-16 07:20:27 UTC
Ray, Thanks for help!
Yes i am editing the the tkio.tcl file. I want to implement tool
changer in a machining center. I would like to just signal out the
tool changer information via single bit. I am doing this using some of
the unused/free input and output bits of the printer port
The external 8051 compatible controller will handle the actual
tool changer task. the EMC will only signal this external controller
via single bit. Another input on lpt will be used for EMC to get the
status that the tool has successfully changed and now it can go
further to execute next command block.
The protocol i have roughly designed is as follows:
Protocol:
1. Machine axes go to home or tool changer location
2. EMC Sends 1 second low pulse
3. Toggle the output for specified number of tool number times
4. EMC waits for input low signal from external controller that tool
has been successfully changed
5. If external controller fails to load tool it activates the
Emergency stop signal.
i've started writing code for the tool change in tkio. but at one
place i needed to generate some delays. I dont need these delays to be
very precise.
and i'll always look forward for your help whenever i get in trouble
lets hope i get this all succesfully done!! ! !
thanks and best regards
Asim
--- In CAD_CAM_EDM_DRO@yahoogroups.com, Ray Henry <rehenry@u...>
wrote:
Yes i am editing the the tkio.tcl file. I want to implement tool
changer in a machining center. I would like to just signal out the
tool changer information via single bit. I am doing this using some of
the unused/free input and output bits of the printer port
The external 8051 compatible controller will handle the actual
tool changer task. the EMC will only signal this external controller
via single bit. Another input on lpt will be used for EMC to get the
status that the tool has successfully changed and now it can go
further to execute next command block.
The protocol i have roughly designed is as follows:
Protocol:
1. Machine axes go to home or tool changer location
2. EMC Sends 1 second low pulse
3. Toggle the output for specified number of tool number times
4. EMC waits for input low signal from external controller that tool
has been successfully changed
5. If external controller fails to load tool it activates the
Emergency stop signal.
i've started writing code for the tool change in tkio. but at one
place i needed to generate some delays. I dont need these delays to be
very precise.
and i'll always look forward for your help whenever i get in trouble
lets hope i get this all succesfully done!! ! !
thanks and best regards
Asim
--- In CAD_CAM_EDM_DRO@yahoogroups.com, Ray Henry <rehenry@u...>
wrote:
>the GUI
> Hi Asim
>
> I'm guessing here that you are working with emcio but using one of
> or script files. The file emcio is written in C++ and I havn't aclue
> how to put a timing loop in one of those. In Tickle you would mosta Tcl
> likely use the following form of the after command
>
> "after ms ?script script script ...?
> In this form the command returns immediately, but it arranges for
> command to be executed ms milliseconds later as an event handler.The
> command will be executed exactly once, at the given time. Thedelayed
> command is formed by concatenating all the script arguments in thesame
> fashion as the concat command. The command will be executed atglobal
> level (outside the context of any Tcl procedure). If an erroroccurs
> while executing the delayed command then the bgerror mechanism isused to
> report the error. The after command returns an identifier that canbe
> used to cancel the delayed command using after cancel. " (Takenfrom a
> page on the activestate website)tend to
>
> There are loops in all of the GUIs and many of the scripts. These
> take the formpretty
>
> proc updateloop () (
> global triggervariable
> if {$triggervariable == 1} {
> set triggervariable 0
> } else {
> set triggervariable 1
> }
> after 1 updateloop
> }
>
> This would make a square wave signal at triggervariable. This is
> sloppy coding but it will work for you. If you were using iosh andemcio
> you would be able to directly flip flop a parport pin.guts of
>
> There are several cautions when using something like this. If the
> the process take longer than the after value you will dig a hole itwill
> not come out of. After is not a precise timing function, at leastnot
> like the real-time stuff.CAD_CAM_EDM_DRO@yahoogroups.com
>
> Good luck. Contact me off list if you wish more info.
>
> Ray
>
>
>
> On Friday 14 November 2003 11:34 pm,
> wrote:produce
> > Message: 22
> > Date: Sat, 15 Nov 2003 04:58:13 -0000
> > From: "Asim Khan" <asimtec@y...>
> > Subject: EMC: delay fucntion in TCL/TK ?
> >
> > Hi group!
> > I am editing emcio source code written in tcl/tk. i want to
> > delays in milli second. please tell me how to do this in tcl/tk?
> > regards
> > asim
Discussion Thread
Asim Khan
2003-11-14 20:58:16 UTC
EMC: delay fucntion in TCL/TK ?
Ray Henry
2003-11-15 09:03:40 UTC
Re: EMC: delay fucntion in TCL/TK ?
Asim Khan
2003-11-16 07:20:27 UTC
Re: EMC: delay fucntion in TCL/TK ?