-
Notifications
You must be signed in to change notification settings - Fork 4
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
How to add CommandItem? #6
Comments
That length 20 is probably right. I pushed a new commit e5d42d5 Giselle.Net.EtherNetIP/Giselle.Net.EtherNetIP/ENIP/ENIPCodec.cs Lines 147 to 149 in e5d42d5
Try upper code like to below and test. public DataProcessor GetAttribute(Stream stream, AttributePath path) => this.ExchangeSendRRData(stream,
this.CIPCodec.HandleGetAttribute, // This is response callback
// Array of CommandItem for send
new CommandItemNull(), this.CIPCodec.CreateGetAttribute(path)); I'm not currently in a situation where I can test, sorry. |
else.. can you send screenshot showing length when success? |
Success! Additionally, the link to the program I used for packet comparison is as follows: |
Fixed an issue where ForwardOpen's SendRRData wasn't passing the Originator's UDP port number right now. 45eca2e |
public ForwardOpenResult ForwardOpen(Stream stream, ForwardOpenOptions options) => this.ExchangeSendRRData(stream, |
Oops, i forgot it. In this code, Giselle.Net.EtherNetIP/Giselle.Net.EtherNetIP/CIP/CIPCodec.cs Lines 54 to 62 in 45eca2e
Try edit like this. public IEnumerable<CommandItem> CreateForwardOpen(ForwardOpenOptions options)
{
// Add this line
yield return new CommandItemNull();
var udRequest = new CommandItemUnconnectedDataRequest(); |
'yield return new CommandItemNull();' is will instead of it. |
Currently everything is OK, but in my case, ConfigData must be added to ForwardOpen. Below is the Python implementation code: path = struct.pack(">I",0x34040000) + struct.pack("I",0) + how should I correspondingly add it to project? P.S. The Configuration Assembly ID should be set in this location of the CreateForwardOpen method: |
Is it work?????? AWESOME. |
My BALLUFF EtherNet/IP Scanner for IO-Link (referred to by BALLUFF as EtherNet/IP IO-LINK Master by EIP) needs to go through a configuration process. Only after this, the TO/OT UDP data will carry information, otherwise, its content is empty. However, other communications are currently functioning normally. If I first connect it to a PLC (which has an EDS that can be viewed), and then go through the PLC's configuration process, the data can be normally obtained on the C# program side. I plan to capture packets on the PLC equipment, but I currently don't have a port mirroring switch, so you'll need to wait for me for a bit. |
I want to add the following configData to connectionPath. How can I do that? (How to modify EPathSegmentLogical.cs?)" int Configuration_Length = 194; |
The InstanceID of the Assembly you use for ForwardOpen is 0x64, 0x65? |
yes, just like following code: // Reserved
And all setting and data will define in EDS that PLC will be automatically configured, so there is no need for manual setup like we do. |
Already complete? Wow.. you genius.. I been had push a new commit 818c125 just right now. var connectionPath = new EPath
{
EPathSegmentLogical.FromClassID(options.ClassID),
EPathSegmentLogical.FromInstanceID(0x01)
};
if (options.O_T_Assembly.ConnectionType != ConnectionType.Null)
{
connectionPath.Add(EPathSegmentLogical.FromConnectionPointID(options.O_T_Assembly.InstanceID));
}
if (options.T_O_Assembly.ConnectionType != ConnectionType.Null)
{
connectionPath.Add(EPathSegmentLogical.FromConnectionPointID(options.T_O_Assembly.InstanceID));
}
// Add this line
connectionPath.Add(new EPathSegmentData(KnownEPathDataSegmentType.Simple, new byte[] { your config data }));
connectionPath.Write(reqProcessor); |
"Simple Data Segment" in Connection Path type is 0x80 |
Wait.. i saw a typo... |
Now i think it should work. c72f731 |
please fix bug: AND... |
How length does pass when length is odd? I have plan for port change. |
Can change PC port with Giselle.Net.EtherNetIP/Giselle.Net.EtherNetIP.Test/ImplicitMessaging.cs Lines 90 to 110 in 34acf84
When change O_T_UDPPort to 1234 var openOptions = new ForwardOpenOptions();
openOptions.T_O_UDPPort = 1234; // Support alternate port, Default is 2222 |
A few questions are listed below for discussion, and I suggest you can commit back to the main branch, thank you:
options.LocalAddress = ((IPEndPoint)this.TcpClient.Client.LocalEndPoint).Address; -> options.LocalAddress = ((IPEndPoint)this.TcpClient.Client.LocalEndPoint).Address.MapToIPv4(); search all "TcpClient(" and "UDPClient{",then add: new TcpClient(AddressFamily.InterNetwork) and new UdpClient(AddressFamily.InterNetwork) |
|
|
In my case,
sending get attribute single will get will get "incorrect data" RR,
I compared this with other Python projects, and the packets sent out from them were successful. The differences between the two are shown in the two pictures below. In this case, there is one less CommandItemNull in the CommandItem. Could you guide me on how to add and test this?
The text was updated successfully, but these errors were encountered: