- LinuxCNC
- General LinuxCNC Questions
- How to use QT to control pins and signals in Linuxcnc via shared memory?
How to use QT to control pins and signals in Linuxcnc via shared memory?
- 961377074@qq.com
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
08 Mar 2022 00:44 #236621
by 961377074@qq.com
How to use QT to control pins and signals in Linuxcnc via shared memory? was created by 961377074@qq.com
1.Now I have a signal called qqq
u@u-desktop:~$ sudo halcmd show sig qqq
Signals:
Type Value Name (linked to)
bit FALSE qqq
2.The signal changes when I execute the following code in QT
halcmdsets("qqq","1");
3.The value of the signal is now true
u@u-desktop:~$ sudo halcmd show sig qqq
Signals:
Type Value Name (linked to)
bit TRUE qqq
Finally, how should I write the halcmdsets? My English level is relatively poor, please forgive me for the improper description.
u@u-desktop:~$ sudo halcmd show sig qqq
Signals:
Type Value Name (linked to)
bit FALSE qqq
2.The signal changes when I execute the following code in QT
halcmdsets("qqq","1");
3.The value of the signal is now true
u@u-desktop:~$ sudo halcmd show sig qqq
Signals:
Type Value Name (linked to)
bit TRUE qqq
Finally, how should I write the halcmdsets? My English level is relatively poor, please forgive me for the improper description.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23159
- Thank you received: 4856
09 Mar 2022 23:31 #236791
by andypugh
Replied by andypugh on topic How to use QT to control pins and signals in Linuxcnc via shared memory?
Possibly you need to use pins not signals. Signals are just labels that are used to connect pins together.
I don't know how to create HAL pins in QT, but I am sure that there are examples out there.
What language are you using for the background handler code?
I don't know how to create HAL pins in QT, but I am sure that there are examples out there.
What language are you using for the background handler code?
Please Log in or Create an account to join the conversation.
- 961377074@qq.com
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
10 Mar 2022 05:26 #236815
by 961377074@qq.com
Replied by 961377074@qq.com on topic How to use QT to control pins and signals in Linuxcnc via shared memory?
In the C++ language I use in QT, I want to change both the signal and the pin. I looked at the files in LinuxCNC and found the hal_lib.c file, which can help me realize the idea of changing signal values and pin values in QT. But now I have this idea but I don't know how to implement it using QT.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23159
- Thank you received: 4856
10 Mar 2022 08:57 #236819
by andypugh
Replied by andypugh on topic How to use QT to control pins and signals in Linuxcnc via shared memory?
The only example I can find of linuxcnc creating a HAL pin in C++ is in the code that the Python module calls.
But, here is that:
github.com/LinuxCNC/linuxcnc/blob/8241aa...al/halmodule.cc#L360
Basically you pass it a pointer to one of your internal variables, and the function then moves that variable into shared memory. From that point in your code you can just use the variable to get or set the pin value.
But, here is that:
github.com/LinuxCNC/linuxcnc/blob/8241aa...al/halmodule.cc#L360
Basically you pass it a pointer to one of your internal variables, and the function then moves that variable into shared memory. From that point in your code you can just use the variable to get or set the pin value.
Please Log in or Create an account to join the conversation.
- 961377074@qq.com
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
11 Mar 2022 23:23 #236965
by 961377074@qq.com
Replied by 961377074@qq.com on topic How to use QT to control pins and signals in Linuxcnc via shared memory?
Ok, I will analyze the file halModulo. c, may I ask whether I can contact you through any chat software? I would like to continue to consult you about this aspect.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19430
- Thank you received: 6508
12 Mar 2022 00:50 #236969
by tommylight
Replied by tommylight on topic How to use QT to control pins and signals in Linuxcnc via shared memory?
@ 961377074
Please do not change the subject title.
Please do not change the subject title.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
12 Jun 2024 11:16 #302868
by TheRoslyak
Replied by TheRoslyak on topic How to use QT to control pins and signals in Linuxcnc via shared memory?
Why do you need this signal? And how did you create it. (Python / C++) Maybe you need to attach to an already existing one. and hang it on the button.
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
Less
More
- Posts: 3982
- Thank you received: 1723
12 Jun 2024 11:54 #302870
by Aciera
Replied by Aciera on topic How to use QT to control pins and signals in Linuxcnc via shared memory?
@TheRoslyak
That post is likely a spam setup.
First post with female username and some ChatGPT result to something found in an old thread. Then the actual spam link is added later on.
That post is likely a spam setup.
First post with female username and some ChatGPT result to something found in an old thread. Then the actual spam link is added later on.
The following user(s) said Thank You: meister
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
Less
More
- Posts: 2241
- Thank you received: 1981
12 Jun 2024 13:26 #302876
by Grotius
Replied by Grotius on topic How to use QT to control pins and signals in Linuxcnc via shared memory?
how to use hal with qt
This is old, but gives you info.
This is old, but gives you info.
Please Log in or Create an account to join the conversation.
- JT
- Away
- Administrator
Less
More
- Posts: 837
- Thank you received: 445
14 Jun 2024 12:18 #303003
by JT
Replied by JT on topic How to use QT to control pins and signals in Linuxcnc via shared memory?
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- How to use QT to control pins and signals in Linuxcnc via shared memory?
Time to create page: 0.142 seconds