Unfortunately I havent found anything regarding my question using the search function.
Here is my question:
I want to connect 4 serial devices to the 4 USB ports on Raspi. All 4 devices are exactely the same (Roboclaw motor controller).
Using udev rules I am able to give all of them reproducable names, even if I disconnect and reconnect them, so thats all fine.
To use the serial USB in codesys I know that I need to add the following lines to CODESYSControl_User.cfg:
After this I am able to control the devices vial the CAA serial library.
My question is now if there is a way to assign each Motorcontroller to a specific comport, so that I can decide which motorcontroller to "speak" without sending every command to each motor?
Thank for any help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hm if you have added ttyUSB in the config file you could access
the serial com's in CODESYS
Com1,Com2,Com3... that is the way it works.
Maybe I do no really understand it, please explain .
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also take a look at the reply I gave yesterday to how to "connect serial devices" thread. I encountered the same thing and think I found and documented a solution yesterday.
Cheers,
Todd
Note: to moderator: Maybe, seeing this, the reply I wrote would be better put here.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone,
Unfortunately I havent found anything regarding my question using the search function.
Here is my question:
I want to connect 4 serial devices to the 4 USB ports on Raspi. All 4 devices are exactely the same (Roboclaw motor controller).
Using udev rules I am able to give all of them reproducable names, even if I disconnect and reconnect them, so thats all fine.
To use the serial USB in codesys I know that I need to add the following lines to CODESYSControl_User.cfg:
[SysCom]
Linux.Devicefile=/dev/ttyUSB
portnum:=COM.SysCom.SYS_COMPORT1
After this I am able to control the devices vial the CAA serial library.
My question is now if there is a way to assign each Motorcontroller to a specific comport, so that I can decide which motorcontroller to "speak" without sending every command to each motor?
Thank for any help!
Hi,
hm if you have added ttyUSB in the config file you could access
the serial com's in CODESYS
Com1,Com2,Com3... that is the way it works.
Maybe I do no really understand it, please explain .
BR
Edwin
Also take a look at the reply I gave yesterday to how to "connect serial devices" thread. I encountered the same thing and think I found and documented a solution yesterday.
Cheers,
Todd
Note: to moderator: Maybe, seeing this, the reply I wrote would be better put here.
Hi Todd,
thank you for sharing this:
l viewtopic.php?f=21&t=5699&start=90#p24170 l
We will add this to the Raspberry PI Application section too. ( Just as information how to do it)
Moderator
Thanks, that totally answers my question and works also!