Issue with halcmd show pin not showing pins.

More
11 Dec 2024 22:53 - 11 Dec 2024 22:55 #316484 by gbestwick
Hello everyone,
First, thank you to everyone who has been working hard on this aspect of LinuxCNC. Your work is greatly appreciated.

So, I have purchase a 16 in -16 out IO module to play with.

I have successfully got etherlab/ethercat installed. The service runs and when I run ethercat slaves I get:

0  0:0  PREOP  +  SG-ELC-ADIO-DI16-DO16-NPN(Digital 16-Input/16-Output)

When I run ethercat xml I get:
[code]
<?xml version="1.0" ?>
<EtherCATInfo>
  <!-- Slave 0 -->
  <Vendor>
    <Id>3992977410</Id>
  </Vendor>
  <Descriptions>
    <Devices>
      <Device>
        <Type ProductCode="#x00010204" RevisionNo="#x00000001">SG-ELC-ADIO-DI16-DO16-NPN(Digital 16-Input/16-Output)</Type>
        <Name><![CDATA[SG-ELC-ADIO-DI16-DO16-NPN(Digital 16-Input/16-Output)]]></Name>
        <Sm Enable="9" StartAddress="#xf02" ControlByte="#x44" DefaultSize="0" />
        <Sm Enable="9" StartAddress="#xf03" ControlByte="#x44" DefaultSize="0" />
        <Sm Enable="1" StartAddress="#x1000" ControlByte="#x0" DefaultSize="0" />
        <RxPdo Sm="0" Fixed="1" Mandatory="1">
          <Index>#x1a00</Index>
          <Name>Output Group 0</Name>
          <Entry>
            <Index>#x3101</Index>
            <SubIndex>1</SubIndex>
            <BitLen>8</BitLen>
            <Name>Output[00..07]</Name>
            <DataType>UINT8</DataType>
          </Entry>
        </RxPdo>
        <RxPdo Sm="1" Fixed="1" Mandatory="1">
          <Index>#x1a01</Index>
          <Name>Output Group 1</Name>
          <Entry>
            <Index>#x3101</Index>
            <SubIndex>2</SubIndex>
            <BitLen>8</BitLen>
            <Name>Output[08..15]</Name>
            <DataType>UINT8</DataType>
          </Entry>
        </RxPdo>
        <TxPdo Sm="2" Fixed="1" Mandatory="1">
          <Index>#x1600</Index>
          <Name>Input Group 0</Name>
          <Entry>
            <Index>#x3001</Index>
            <SubIndex>1</SubIndex>
            <BitLen>8</BitLen>
            <Name>Input[00..07]</Name>
            <DataType>UINT8</DataType>
          </Entry>
        </TxPdo>
        <TxPdo Sm="2" Fixed="1" Mandatory="1">
          <Index>#x1601</Index>
          <Name>Input Group 1</Name>
          <Entry>
            <Index>#x3001</Index>
            <SubIndex>2</SubIndex>
            <BitLen>8</BitLen>
            <Name>Input[08..15]</Name>
            <DataType>UINT8</DataType>
          </Entry>
        </TxPdo>
      </Device>
    </Devices>
  </Descriptions>
</EtherCATInfo>
I have created an XML file called ethercat-conf.xml and this is the contents:
[code]<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1">
    <!-- EtherCAT Slave -->
    <slave idx="0" type="generic" vid="0xee000002" pid="0x00010204" configPdos="true" name="D1">
      <dcConf assignActivate="300" sync0Cycle="1000000" sync0Shift="0"/>
      <!-- Sync Manager 0: Outputs Group 0 -->
      <syncManager idx="0" dir="out">
        <pdo idx="1a00">
          <pdoEntry idx="3101" subIdx="1" bitLen="8">
            <!-- Digital Outputs 1-8 -->
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-01" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-02" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-03" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-04" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-05" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-06" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-07" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-08" halType="bit"/>
          </pdoEntry>
        </pdo>
      </syncManager>

      <!-- Sync Manager 1: Outputs Group 1 -->
      <syncManager idx="1" dir="out">
        <pdo idx="1a01">
          <pdoEntry idx="3101" subIdx="2" bitLen="8">
            <!-- Digital Outputs 9-16 -->
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-09" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-10" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-11" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-12" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-13" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-14" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-15" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digout-16" halType="bit"/>
          </pdoEntry>
        </pdo>
      </syncManager>

      <!-- Sync Manager 2: Inputs Group 0 -->
      <syncManager idx="2" dir="in">
        <pdo idx="1600">
          <pdoEntry idx="3001" subIdx="1" bitLen="8">
            <!-- Digital Inputs 1-8 -->
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-01" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-02" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-03" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-04" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-05" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-06" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-07" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-08" halType="bit"/>
          </pdoEntry>
        </pdo>
        <pdo idx="1601">
          <pdoEntry idx="3001" subIdx="2" bitLen="8">
            <!-- Digital Inputs 9-16 -->
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-09" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-10" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-11" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-12" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-13" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-14" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-15" halType="bit"/>
            <complexEntry bitLen="1" halPin="lcec.0.0.digin-16" halType="bit"/>
          </pdoEntry>
        </pdo>
      </syncManager>
    </slave>
  </master>
</masters>

I run the command:
halcmd loadusr -W lcec_conf ethercat-config.xml
halcmd show pin lcec

I get:
Component Pins:
Owner   Type  Dir         Value  Name
     4  u32   OUT    0x00000001  lcec.conf.master-count
     4  u32   OUT    0x00000001  lcec.conf.slave-count


I feel like there should be a whole host of pins listed at this point. Can anyone please assist me? Mr. GPT hasn't got me anywhere.
[/code][/code]
Last edit: 11 Dec 2024 22:55 by gbestwick. Reason: Clarified messy code

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

More
12 Dec 2024 00:52 #316489 by rodw
I have found you need to create a complete config before the pins are able to be displayed.
Keep going and hook up your drives and create a basic cia402 ? config using axis.

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

More
12 Dec 2024 10:21 #316505 by onceloved
Replied by onceloved on topic Issue with halcmd show pin not showing pins.
You can add me as a friend on Discord or WeChat and I can help you configure remotely
Discord: onceloved.cn WeChat: 304394405

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

More
14 Dec 2024 00:37 #316619 by gbestwick
Replied by gbestwick on topic Issue with halcmd show pin not showing pins.
I found my problem!

It wasn't configuration at all, it was a very basic error where I hadn't started lcec!

halcmd loadrt lcec

That was it!

Thank you everyone for your time.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum