#!/bin/bash

ethercat -p0 -t uint8 download 0x1C12 0 0                               #CLEAR SM PDO 0x1c12

ethercat -p0 -t uint32 download 0x1400 1 0x80000201             #RXPDO1 DISABLED

ethercat -p0 -t uint32 download 0x1401 1 0x80000301             #RXPDO2 DISABLED

ethercat -p0 -t uint32 download 0x1402 1 0x80000401             #RXPDO3 DISABLED
ethercat -p0 -t uint8 download 0x1602 0 0                               #RXPDO3 clear mapping
ethercat -p0 -t uint32 download 0x1602 1 0x60400010             #RXPDO3 control word
ethercat -p0 -t uint32 download 0x1602 2 0x60C10120             #RXPDO3 target position
ethercat -p0 -t uint8 download 0x1602 0 0x02                    #RXPDO3 two items mapped
ethercat -p0 -t uint8 download 0x1402 2 0x01                    #RXPDO3 implement on SYNC from master
ethercat -p0 -t uint32 download 0x1402 1 0x0401                 #RXPDO3 ENABLED

ethercat -p0 -t uint32 download 0x1403 1 0x80000501             #RXPDO4 DISABLED

ethercat -p0 -t uint32 download 0x1800 1 0x80000181             #TXPDO1 DISABLED

ethercat -p0 -t uint32 download 0x1801 1 0x80000281             #TXPDO2 DISABLED

ethercat -p0 -t uint32 download 0x1802 1 0x80000381             #TXPDO3 DISABLED
ethercat -p0 -t uint8 download 0x1A02 0 0x0                             #TXPDO3 clear mapping
ethercat -p0 -t uint32 download 0x1A02 1 0x60410010             #TXPDO3 status word
ethercat -p0 -t uint32 download 0x1A02 2 0x60630020             #TXPDO3 actual position
ethercat -p0 -t uint8 download 0x1A02 0 0x02                    #TXPDO3 two items mapped
ethercat -p0 -t uint8 download 0x1802 2 0x01                    #TXPDO3 implement on SYNC from master
ethercat -p0 -t uint32 download 0x1802 1 0x00000381             #TXPDO3 ENABLED

ethercat -p0 -t uint32 download 0x1803 1 0x80000481             #TXPDO4 DISABLED
ethercat -p0 -t uint8 download 0x1A03 0 0x0                             #TXPDO4 clear mapping
ethercat -p0 -t uint32 download 0x1A03 1 0x60F40010             #TXPDO4 status word
ethercat -p0 -t uint8 download 0x1A03 0 0x01                    #TXPDO4 one item mapped
ethercat -p0 -t uint8 download 0x1803 2 0x01                    #TXPDO4 implement on SYNC from master
ethercat -p0 -t uint32 download 0x1803 1 0x00000481             #TXPDO4 ENABLED
