Replies: 1 comment 2 replies
-
Yes you should be able to add components to the device using the Device property and Agent.AddDevice() method such as below: protected override void OnRead()
{
// Create a Path Component
var path = new PathComponent();
// Add Path DataItems
path.AddDataItem<ProgramDataItem>();
// Add the Path Component as a child of the Controller Component
controller.AddComponent(path);
// Add the Controller Component to the Device
Device.AddComponent(controller);
// Re-Add the Device to trigger DeviceChanged event
Agent.AddDevice(Device);
} Let me know if this works for you or if you run into any issues. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Given this example, https://github.com/TrakHound/MTConnect.NET/tree/master/examples/MTConnect.NET-Agent-Embedded, is it possible to add components to the device in the OnRead method? Or does the component hierarchy have to be built inside OnAddDevice method?
Beta Was this translation helpful? Give feedback.
All reactions