- Posts: 1317
- Thank you received: 454
AMSAMOTION IO module
1 year 1 month ago #334331
by Hakan
Replied by Hakan on topic AMSAMOTION IO module
Settings in /etc/ethercat.conf ok? Should read
Are both kernel modules loaded? I guess not.
Code:
...
MASTER0_DEVICE="78:45:c4:23:9f:86"
...
DEVICE_MODULES="generic"
...
Code:
$ lsmod | grep ^ec_
ec_generic 12288 0
ec_master 479232 1 ec_generic
The following user(s) said Thank You: Kuzma30
Please Log in or Create an account to join the conversation.
1 year 1 month ago #334391
by Kuzma30
Replied by Kuzma30 on topic AMSAMOTION IO module
ec_generic was not loaded.
After modprobe it I can see slaves
How to autoload it?
After modprobe it I can see slaves
Code:
ethercat slaves
0 0:0 PREOP + EC3A-IO1632
How to autoload it?
Please Log in or Create an account to join the conversation.
1 year 1 month ago - 1 year 1 month ago #334396
by Hakan
Replied by Hakan on topic AMSAMOTION IO module
ec_generic should autoload when ethercat master service is started and "generic" is mentioned in /etc/ethercat.conf
There was an issue where it didn't and the user had to modprobe it manually after start of linux.
Suspected Secure boot but it was off like in your case. Never understood why it didn't load.
I guess you have to experiment to see if you can get it to autoload.
/usr/sbin/ethercatctl is the file that loads the modules when the service is started, it's a bash script.
There was an issue where it didn't and the user had to modprobe it manually after start of linux.
Suspected Secure boot but it was off like in your case. Never understood why it didn't load.
I guess you have to experiment to see if you can get it to autoload.
/usr/sbin/ethercatctl is the file that loads the modules when the service is started, it's a bash script.
Last edit: 1 year 1 month ago by Hakan. Reason: ethercatctl
The following user(s) said Thank You: ts
Please Log in or Create an account to join the conversation.
1 year 1 month ago #334484
by Kuzma30
Replied by Kuzma30 on topic AMSAMOTION IO module
I have such info for my module.
How to make xml config file for it?
Code:
ethercat xml
<?xml version="1.0" ?>
<EtherCATInfo>
<!-- Slave 0 -->
<Vendor>
<Id>2965</Id>
</Vendor>
<Descriptions>
<Devices>
<Device>
<Type ProductCode="#x00001101" RevisionNo="#x01020109">EC3A-IO1632</Type>
<Name><![CDATA[EC3A-IO1632]]></Name>
<Sm Enable="1" StartAddress="#x1000" ControlByte="#x26" DefaultSize="128" />
<Sm Enable="1" StartAddress="#x1080" ControlByte="#x22" DefaultSize="128" />
<Sm Enable="1" StartAddress="#x1100" ControlByte="#x64" DefaultSize="2" />
<Sm Enable="1" StartAddress="#x1400" ControlByte="#x20" DefaultSize="2" />
<RxPdo Sm="2" Fixed="1" Mandatory="1">
<Index>#x1600</Index>
<Name>DOOutputs process data mapping</Name>
<Entry>
<Index>#x7000</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>OUT_GEN_DO</Name>
<DataType>UINT16</DataType>
</Entry>
</RxPdo>
<TxPdo Sm="3" Fixed="1" Mandatory="1">
<Index>#x1a00</Index>
<Name>DIInputs process data mapping</Name>
<Entry>
<Index>#x6000</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>IN_GEN_DI</Name>
<DataType>UINT16</DataType>
</Entry>
</TxPdo>
</Device>
</Devices>
</Descriptions>
</EtherCATInfo>
cnc@cnc:~$ ethercat pdos
SM0: PhysAddr 0x1000, DefaultSize 128, ControlRegister 0x26, Enable 1
SM1: PhysAddr 0x1080, DefaultSize 128, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1100, DefaultSize 2, ControlRegister 0x64, Enable 1
RxPDO 0x1600 "DOOutputs process data mapping"
PDO entry 0x7000:01, 16 bit, "OUT_GEN_DO"
SM3: PhysAddr 0x1400, DefaultSize 2, ControlRegister 0x20, Enable 1
TxPDO 0x1a00 "DIInputs process data mapping"
PDO entry 0x6000:01, 16 bit, "IN_GEN_DI"
How to make xml config file for it?
Please Log in or Create an account to join the conversation.
1 year 1 month ago - 1 year 1 month ago #334495
by Hakan
Replied by Hakan on topic AMSAMOTION IO module
Output of the command
will be a great starting point, maybe it even works right away.
Is this a 16 IN/OUT module? Then set the halType to "bit" for IN and OUT
and it will automatically generate 16 boolean pins. Check in halshow,
navigate to pins, lcec, 0 and so on.
Code:
$ lcec_configgen
Is this a 16 IN/OUT module? Then set the halType to "bit" for IN and OUT
and it will automatically generate 16 boolean pins. Check in halshow,
navigate to pins, lcec, 0 and so on.
Last edit: 1 year 1 month ago by Hakan.
The following user(s) said Thank You: ts
Please Log in or Create an account to join the conversation.
1 year 1 month ago #334613
by Kuzma30
Replied by Kuzma30 on topic AMSAMOTION IO module
I change name for IN OUT and add halType="bit"
Now I want run ladder for this module (to make plc program).
I have not motion axies. I get such errors during start
Is it possible run linuxcnc without axies (or with simulated axies)?
Code:
<masters>
<master idx="0">
<slave idx="0" type="generic" vid="0x00000b95" pid="0x00001101" name="D1">
<!--EC3A-IO1632-->
<syncManager idx="0" dir="in"/>
<syncManager idx="1" dir="out"/>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<!--DOOutputs process data mapping-->
<pdoEntry idx="7000" subIdx="01" bitLen="16" halPin="EC3A-do" halType="bit"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<!--DIInputs process data mapping-->
<pdoEntry idx="6000" subIdx="01" bitLen="16" halPin="EC3A-di" halType="bit"/>
</pdo>
</syncManager>
</slave>
</master>
</masters>
Now I want run ladder for this module (to make plc program).
Code:
cat ec3a.hal ec3a.ini
# Load real-time components
loadrt threads name1=servo-thread period1=1000000 # 1ms servo thread (matches XML appTimePeriod)
# Load EtherCAT driver with config XML
loadusr -W lcec_conf ec3a_io_hal.xml
loadrt lcec
# Load ClassicLadder (nogui mode, loading your project file)
#loadusr -W classicladder --nogui ec3a_ladder.clp
loadrt classicladder_rt
addf classicladder.0.refresh servo-thread
# Connect example I/O pins to ClassicLadder (map %I0-%I3 to inputs, %Q0-%Q3 to outputs)
# Expand to all 16 as needed
#net input-0 classicladder.0.in-00 <= lcec.0.0.EC3A-di.0
#net input-1 classicladder.0.in-01 <= lcec.0.0.EC3A-di.1
#net input-2 classicladder.0.in-02 <= lcec.0.0.EC3A-di.2
#net input-3 classicladder.0.in-03 <= lcec.0.0.EC3A-di.3
#net output-0 classicladder.0.out-00 => lcec.0.0.EC3A-do.0
#net output-1 classicladder.0.out-01 => lcec.0.0.EC3A-do.1
#net output-2 classicladder.0.out-02 => lcec.0.0.EC3A-do.2
#net output-3 classicladder.0.out-03 => lcec.0.0.EC3A-do.3[EMC]
# The version string for this INI file.
VERSION = 1.1
MACHINE = EtherCAT Machine
DEBUG = 1
[DISPLAY]
DISPLAY = axis
EDITOR = gedit
#PYVCP = pyvcp_panel.xml
# places the pyvcp panel at the bottom of the Axis window
PYVCP_POSITION = RIGHT
# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME = 0.100
# Path to help file
HELP_FILE = doc/help.txt
# Initial display setting for position, RELATIVE or MACHINE
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
# Prefix to be used
PROGRAM_PREFIX = /home/cnc/linuxcnc/nc_files
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 0
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
nc = /usr/bin/axis
[RS274NGC]
PARAMETER_FILE = linuxcnc.var
#[EMCMOT]
#EMCMOT = motmod
#COMM_TIMEOUT = 1.0
#BASE_PERIOD = 0
#SERVO_PERIOD = 1000000
[TASK]
TASK = milltask
CYCLE_TIME = 0.005
[HAL]
HALFILE = ec3a.hal
#SHUTDOWN = shutdown.hal
#HALFILE = custom.hal
#POSTGUI_HALFILE = pyvcp_panel.hal
HALUI = halui
#[HALUI]
[KINS]
KINEMATICS = trivkins coordinates=
JOINTS = 0
[TRAJ]
COORDINATES =
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 1.0
MAX_LINEAR_VELOCITY = 1.0
I have not motion axies. I get such errors during start
Code:
linuxcnc ec3a.ini
LINUXCNC - 2.9.4
Machine configuration directory is '/home/cnc/Завантажене'
Machine configuration file is 'ec3a.ini'
Starting LinuxCNC...
[EMCIO] CYCLE_TIME not found in /home/cnc/Завантажене/ec3a.ini; using default 0.100000
halui: no [TRAJ]COORDINATES specified, enabling all axes
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(REL): ./ec3a.hal
creating ladder-state
emcTrajSetJoints failing: joints=0
emcMotionInit: emcTrajInit failed
Missing [TRAJ]COORDINATES
Shutting down and cleaning up LinuxCNC...
USRMOT: ERROR: command timeout
HAL: ERROR: exit called before init
<commandline>:0: waitpid failed milltask inihal
<commandline>:0: milltask exited without becoming ready
Note: Using POSIX realtime
LinuxCNC terminated with an error. You can find more information in the log:
/home/cnc/linuxcnc_debug.txt
and
/home/cnc/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal
cat /home/cnc/linuxcnc_debug.txt
Can not find -sec TRAJ -var COORDINATES -num 1
3767
3797
Stopping realtime threads
Unloading hal components
cnc@cnc:~/Завантажене$ cat /home/cnc/linuxcnc_print.txt
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
INIFILE=/home/cnc/Завантажене/ec3a.ini
VERSION=1.1
PARAMETER_FILE=linuxcnc.var
TPMOD=
HOMEMOD=
TASK=milltask
HALUI=halui
DISPLAY=axis
COORDINATES=
KINEMATICS=trivkins coordinates=
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
Starting TASK program: milltask
Starting DISPLAY program: axis
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments
Is it possible run linuxcnc without axies (or with simulated axies)?
Please Log in or Create an account to join the conversation.
Time to create page: 0.233 seconds