Syllabus needed for learning HAL Component

More
30 May 2014 21:47 #47552 by Mr. Technical
Hi Guys,

I am retrofitting a FANUC lathe that has a hydraulic turret (12 position), and have decided that I need to learn how to create/implement HAL components in order to make the turret, hydraulically actuated gear changes, and around 60 button inputs/outputs work.
Here are my reasons:
Although I have the factory PC Ladder drawings, I think they will be too long and slow if recreated in ClassicLadder.
There are so many inputs just for the tool turret (a dedicated switch for each position, an unclamped sw., a preclamped sw. , a clamped sw. and a prox switch).
The tedious nature of using ClassicLadder for complicated systems.
All the other inputs that I hope to tie in from the front panel switches.


I have set up a PyVCP panel to manually step through the process of tool changes and gear changes, but I want to streamline everything.
I have found a lot of documentation about Component creation, but I need a syllabus to learn in a productive manner. If anyone could point me at specific links in the order that I should read/assimilate them, I'd really appreciate it.

For the record, I'm using a Mesa 5i25 with a 7i77 and a 7i84 board.

Mr. Technical

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

More
30 May 2014 22:00 #47553 by andypugh

I need a syllabus to learn in a productive manner. If anyone could point me at specific links in the order that I should read/assimilate them, I'd really appreciate it


Do you understand C?

Do you know what a state-machine is?

If you have created a PyVCP panel then you know enough about HAL, so all that is left is
www.linuxcnc.org/docs/html/hal/comp.html

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

More
30 May 2014 22:12 #47555 by Mr. Technical
Hi Andy,

Thanks for the quick reply.

I don't speak C (yet).

I have a basic understanding of a state machine (after some quick wikipedia reading ) :)

Thanks for the link. It's one of the ones that I had found, but it's nice to know that it is actually the best place to start.

Since I don't know C programming, (I have mostly programmed with BASIC and Pascal years ago), which would you tackle first? Rudimentary C programming, or the link that you provided? Any good primers on C?

Mr. Technical

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

More
30 May 2014 22:32 #47556 by andypugh

Since I don't know C programming, (I have mostly programmed with BASIC and Pascal years ago), which would you tackle first? Rudimentary C programming, or the link that you provided? Any good primers on C?


I think C first, at least enough to read C.
The traditional answer would be
www.amazon.com/Programming-Language-2nd-...kernighan+and+richie
But you can find C tutorials for free on the Internet.

You might find www.codepad.org useful for experimenting with snippets of C.
The following user(s) said Thank You: Mr. Technical

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

More
30 May 2014 22:52 #47557 by Mr. Technical
This is exactly what I was looking for. Thanks Andy!

Mr. Technical

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

More
31 May 2014 06:24 #47563 by andypugh
Once C-code makes a little bit of sense, have a look at wiki.linuxcnc.org/uploads/oracchanger.comp
That is a good example of a state-machine for a tool changer, where the "progress_level" variable either remains the same or switches to a different state every time the component is called.

Bear in mind that a HAL component is called every 1mS, and has to run to completion and exit in a very short time, every time.

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

Time to create page: 0.150 seconds
Powered by Kunena Forum