Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makes PDO index range compatible to ds301 and allows gaps inside #10

Merged
merged 2 commits into from Nov 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EDSTest/DevicePDOView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void updatePDOinfo()



for (UInt16 idx = startcob; idx < startcob+0x00ff; idx++)
for (UInt16 idx = startcob; idx < startcob+0x01ff; idx++)
{
if (eds.ods.ContainsKey(idx))
{
Expand Down
16 changes: 10 additions & 6 deletions libEDSsharp/CanOpenNodeExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,8 @@ void export_record_types(StreamWriter file)
int noRXpdos = 0;
int noSDOclients = 0;
int noSDOservers = 0;
int distTXpdo = 0;
int distRXpdo = 0;
int noSYNC = 0;
int noEMCY = 0;

Expand All @@ -898,14 +900,16 @@ void countPDOS()
if (kvp.Value.Disabled == true)
continue;

if ((index & 0xFF00) == 0x1400)
if (index >= 0x1400 && index < 0x1600)
{
noRXpdos++;
distRXpdo = index - 0x1400;
}

if ((index & 0xFF00) == 0x1800)
if (index >= 0x1800 && index < 0x1A00)
{
noTXpdos++;
distTXpdo = index - 0x1800;
}

if((index & 0xFF80) == 0x1200)
Expand Down Expand Up @@ -958,16 +962,16 @@ bool arrayspecial(UInt16 index, bool open)
if (index == 0x1280 + noSDOclients - 1)
return true;

if (index == 0x1400 + noRXpdos - 1)
if (index == 0x1400 + distRXpdo )
return true;

if (index == 0x1600 + noRXpdos - 1)
if (index == 0x1600 + distRXpdo )
return true;

if (index == 0x1800 + noTXpdos - 1)
if (index == 0x1800 + distTXpdo )
return true;

if (index == 0x1a00 + noTXpdos - 1)
if (index == 0x1a00 + distTXpdo )
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions libEDSsharp/eds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1240,10 +1240,10 @@ public void updatePDOcount()
foreach(KeyValuePair<UInt16,ODentry> kvp in ods)
{
ODentry od = kvp.Value;
if(od.Disabled==false && ((od.index&0xFF00) == 0x1400 ))
if(od.Disabled==false && od.index >= 0x1400 && od.index < 0x1600)
di.NrOfRXPDO++;

if(od.Disabled==false && ((od.index&0xFF00) == 0x1800 ))
if(od.Disabled==false && od.index >= 0x1800 && od.index < 0x1A00)
di.NrOfTXPDO++;

}
Expand Down