- Posts: 22011
- Thank you received: 7491
Please Log in or Create an account to join the conversation.
As cmorley said, Machinekit-HAL has implemented something similar. Maybe you could take a peak and see if you could not get some inspiration from there.In my idea, the new logic control layer also includes a data area, which stores the data of the instantiated module(means there might be many instance of a module, and you need to handle each by their own name) and global variables. I don’t like using pointers for input and output. I hope that each module will allocate space in the data area after instantiation (including input output inout and local variables).
I always like the more general approach to modules which do one thing only and composing them together. Problem is, people like more the focused, all-in-one solution - because it is usually simpler for them.Because the relationship between the control modules is very close, for example, a robot module must be connected to a kinematic module, several Axis module, axis module is connected to one or two servo modules, and each servo is connected to a motor module.
Yes, you can have modules exporting public headers and other modules depending on it. However, you will have to still solve the communication between them. For example the current LinuxCNC's HAL does not support multicore, so you cannot have more than one thread accessing HAL shared memory segment.For module designers, he could use another module’s header to know others variables or functions. I think this should be used for inter-module communication.
It's probably translation error, but I don't understand what is meant by this.I think a fixed code area is needed to store functions, mainly for adding compilers in the future.
Yes, you understand it right.The current function call method is ok, if I understand it correctly, it depends on the function chain in a thread.
Well, you can connect two functions with input/output by way of HAL Pins. Of course, if the consumer is before producer in the call order, it will see the change only in the next iteration of HAL thread.you cant just do operation like robot.x=axis1.pos.
Again, maybe we don't understand each other (there is a problem in translation), but each HAL thread already has a "main" function, it is the infinite loop from which all the HAL functions callbacks are called.I think it is better to add a single main function directly to the thread, which has already been compiled.
From HAL module function you can call all the (C) functions you want, of course you have to make sure that they will not create a real-time exception (for example syscalls are a no-go operation).The way i think each function or module should be designed is that they all all functions that returns void, and the parameter has only one pvoid pointing to the parameter structure actually used.
I think you are getting the hang of things nicely. But you must realize that for the things you want to implement, you will have to do a really deep changes to the current implementation of HAL. Which will (very) probably not fly in LinuxCNC, so be prepared to create your own fork.Just some ideas that are just beginning to be realized. Please correct me if there is an error
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.