Rickedb / OpenProtocolInterpreter

Converts the ugly ASCII package that came from Open Protocol to an object
MIT License
144 stars 72 forks source link

MID 61 Tightening subscription successful, but package is not received when tightening is performed [Help needed, question] #114

Closed SrividhyaRavichandran closed 3 weeks ago

SrividhyaRavichandran commented 4 weeks ago

Program output:

Sending Tightening Subscribe... Sending message: 00200060001
Response: 00240005 00000060 Tightening Subscribe accepted!

Sending Keep Alive... Sending message: 00209999
Response: 00209999 0000 Keep Alive Received

Atlas Copco PF 4000. Tightening subscription is successful. But when i perform the tightening, below method is not getting executed. Any help in debugging will be highly appreciated. I am new to working with the controllers. Thank you

protected virtual void OnPackageReceived(object sender, Message message)
{
    try
    {
        Console.WriteLine($"Message arrived: {message.MessageString}");

        var mid = this._midInterpreter.Parse(message.MessageString);
        var action = this.OnReceivedMID.FirstOrDefault(x => x.Key == mid.GetType());

        if (action.Equals(default(KeyValuePair<Type, ReceivedCommandActionDelegate>)))
        {
            Console.WriteLine($"NO ACTION WAS REGISTERED TO MID: {mid.GetType()}");
            return;
        }

        action.Value(new MIDIncome() { Mid = mid });
    }
    catch (Exception ex)
    {
        Console.WriteLine($"Exception: {ex.Message}");
    }
}
Rickedb commented 3 weeks ago

If this is from the sample, it seems that your controller is not sending Mid 0061 when tightening is performed. If you were receiving any messages it would output the mid 0061 ASCII string followed by no action registered, like:

Message arrived: 0061....
NO ACTION WAS REGISTERED TO MID: Mid0061

Is the controller configured correctly? I remember having to do some configuration for enabling open protocol and some features (specially setting jobs) And, for instance, is it using the newest firmware?

SrividhyaRavichandran commented 3 weeks ago

Thank you for your reply. I will check on the firmware version. Yes, I am using the sample program from the repo and have doubt on the controller configuration. I got the response MID 5 for the subscription request. So its enable for Open protocol communication. I created the psets in the controller and triggered the tightening via psets. The problem is I couldn't get the user guide manual for PF4000 to check my configuration. I have one pdf which was released in 2007. Can you please refer to any resource for the controller configuration and how to trigger tightening if possible? Thank you

Rickedb commented 3 weeks ago

You need to set a Job at the controller, which could be done manually by setting it through the controller panel or via open protocol (if enabled). Once done, if the tool is rotating the fuse when you trigger the tool's button, then it must send you Mid0061 if you're subscribed.

Unfortunately I don't have any documentation about of how to configure the controller physically. I only remember doing it by navigating on every setting at it and trying out

SrividhyaRavichandran commented 3 weeks ago

Thank you. I will check the tightening via jobs instead of psets. Your help is much appreciated :)