AMSAMOTION IO module

More
1 year 1 month ago #334495 by Hakan
Replied by Hakan on topic AMSAMOTION IO module
Output of the command
Code:
$ 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.

Please Log in to join the conversation.

More
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"
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 to join the conversation.

More
1 year 1 month ago #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
Code:
$ halcmd -f ec3a.hal
Maybe you can puzzle something together.

Please Log in to join the conversation.

More
1 year 1 month ago #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
 

Please Log in to join the conversation.

More
1 year 1 month ago #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 to join the conversation.

More
1 year 1 month ago #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 to join the conversation.

More
3 months 6 days ago #348042 by Luczia
Replied by Luczia on topic AMSAMOTION IO module
Hello @Kuzma30,

I'm looking at starting a EtherCAT build and considering the AMSAMOTION EC3A IO1632. Have you been able to make it work on your setup and could you share the EtherCAT-config.xml file ?


Thanks ! 

Please Log in to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum