AMSAMOTION IO module

More
05 Sep 2025 11:27 #334484 by Kuzma30
Replied by Kuzma30 on topic AMSAMOTION IO module
I have such info for my module.
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.

More
05 Sep 2025 14:01 - 05 Sep 2025 14:12 #334495 by Hakan
Replied by Hakan on topic AMSAMOTION IO module
Output of the command
$ lcec_configgen
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.
Last edit: 05 Sep 2025 14:12 by Hakan.
The following user(s) said Thank You: ts

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

More
08 Sep 2025 10:24 #334613 by Kuzma30
Replied by Kuzma30 on topic AMSAMOTION IO module
I change name for IN OUT and add halType="bit"
<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).
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
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.

More
08 Sep 2025 16:44 #334640 by Hakan
Replied by Hakan on topic AMSAMOTION IO module
Don't know the answer to that question.

Linuxcnc is the execution of a number of halfiles by halcmd.
Check /usr/bin/linuxcnc for how it is done, it's a bash script.

You can execute the hal statements in the ec3a.hal file with
$ halcmd -f ec3a.hal
Maybe you can puzzle something together.

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

More
12 Sep 2025 22:01 #334900 by tnl1
Replied by tnl1 on topic AMSAMOTION IO module
Start with the configuration with the lpt port, then make changes to the *.hal file linuxcnc, if there is no physical lpt, then just comment out the lines using it... Attached is xml for 1631 and aq0810 from amsamotion
 
Attachments:
The following user(s) said Thank You: Kuzma30

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

More
12 Sep 2025 22:22 #334903 by tnl1
Replied by tnl1 on topic AMSAMOTION IO module
Oh yeah, forgot to add, modules 1631 and probably 1632 have data values ​​output to port 2^16, so you'll need a bitslice conversion, not individual bit values ​​for input/output in your *.hal file

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

More
15 Sep 2025 06:09 #335005 by Kuzma30
Replied by Kuzma30 on topic AMSAMOTION IO module
I add pci-e to lpt controller in PC.
Then linuxcnc was started and I checked in / out ports in Hal monitor.

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

Time to create page: 0.115 seconds
Powered by Kunena Forum