OpenCN detailed documentation

Can you try this command: Can you try halcmd getp loopback.0.f_in.0

I will try this when i run system this weekend.

Meanwhile, I will also try install and run openCN on x86 device PC to study further.

Things what I need to start with is :

  1. x86 PC with grub to load OS and act as openCN target

  2. Bechkoff module to act as ethercat slave communication

  3. PC for running host application

  4. Do i need special device for ethercat master?

Any other things suggested required to run and try openCN?

Hi Nadim,

Well, this seem very strange… I can’t reproduce the bug on my machine… Just to be sure :

  • You are running in simulation using “./agency/st” command ?
  • Are you directly putting command in the emulated environnement ? (And not through an ssh connection)
  • Could you provide us with the full output of:

“./ -a” under agency folder
“./ -a” under agency folder
“./st” under agency folder

Since it look like it’s running properly I don’t see why you would have problem with the build/deploy/st script but that’s the only thing I see to help you for now… You should normally see output of the HAL function.
@jmi Is there any chance this issue is related to the logfile script in simulation ?

In response to your different point :

  1. You can deploy OpenCN on a USB and directly boot on it.
  2. If you aim for a simple setup, like an IN or OUT module you also would like to have an EK1100 from beckhoff as an entry for the EtherCAT to connect.
    You also would like to know what slaves is supported in OpenCN :
    5.10. LinuxCNC Ethercat Control — OpenCN 2021.2.0 documentation (
    FYI : Every slave has it’s driver specific code, file “lcec_slaveName.c”
  3. Yes, we had some trouble on windows using the host application under WSL2 (but it’s working). If you don’t really need windows on your host pc I advice to go with any debian distro.
  4. You will need a e1000e for EtherCAT communication on x86 (see section 4.2.1)
    4. Environment — OpenCN 2021.2.0 documentation (

OpenCN is running smoothly directly from a thumb drive. So you don’t need to install it on the PC unless you are using the “sampler” component and you want to be sure that you do not loose some logs of signals.

Thanks a lot guys for your support. I appreciate that.

Answer to your queries :

  • You are running in simulation using “./agency/st” command ? Ans. Yes
  • Are you directly putting command in the emulated environnement ? (And not through an ssh connection) Ans. Yes you are right. I am putting command in emulated env terminal not through SSH
  • Could you provide us with the full output of:

“./ -a” under agency folder
“./ -a” under agency folder
“./st” under agency folder

Ans. I will share the required details. Is there any log file created automatically during steps or I have to run procedure and copy paste the output?

Next, I will again build, deploy and run x86-qemu and give update.

I tried the command and the result is as bbelow : I have also attached here log file
opencn ~ # ./halcmd getp loopback.0.f_in.0
result : 0

I tried commands given in userguide also attached here is log.

openCN_halcmd_test.pdf (96.9 KB)

Hi guys, I tried some more time and trials playing on halcmd tool. I attached a file here again.
I am able to understand more details by making a lot of mistakes and trying randomly.

./halcmd show does not give output however getp gives a lot of info.

I tired a lot of commands attached here a log if trials.
I tried to compile a step by step command by following mistakes and correcting them.
openCN_halcmd_tool_handson.pdf (19.4 KB)

While doing further study, In a file at path : opencn/ agency/ linux/ opencn/ hal/ halcmd.c
This is the file where functions are written with which we interact with halcmd tool? Can anyone please correct me I am wrong?

There are various functions like
static void print_thread_names(char **patterns)
int do_setp(hal_setp_args_t *hal_setp_args)
int do_getp(hal_setp_args_t *args)
int do_show(hal_show_args_t *hal_show_args)

If I am not wrong, when we give halcmd commands in opencn terminal, the above mentioned functions are called directly or indirectly.
Where can I find the corresponding exact commands of halcmd tool to call these functions? or tin other words Where is it defined the corresponding halcmd command like getp and setp which call these functions?

This will help me to understand and find out which commands are working properly and which are not.

Hi Nadim,

Thanks for the test. Having halcmd get ... working is good !

Regarding the logs, it missed the start command, the boot sequence after compilation completed and initial halcmd command.
Can you provide it ?

Thanks for your help

Regarding the src of halcmd : the user part of it (so the application entry point) is located at: `agency/usr/target/halcmd/

Hope this helps

1 Like

Do you need a log after i give ./st command? When openCN starts?

Yes, please - all the logs from the st command


@jmi , I checked. When i run ./st command, there is no print in terminal (screen remains blank) and directly openCN terminal is displayed.

This is kind of wierd.

By curiosity, which terminal and shell are you using ?

Using KDE Konsole Bash shell

Which shell and terminal you guys use generally?

Could it be a problem of shell? I tried with Xterm terminal also.


For info :
I’m using Terminator with bash shell.
I’ve just tried using KDE Konsole but it’s working on my side…

For fix :
The problem come from the branch you’re in (113-documentation-update).
Revert the change made in “./st” script (as per image, you want kvm and host). Maybe the last MR went a bit wrong regarding this file. I guess you did not do any change to this file right ?

After this it should work much better :slight_smile:

I have to check the branch again. I assumed I am on master.

Regarding st file : as per user guide, I changed Cpu to Nehalem and disabled kvm option.

I will update after investigation

I am on master branch only. attached is the file of st where I made changes as per user guide

OpenCN is able to boot with this settings and also logs printed in terminal. I have attached the logs here.

boot_log.pdf (58.6 KB)

Hi @Xavier , continuing to our discussion to test ethercat on raspberry pi4.

I have a raspberry pi 4 and Beckhoff EK1100 module as ethercat slave and other IO modules. Can i use raspberry pi’s ethernet port for ethercat communication testing?

Any other specific setting required?