mixing CoE and mailing

More
05 Sep 2023 05:39 #279924 by endian
Replied by endian on topic mixing CoE and mailing
nice!

but when we should use more slaves as for joint 0 1 2 etc... it will looks like how please? 
ethercat upload -p 1 -t string 0x1009 00
1 - slave number ?
0x1009 - register ?
00 - is subindex ?

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

More
05 Sep 2023 06:08 #279925 by bkt
Replied by bkt on topic mixing CoE and mailing
all right plus "string" is data type .... you can obtain these reply:

0x1010 (or right register container) your register value (because you ask for string)

but in these example:

ethercat upload -p 2 -t in16 0x2646 00

you can obtain a reply like these:

0x2647 8 (an integer value)

for grab value you must use qProcess, obtain a qString and cut 5 character after "x" (because there are a space trought register and value) than convert it on float value or string value based on your request ..... can be 15 row of code c++ or less .... if you use qDragon or other QTinterfaces can be quite easy .... I use a custom qt c++ interfaces ....

p.s. if you insert a wrong data type you obtain an error as reply ... if you insert a wrong register you obtain an error as reply .... so try sometime with terminal command .... and after bouild your own routines ....

regards

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

More
05 Sep 2023 06:13 #279927 by bkt
Replied by bkt on topic mixing CoE and mailing
if you use axis ui .... these become hard for me suggest you something .... but for sure you can build in same manner a custom componenet ... afert you can launch request using a bit of logic with classic ladder I think ..... (for ex. a repeat timer that launch every x sec. 7/8 request .... for string request you must insert the string directly on component I think).

regards

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

More
05 Sep 2023 07:10 #279929 by endian
Replied by endian on topic mixing CoE and mailing
yes reply have to be in the string everytime .. sure wrong question wrong answer

I am just digging for should be the best way to run some stuff... for testing purposes via axis ui, but I have some problem with hardware, like I wrote in other thread, with 2 core hardware ... custom component with any calling(cyclical or acyclical) in axis UI is not a problem ... but grabbing replys should be there I am without experiences

but it should be time to move to something more userable ... what should be your choice for some small workshop project?

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

More
05 Sep 2023 22:48 - 05 Sep 2023 23:19 #280031 by bkt
Replied by bkt on topic mixing CoE and mailing
my programming experience allows me to do a lot and nothing at the same time ..... I'm not a professional programmer and it took me a long and too long time to understand the mechanisms of linuxcnc .... many still are not well understood . ... I would be presumptuous to give advice to you .... I don't know your experience and your goals .... if you have to make a plasma or some kind of mill or a printer ..... you find many better suggestions than the ones I can give you .... if you have to work with robot joint I took a lot of advantage from the suggestions of arkEye, andyPugh, sebastian kumizky, dave garret and last but not least from Grotius' projects .... indeed Grotius gave me made me better understand what arkEye suggested ..... about ethercat I haven't studied the protocol in depth, otherwise I wouldn't have asked the silly questions I asked here .... so I confess with sympathy that I use the forum as a textbook .... for ethercat today follow db1981's posts and for the rest do a lot of practice .... when I was very good in mathematics (centuries ago) it's because I did a lot of practice and a lot of study and I had a lot of interest in doing it .... after these i can suggest you to use what is more familiar for you .... personally is c++ and because i'm lazy I use QT framework .... when you be able grab and send data from Lcnc to Qt interfaces you can do a lot of thinghs with little effort .... but it all depends on what you can do today..... for time I have and for my experinces on Lcnc and in english .... i can help you.


with qProcess ...
QProcess sdoRegUpload;
sdoRegUpload.startDetached("/bin/sh",QStringList()<<"-c"<<"ethercat upload -p 2 -t in16 0x2646 00");
sdoRegUpload.waitForFinished();
QByteArray result = sdoRegUpload.readAll();
QString myValue = QString::fromStdString(result.toStdString());
int grabVal = myValue.split(" ")[1].toInt;

**** but better was run sequences of these command inside a qthread o inside a cyclic Qtimer so you have not UI freeze problem *******

regards
Last edit: 05 Sep 2023 23:19 by bkt.
The following user(s) said Thank You: tommylight, endian

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

Time to create page: 0.068 seconds
Powered by Kunena Forum