Page 1 of 2

Prompt Message when defined input pin is triggered

PostPosted: Wed Aug 08, 2018 11:21 am
by jonathanponz
Hello,

I would like to ask how to integrate message prompts when my input pin is triggered.
Example:
Port2 InputPin10 was connected to my water flow sensor. If my pump got problem while running, I would like the machine to do Cycle Stop and will prompt a message saying that "Water Flow sensor fails" or any message I want.

Thank you.

Re: Prompt Message when defined input pin is triggered

PostPosted: Wed Aug 08, 2018 12:44 pm
by dezsoe
Hello,

Just create a macro e.g. M20000.txt in your current macro folder (Profiles\Macro_yourprofilename). (Number must be 20000..21999!)

Code: Select all
exec.Callbutton(130); // Press Cycle stop
exec.AddStatusmessage("Water Flow sensor fails");

Go to Configuration, I/O trigger, Input trigger and select your input port and pin, set function to 20000, if needed, select active low. Apply (or save) settings. Test!

Re: Prompt Message when defined input pin is triggered

PostPosted: Thu Jan 17, 2019 7:54 am
by jonathanponz
Hello dezsoe,

Thanks for your prompt response, just now I manage to test the M20000 but once the sensor is triggered the machine did not stop.

Is there anything I can test more to make it work?thank you.

Re: Prompt Message when defined input pin is triggered

PostPosted: Mon Jan 21, 2019 12:02 pm
by rmat
Hello Dezsoe,

I will just write here so I dont open another thread.
This example fits my problem very well, but i need a twist. I use wireless probe and it has a error signal witch I have wired, but dont know how to put it to use only during execution of probing macros.
I wrote line witch only checks my probe at the begining of the macro (basically same as checking if machine was homed), but I want to be able to stop macro execution also during probing if there is error in wireless. I already manage to broke two probes due to a wireless block and really dont feel the need to spend more money on this.

Best regards, Matej

Re: Prompt Message when defined input pin is triggered

PostPosted: Tue Jan 22, 2019 10:26 am
by dezsoe
jonathanponz wrote:Hello dezsoe,

Thanks for your prompt response, just now I manage to test the M20000 but once the sensor is triggered the machine did not stop.

Is there anything I can test more to make it work?thank you.

Hello Matej,

OK, it's true, sorry. I wrote an other macro which you have to set as a macroloop. Save the macro and change the value 472 in the first line to your input pin's LED number. Set the macro to autorun, press run and try it.

Code: Select all
int errorled = 472; // See LEDs_by_number.htm for input pin LED numbers

if (exec.GetLED(errorled) && (exec.GetLED(54) || exec.GetLED(55)) && !exec.Ismacrostopped()) // Cycle start or Single line
{
  exec.Callbutton(130); // Press Cycle stop
  exec.AddStatusmessage("Water Flow sensor fails");
}

Re: Prompt Message when defined input pin is triggered

PostPosted: Tue Jan 22, 2019 10:41 am
by dezsoe
Post your probing macro with the line that checks for the signal error. I'll try to find out some solution.

Re: Prompt Message when defined input pin is triggered

PostPosted: Wed Jan 23, 2019 11:52 pm
by jonathanponz
dezsoe wrote:
jonathanponz wrote:Hello dezsoe,

Thanks for your prompt response, just now I manage to test the M20000 but once the sensor is triggered the machine did not stop.

Is there anything I can test more to make it work?thank you.

Hello Matej,

OK, it's true, sorry. I wrote an other macro which you have to set as a macroloop. Save the macro and change the value 472 in the first line to your input pin's LED number. Set the macro to autorun, press run and try it.

Code: Select all
int errorled = 472; // See LEDs_by_number.htm for input pin LED numbers

if (exec.GetLED(errorled) && (exec.GetLED(54) || exec.GetLED(55)) && !exec.Ismacrostopped()) // Cycle start or Single line
{
  exec.Callbutton(130); // Press Cycle stop
  exec.AddStatusmessage("Water Flow sensor fails");
}


Hello dezsoe,

I had tested your code and put it in a macroloop and it is now working, thanks a lot. Now I am planning to prompt the message and there is an "OK" button for the operator to click for his/her to confirm. :D . Is it doable in a macroloop?

Re: Prompt Message when defined input pin is triggered

PostPosted: Thu Jan 24, 2019 7:13 am
by rmat
dezsoe wrote:Post your probing macro with the line that checks for the signal error. I'll try to find out some solution.

Here is one of the probing macros. Ive just pasted the probe lines over all of them.
Was just thinking, If I could just set alarm as cycle stop at the beginning of macro and reset it at the end?
Anyway, Ill leave it here so maybe someone could find viable solution to for this.

Re: Prompt Message when defined input pin is triggered

PostPosted: Thu Jan 24, 2019 10:08 am
by dezsoe
I had tested your code and put it in a macroloop and it is now working, thanks a lot. Now I am planning to prompt the message and there is an "OK" button for the operator to click for his/her to confirm. :D . Is it doable in a macroloop?

Technically yes, but don't do it. It's not adviced to do anything that stops/hangs the loop.

Re: Prompt Message when defined input pin is triggered

PostPosted: Thu Jan 24, 2019 10:26 am
by dezsoe
rmat wrote:
dezsoe wrote:Post your probing macro with the line that checks for the signal error. I'll try to find out some solution.

Here is one of the probing macros. Ive just pasted the probe lines over all of them.
Was just thinking, If I could just set alarm as cycle stop at the beginning of macro and reset it at the end?
Anyway, Ill leave it here so maybe someone could find viable solution to for this.

I thoght over and found that the best way is to check if probing is in progress and the signal is lost and then press stop. The macro below is a macroloop, test it!

Code: Select all
int errorled = 7; // See LEDs_by_number.htm for input pin LED numbers

if (exec.GetLED(errorled) && exec.GetLED(24) && !exec.Ismacrostopped()) // Check while probing
{
  exec.Callbutton(130); // Press Cycle stop
  exec.AddStatusmessage("Probe lost connection, start over");
}