AMSAMOTION IO module
- mwc
- Offline
- Premium Member
-
- Posts: 121
- Thank you received: 12
The main reason I've selected this module is for the Analogue Inputs, as I want to use one for a Plasma THC, and another for FRO.
I've had it connected for a while, but have been concentrating on the Lichuan drivers first, so as it stands, I've only got as far as the lcec_configgen output -
<slave idx="3" type="generic" vid="0x00000b96" pid="0x00001400" name="D4">
<!--EC1A-CORE1-->
<syncManager idx="0" dir="in"/>
<syncManager idx="1" dir="out"/>
<syncManager idx="2" dir="out">
<pdo idx="1601">
<!--Digital Output process data mapping-->
<pdoEntry idx="7010" subIdx="01" bitLen="16" halPin="mapping-ch" halType="!!type 002e!!"/>
</pdo>
<pdo idx="1603">
<!--Analog Output process data mapping-->
<pdoEntry idx="7030" subIdx="01" bitLen="16" halPin="mapping-ch0" halType="u32"/>
<pdoEntry idx="7030" subIdx="02" bitLen="16" halPin="mapping-ch1" halType="u32"/>
</pdo>
<pdo idx="1605">
<!--Modbus Master Control process data mapping-->
<pdoEntry idx="7050" subIdx="01" bitLen="32" halPin="tigger-bit" halType="!!type 002f!!"/>
<pdoEntry idx="7050" subIdx="02" bitLen="32" halPin="clear-bit" halType="!!type 002f!!"/>
<pdoEntry idx="7050" subIdx="03" bitLen="8" halPin="rs485-enable" halType="!!type 001e!!"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<!--Digital Input process data mapping-->
<pdoEntry idx="6000" subIdx="01" bitLen="16" halPin="mapping-ch" halType="!!type 002e!!"/>
</pdo>
<pdo idx="1a02">
<!--Analog Input process data mapping-->
<pdoEntry idx="6020" subIdx="01" bitLen="16" halPin="mapping-ch0" halType="u32"/>
<pdoEntry idx="6020" subIdx="02" bitLen="16" halPin="mapping-ch1" halType="u32"/>
<pdoEntry idx="6020" subIdx="03" bitLen="16" halPin="ch2" halType="u32"/>
<pdoEntry idx="6020" subIdx="04" bitLen="16" halPin="ch3" halType="u32"/>
</pdo>
<pdo idx="1a04">
<!--Data process data mapping-->
<pdoEntry idx="6040" subIdx="01" bitLen="16" halPin="word0" halType="u32"/>
<pdoEntry idx="6040" subIdx="02" bitLen="16" halPin="word1" halType="u32"/>
<pdoEntry idx="6040" subIdx="03" bitLen="16" halPin="word2" halType="u32"/>
<pdoEntry idx="6040" subIdx="04" bitLen="16" halPin="word3" halType="u32"/>
<pdoEntry idx="6040" subIdx="05" bitLen="16" halPin="word4" halType="u32"/>
<pdoEntry idx="6040" subIdx="06" bitLen="16" halPin="word5" halType="u32"/>
<pdoEntry idx="6040" subIdx="07" bitLen="16" halPin="word6" halType="u32"/>
<pdoEntry idx="6040" subIdx="08" bitLen="16" halPin="word7" halType="u32"/>
</pdo>
<pdo idx="1a05">
<!--Data process data mapping-->
<pdoEntry idx="6050" subIdx="01" bitLen="8" halPin="err0" halType="s32"/>
<pdoEntry idx="6050" subIdx="02" bitLen="8" halPin="err1" halType="s32"/>
<pdoEntry idx="6050" subIdx="03" bitLen="8" halPin="err2" halType="s32"/>
<pdoEntry idx="6050" subIdx="04" bitLen="8" halPin="err3" halType="s32"/>
<pdoEntry idx="6050" subIdx="05" bitLen="8" halPin="err4" halType="s32"/>
<pdoEntry idx="6050" subIdx="06" bitLen="8" halPin="err5" halType="s32"/>
<pdoEntry idx="6050" subIdx="07" bitLen="8" halPin="err6" halType="s32"/>
<pdoEntry idx="6050" subIdx="08" bitLen="8" halPin="err7" halType="s32"/>
<pdoEntry idx="6050" subIdx="09" bitLen="8" halPin="err8" halType="s32"/>
<pdoEntry idx="6050" subIdx="0a" bitLen="8" halPin="err9" halType="s32"/>
<pdoEntry idx="6050" subIdx="0b" bitLen="8" halPin="err10" halType="s32"/>
<pdoEntry idx="6050" subIdx="0c" bitLen="8" halPin="err11" halType="s32"/>
<pdoEntry idx="6050" subIdx="0d" bitLen="8" halPin="err12" halType="s32"/>
<pdoEntry idx="6050" subIdx="0e" bitLen="8" halPin="err13" halType="s32"/>
<pdoEntry idx="6050" subIdx="0f" bitLen="8" halPin="err14" halType="s32"/>
<pdoEntry idx="6050" subIdx="10" bitLen="8" halPin="err15" halType="s32"/>
<pdoEntry idx="6050" subIdx="11" bitLen="8" halPin="err16" halType="s32"/>
<pdoEntry idx="6050" subIdx="12" bitLen="8" halPin="err17" halType="s32"/>
<pdoEntry idx="6050" subIdx="13" bitLen="8" halPin="err18" halType="s32"/>
<pdoEntry idx="6050" subIdx="14" bitLen="8" halPin="err19" halType="s32"/>
<pdoEntry idx="6050" subIdx="15" bitLen="8" halPin="err20" halType="s32"/>
<pdoEntry idx="6050" subIdx="16" bitLen="8" halPin="err21" halType="s32"/>
<pdoEntry idx="6050" subIdx="17" bitLen="8" halPin="err22" halType="s32"/>
<pdoEntry idx="6050" subIdx="18" bitLen="8" halPin="err23" halType="s32"/>
<pdoEntry idx="6050" subIdx="19" bitLen="8" halPin="err24" halType="s32"/>
<pdoEntry idx="6050" subIdx="1a" bitLen="8" halPin="err25" halType="s32"/>
<pdoEntry idx="6050" subIdx="1b" bitLen="8" halPin="err26" halType="s32"/>
<pdoEntry idx="6050" subIdx="1c" bitLen="8" halPin="err27" halType="s32"/>
<pdoEntry idx="6050" subIdx="1d" bitLen="8" halPin="err28" halType="s32"/>
<pdoEntry idx="6050" subIdx="1e" bitLen="8" halPin="err29" halType="s32"/>
<pdoEntry idx="6050" subIdx="1f" bitLen="8" halPin="err30" halType="s32"/>
<pdoEntry idx="6050" subIdx="20" bitLen="8" halPin="err31" halType="s32"/>
</pdo>
</syncManager>
</slave>
Now this obviously doesn't work, as there are a few unknown halTypes, so I'm expecting a few issues along the way to getting this working, however it's a job for tomorrow night, as I'm needing to go and get some sleep, but first step will be getting the Digital IO working.
Please Log in or Create an account to join the conversation.
- mwc
- Offline
- Premium Member
-
- Posts: 121
- Thank you received: 12
AO0 looped back to AI0 gives comparable readings.
All it took was a bit copying and pasting, a few minor value edits, and I have the Analogue and Digital IO working with the following code-
<slave idx="3" type="generic" vid="0x00000b96" pid="0x00001400" name="D4">
<!--EC1A-CORE1-->
<syncManager idx="0" dir="in"/>
<syncManager idx="1" dir="out"/>
<syncManager idx="2" dir="out">
<pdo idx="1601">
<!--Digital Output process data mapping-->
<pdoEntry idx="7010" subIdx="01" bitLen="16" halPin="DO-bit" halType="bit"/>
</pdo>
<pdo idx="1603">
<!--Analog Output process data mapping-->
<pdoEntry idx="7030" subIdx="01" bitLen="16" halPin="AO0" halType="u32"/>
<pdoEntry idx="7030" subIdx="02" bitLen="16" halPin="AO1" halType="u32"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<!--Digital Input process data mapping-->
<pdoEntry idx="6000" subIdx="01" bitLen="16" halPin="DI-bit" halType="bit"/>
</pdo>
<pdo idx="1a02">
<!--Analog Input process data mapping-->
<pdoEntry idx="6020" subIdx="01" bitLen="16" halPin="AI0" halType="u32"/>
<pdoEntry idx="6020" subIdx="02" bitLen="16" halPin="AI1" halType="u32"/>
<pdoEntry idx="6020" subIdx="03" bitLen="16" halPin="AI2" halType="u32"/>
<pdoEntry idx="6020" subIdx="04" bitLen="16" halPin="AI3" halType="u32"/>
</pdo>
</syncManager>
</slave>
Obviously doesn't include the ModBus stuff, but I have no use for that.
The lcec_configgen halPin naming did use duplicate names, and the unknown halTypes ( !!type 002e!! ) can be set to either bit or u32 depending on your own preferred usage. I've used bit for now.
Attachments:
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
- Posts: 12170
- Thank you received: 4153
<pdoEntry idx="6000" subIdx="01" bitLen="16" halPin="DI-bit" halType="bit"/>
eg
<pdoEntry idx="60FD" subIdx="0" bitLen="32" halType="complex">
<complexEntry bitLen="1" halPin="CW-limit" halType="bit"/>
<complexEntry bitLen="1" halPin="CCW-limit" halType="bit"/>
<complexEntry bitLen="1" halPin="in-home" halType="bit"/>
<complexEntry bitLen="13"/>
<complexEntry bitLen="1" halPin="in-1" halType="bit"/>
<complexEntry bitLen="1" halPin="in-2" halType="bit"/>
<complexEntry bitLen="1" halPin="in-3" halType="bit"/>
<complexEntry bitLen="1" halPin="in-4" halType="bit"/>
<complexEntry bitLen="1" halPin="in-5" halType="bit"/>
<complexEntry bitLen="1" halPin="in-6" halType="bit"/>
<complexEntry bitLen="10"/>
</pdoEntry> Please Log in or Create an account to join the conversation.