hal suggestion

More
27 Aug 2018 08:02 #116635 by mngr0
hal suggestion was created by mngr0
Hi everybody,

i am trying to configure my machine in a strange way, this is what I need it to do:

- when a switch gets pressed the program goes in pause (done in HAL sending a signal from switch to halui.program.pause)
- when the program goes in pause (or in general when an event happen) a script gets executed (in this case it moves the tool and low the setted temperature)
- before the program returns in running it re-set the original temperature and waits to reach the setpoint

is there any sane way for doing this? I resolved the first one in HAL, can I solve also the other two in HAL? maybe writing some HAL module...
Another idea is editing axis and writing here these scripts.

what do you think about it? which is th best way for doing this? maybe there is a third which I didn-t think of...

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

More
27 Aug 2018 22:23 - 28 Aug 2018 00:12 #116678 by Grotius
Replied by Grotius on topic hal suggestion
Hi Marco,

Nicest way is c coded component.

yourcomponentname;

pin in bit Enable;
// enable this function

pin in bit Pause_in;
// your pause input, can be a glade hal checkbutton

pin out bit Pause_out;
//connected to motion feed inhibited

pin in float Temp_in_low;
//the value of the low temperature, can be a glade hal hscale value

pin in float Temp_in_high;
//the value of the high temperature

pin out float Temp_out;
//the value of the output temperature

//And so on.

//The actual coding is like

if(Enable){
Temp_out = Temp_in_low;

} else {Temp_out = Temp_in_high;}

And then compile with : sudo halcompile --install yourcomonentname....

If you want to use a time function for heating up or lowering the temp, the code needs more, but not difficult if you have a
working example.

But maybe you can describe your c code tryout over here. Then c coders can look at it.
There are very good c coders at this forum. :woohoo:
Last edit: 28 Aug 2018 00:12 by Grotius.

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

Time to create page: 0.095 seconds
Powered by Kunena Forum