Prompt Message when defined input pin is triggered

If you have a question about the software please ask it here.

Prompt Message when defined input pin is triggered

Postby jonathanponz » Wed Aug 08, 2018 11:21 am

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.
jonathanponz
 
Posts: 5
Joined: Sun Mar 04, 2018 12:21 pm

Re: Prompt Message when defined input pin is triggered

Postby dezsoe » Wed Aug 08, 2018 12:44 pm

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!
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Prompt Message when defined input pin is triggered

Postby jonathanponz » Thu Jan 17, 2019 7:54 am

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.
jonathanponz
 
Posts: 5
Joined: Sun Mar 04, 2018 12:21 pm

Re: Prompt Message when defined input pin is triggered

Postby rmat » Mon Jan 21, 2019 12:02 pm

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
rmat
 
Posts: 15
Joined: Thu Dec 13, 2018 12:22 pm

Re: Prompt Message when defined input pin is triggered

Postby dezsoe » Tue Jan 22, 2019 10:26 am

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");
}
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Prompt Message when defined input pin is triggered

Postby dezsoe » Tue Jan 22, 2019 10:41 am

Post your probing macro with the line that checks for the signal error. I'll try to find out some solution.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Prompt Message when defined input pin is triggered

Postby jonathanponz » Wed Jan 23, 2019 11:52 pm

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?
jonathanponz
 
Posts: 5
Joined: Sun Mar 04, 2018 12:21 pm

Re: Prompt Message when defined input pin is triggered

Postby rmat » Thu Jan 24, 2019 7:13 am

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.
Attachments
M20031.txt
(5.5 KiB) Downloaded 544 times
rmat
 
Posts: 15
Joined: Thu Dec 13, 2018 12:22 pm

Re: Prompt Message when defined input pin is triggered

Postby dezsoe » Thu Jan 24, 2019 10:08 am

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.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Prompt Message when defined input pin is triggered

Postby dezsoe » Thu Jan 24, 2019 10:26 am

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");
}
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Next

Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 14 guests

cron