gmocappy clock

More
5 years 7 months ago - 5 years 7 months ago #201594 by newbynobi
Replied by newbynobi on topic gmocappy clock
So here is the next level ;-)

Adding the embedded tab as in previous post.

This one has the following hal pin:
Code:
HAL_BIT OUT timer.alarm_machine HAL_BIT OUT timer.alarm_spindle HAL_U32 OUT timer.elapsed_periodes_machine HAL_U32 OUT timer.elapsed_periodes_spindle HAL_BIT IN timer.machine_on HAL_U32 IN timer.periode_time_machine HAL_U32 IN timer.periode_time_spindle HAL_BIT IN timer.reset_alarm_machine HAL_BIT IN timer.reset_alarm_spindle HAL_BIT IN timer.running HAL_BIT IN timer.spindle_on

As shown in the attached hal file you will need to set the periods for the time after you want the alarm like so:
Code:
setp timer.periode_time_machine 2 setp timer.periode_time_spindle 1
Give the time in minutes, so here a alarm is given for machine time after 2 minutes and every minute you get an alarm for the spindle
In real machines you will sure set the time intervals longer, in my machine I set the machine time to 259200 and spindle time to 480

After that time periode the alarm pin will get high and will stay high until you set the corresponding timer.reset_alarm pin to high, do not forget to set it low again after you have done the maintenance or lube! Setting the reset pin high will clear the alarm an increment the elapsed_periods pin, so if you have done 10 lubes you may control the lube level to see if the use of oil is in between your limits or what ever you want to do with that information.

All values will be stored in a var file and reloaded on next start, machine pin after turning on the machine, spindle pin after turning on the spindle.

So what next?

- part counter
- travel distance
- anything else

And again you see, there is nothing impossible with gmoccapy and python. By the way this embedded tabs can also be included and axis and some other GUI.

So now I need testers and feed back ;-)

Norbert
Last edit: 5 years 7 months ago by newbynobi.
The following user(s) said Thank You: biqut2, tivoi

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

More
5 years 7 months ago #201598 by biqut2
Replied by biqut2 on topic gmocappy clock
Wow thank you! I figured I'd have to do all this once I had time. This saves me a ton of effort. I'll get this loaded up on my mill first chance I get and test it and get you some feedback.

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

More
5 years 7 months ago - 5 years 7 months ago #201630 by HansU
Replied by HansU on topic gmocappy clock
I tried to add a field for the running time of the current program.
But adding a label and writing a value as a first step failed. Can you give me please a hint what I did wrong?
It seems that the pins are not created and due to this error the vcp is not displayed.
Last edit: 5 years 7 months ago by HansU.

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

More
5 years 7 months ago #201632 by newbynobi
Replied by newbynobi on topic gmocappy clock
Where did you do the connection?
All Hal connections for an embedded tab must be done in the Hal file specified in the loading code (INI file command) in this case in timer.hal

Please watch that pins are not all ready connected in a previous Hal file.

Order of loading Hal files are
The order they are listed in the INI File
Then the postgui Hal file
than the embedded tabs Hal file.

I can not see if you glade file is correct, I am on a wrong computer

Norbert

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

More
5 years 7 months ago #201650 by HansU
Replied by HansU on topic gmocappy clock

newbynobi wrote: Where did you do the connection?
All Hal connections for an embedded tab must be done in the Hal file specified in the loading code (INI file command) in this case in timer.hal

Sorry I didn't post that, that war clear I thought.
I used your most recent timer.hal without the last four lines
and
Code:
EMBED_TAB_NAME = timer EMBED_TAB_LOCATION = ntb_setup EMBED_TAB_COMMAND = gladevcp -x {XID} -u timer_hu.py -H timer_v2.hal timer_4.glade

Linuxcnc says that it can't find the pin named 'timer.periode_time_machine'.
I think without including timer_hu.py it showed at least the panel ( I'm on the wrong computer too :laugh: )

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

More
5 years 7 months ago - 5 years 7 months ago #201671 by newbynobi
Replied by newbynobi on topic gmocappy clock
the Hal pin is called

timer.periode_time_machine

so your name is right.

there must be an other error too.
can you post your timer_hu.py file please

and the complete terminal output
Last edit: 5 years 7 months ago by newbynobi.

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

Moderators: newbynobi, HansU
Time to create page: 0.158 seconds
Powered by Kunena Forum