Hi all,
I'm working with a bunch of 842E-M encoders. None of them are doing anything especially high speed/high accuracy, they're just helping me position a shuttle conveyor over one of 8 bins. Each of them have a homing sensor set up which I will use to zero the encoder.
I'm writing a simple AOI to manage the encoders, and I'd like to implement the zero-ing function within the AOI. However, the zero command can only be given using a MSG instruction.
I can use a MSG instruction within an AOI, as long as it's passed as an InOut parameter, and it can't be configured inside the AOI definition. Once I drop an instance of the AOI on a rung, I can click to configure each MSG instruction. This is fine, but setting up a dozen MSG instructions is tedious and prone to user error. The following parameters will need to be set:
Message Type: CIP Generic
Service Type: Set Attribute Single
Service Code: 10 (Hex)
Class: 23 (Hex)
Instance: 1
Attribute: 13 (Hex)
Source Element: [sub-element of AOI]
Source Length: 4
Path: [IP of encoder]
My question is, how much of this can/should I manipulate programatically within the AOI, to avoid the possibility of data entry error? I've read several posts where the indubitable Ken Roach warns that as soon as you do this, you're heading into unsupported territory. But at the end of the day, I figure the risk is low as I'm not dynamically configuring anything - it'll all be based on fixed settings, and it'll either work or it won't.
Here's my current thinking:
Message Type: I can't see any way to change this programmatically. Since the setting I need is the default setting anyway, probably not an issue.
Service Type: I again can't see any way to set this programmatically. Although, would I be correct in suggesting that if I leave it as "Custom" - which is the default - it will work anyway, as long as I ensure to put the "10" in the Service Code field? Which may be moot anyway because...
Service Code: I can't see any way to set this programmatically.
Class, Instance and Attribute: all appear to be easily able to be manipulated in the MESSAGE control block
Source Element: Can't see a way to manipulate this programatically
Source Length: Appears to be the REQ_LEN element of the control block
Path: This I would presumably have to set up manually. Although I am passing the module itself into the AOI as an InOut parameter, so if there's a clever way to poke it's path across to the MSG instruction, I'd be interested to hear it!
Anyone got ideas/suggestions/experience/helpful info to share?
I'm working with a bunch of 842E-M encoders. None of them are doing anything especially high speed/high accuracy, they're just helping me position a shuttle conveyor over one of 8 bins. Each of them have a homing sensor set up which I will use to zero the encoder.
I'm writing a simple AOI to manage the encoders, and I'd like to implement the zero-ing function within the AOI. However, the zero command can only be given using a MSG instruction.
I can use a MSG instruction within an AOI, as long as it's passed as an InOut parameter, and it can't be configured inside the AOI definition. Once I drop an instance of the AOI on a rung, I can click to configure each MSG instruction. This is fine, but setting up a dozen MSG instructions is tedious and prone to user error. The following parameters will need to be set:
Message Type: CIP Generic
Service Type: Set Attribute Single
Service Code: 10 (Hex)
Class: 23 (Hex)
Instance: 1
Attribute: 13 (Hex)
Source Element: [sub-element of AOI]
Source Length: 4
Path: [IP of encoder]
My question is, how much of this can/should I manipulate programatically within the AOI, to avoid the possibility of data entry error? I've read several posts where the indubitable Ken Roach warns that as soon as you do this, you're heading into unsupported territory. But at the end of the day, I figure the risk is low as I'm not dynamically configuring anything - it'll all be based on fixed settings, and it'll either work or it won't.
Here's my current thinking:
Message Type: I can't see any way to change this programmatically. Since the setting I need is the default setting anyway, probably not an issue.
Service Type: I again can't see any way to set this programmatically. Although, would I be correct in suggesting that if I leave it as "Custom" - which is the default - it will work anyway, as long as I ensure to put the "10" in the Service Code field? Which may be moot anyway because...
Service Code: I can't see any way to set this programmatically.
Class, Instance and Attribute: all appear to be easily able to be manipulated in the MESSAGE control block
Source Element: Can't see a way to manipulate this programatically
Source Length: Appears to be the REQ_LEN element of the control block
Path: This I would presumably have to set up manually. Although I am passing the module itself into the AOI as an InOut parameter, so if there's a clever way to poke it's path across to the MSG instruction, I'd be interested to hear it!
Anyone got ideas/suggestions/experience/helpful info to share?