Urgent help required with EMC please

More
17 Aug 2016 14:51 #78935 by andypugh

This "if(delaydone), where is this ignal coming from?.


It's an input from a HAL pin:
pin in bit delaydone =false             "Signals timer finished";

The HAL pins (defined above the ;; token in the .comp) are read and written by other HAL components without any interaction inside the .comp code. (They are actually variables held in shared-memory that other code can read/write)

Please Log in or Create an account to join the conversation.

More
17 Aug 2016 15:11 #78936 by sxyuklad
Thank you very much for your kind info. I originally thought this was happening but was little bit confused. So is it possible to evaluate after how long delaystart=true, it sends back the signal delaydone=true? Basically how long it the delay and formula to calculate it? Or is there a present variable which defines this delay, if there is, can I extend or shorten it?

Please Log in or Create an account to join the conversation.

More
17 Aug 2016 15:14 #78937 by sxyuklad
So Andy, as Todd explained, when delaystart=true, the timer starts and after whatever time it sends the signal back to the comp saying delaydone=true. Am I correct? But here is the question then, how can I extend or shorten this timer? I mean the gap between between these two signals? Any variable set to fix this in milliseconds or seconds and if I can change its value?

Please Log in or Create an account to join the conversation.

More
17 Aug 2016 15:17 - 17 Aug 2016 15:18 #78938 by Todd Zuercher
In the hal code there is a line change that number to what ever delay in seconds you would like.
# will wait 5 secs approx and turn motor off after reversing against stop
setp timedelay.0.on-delay 5
Last edit: 17 Aug 2016 15:18 by Todd Zuercher.

Please Log in or Create an account to join the conversation.

More
17 Aug 2016 15:19 #78939 by andypugh

So is it possible to evaluate after how long delaystart=true, it sends back the signal delaydone=true? Basically how long it the delay


In the sample HAL code it is set to 5 seconds by "setp timedelay.0.delay 5"

You can code a timeout in a state-machine using the built-in variable "fperiod"
switch state{
   case 0:
       if (start) {
            timer = 5;
            state = 1;
        }
     case 1:
         timer = timer - fperiod;
         if (timer < 0) {DO STUFF}
         if (other condition){
             case = 2;
      case 3:
      ...

(Though a C-programmer might well use "if (timer -= fperiod < 0) to save a line of code)

Please Log in or Create an account to join the conversation.

More
17 Aug 2016 15:21 #78940 by sxyuklad
Also is there a way to uninstall a comp previously installed? The problem is before I installed "emcochanger" and now because I am using "oracchanger", I wan to uninstall the other comp which I am no longer using to avoid any interference with this comp. I have unloaded it from hal files but still can I uninstall it completely?

Please Log in or Create an account to join the conversation.

More
17 Aug 2016 15:24 #78941 by sxyuklad
Thank you very much, it was very helpful Andy. So if I change that digit 5 to whatever, like lets say 3, the delay will be 3 seconds? Yes? And thank you very much indeed for sharing another code to program a timeout.

Please Log in or Create an account to join the conversation.

More
17 Aug 2016 15:26 #78942 by andypugh
Ideally you would change the name of the comp to be more correct. (Your lathe is neither Orac nor Emco as far as I recall).

You need to change the file name _and_ the component name in the .comp file. If they don't match then trouble ensues.

Unused components are not a problem, you can just leave them there. If you really want to tidy up then you can delete the .ko file from wherever it ended up
sudo find / -name emcochanger.ko
will tell you where it is, then you can
sudo rm /path/to/file/emcochanger.ko

Please Log in or Create an account to join the conversation.

More
17 Aug 2016 15:30 #78943 by sxyuklad
In the same original comp, under instructions, how to install this comp, there is a line instructing to install timerdelay2.comp

'sudo comp --install timedelay2.comp'

I do not see any section in the file to grab the code for this timerdelay2.comp

Obviously if I do not have the comp file for it, how can I install it and the code for this comp is not in the file? Is it something that is already in the linuxcnc and comes with it installed or I will still need to install it and if that is the case where can I find the coding for it so I can make comp file and install it manually.

Please Log in or Create an account to join the conversation.

More
17 Aug 2016 15:34 #78944 by sxyuklad
Andy my Lathe is an Emco but the original tool changer written for it is a little more different than the one written for Orac, so I prefered to use orac ones so that I need to alter as little as possible. So I left the comp name as it is. I will change it once it is 100% completed to suit my needs. But I just wanted to tidy up making sure I am not leaving any instances of previosuly installed comps even though I am not using them or loading them in hal file. So you are sure even my previous comp is installed, it will not do any trouble or interfere with my current if I do not load it with hal file, yes?

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum