Acop Link Example
| Use the ACOP Link component for attaching to an ACOP link target and handling the update events yourself.
The ACOP Link component is not a GUI component and will not be visible on the application.
As such, there are no Acop.Display properties available.
One can have a modicum of automation (e.g. by setting AutoLinkAttach to true) if desired. However, the component itself is more or less a helper utility when one needs to program specfic transport link parameters and behavior not covered in the ACOP smart component tool set.
|
Acop Link transport properties
| AutoLinkAttach: if set to true it instructs ACOP to automatically monitor the data provided by LinkAddress and LinkProperty
AutoLinkCapacity: if AutoLinkAttach = true and AutoLinkCapacity = 0 then ACOP will attempt to determine the proper data size to obtain for the LinkAddress and LinkProperty specified. If it is know beforehand that this will result in an array and only a sub-portion of the array is desired (for instance only a single value from a multi-channel array) then the AutoLinkCapacity can be set to the desired data size.
DefaultMonitorInterval is the value in milliseconds of the monitor display interval used when AutoLinkAttach = true. (default = 1000).
LinkAddress specifies the control system endpoint to which the data link is to be attached. This value is composed of the LinkContext, LinkServer, and LinkDevice properties with separator = "/". An ACOP transport plug which makes use of another separator (e.g. channel access) should be prepared to map such address to and from the ACOP address space.
LinkContext is the top most hierarchical element of the LinkAddress, identifying, e.g. the specific facility.
LinkDevice is the bottom most hierarchical element of the LinkAddress, indentifying e.g. a specific location or device instance.
LinkFlags specifies any optional link flags which help to establish the underlying data link. These are often protocol dependent.
LinkGrouped if true it instructs ACOP to make use of a single update event when all underlying data links (should there be more than one) have updated.
LinkInputValue if this is non empty, then the value given will be used as additional input when establishing the underlying data link.
LinkProperty specifies the target property of the LinkAddress which is to return data to the component.
LinkProtocol specifies the transport protocol (and hence which transport plug) to make use of when acquiring the given LinkAddress.
LinkServer is the middle hierarchical element of the LinkAddress, indentifying e.g. a specific host process.
LinkSubSystem an additional browsing element to help reduce the number of LinkServer elements shown in the browsing combo boxes.
|
Examples
The code snippet below makes use of a normal button control's click event to start a motor scan procedure. It makes use of an AcopLink component to move a motor to position 0 and enables a Timer component which handles the scan activities.
private void ScanBtn_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
acopLink1.LinkProperty = "Move.START";
int cc = acopLink1.Execute(null, 0.0, "WRITE", 1000);
if (cc != 0)
{
System.Diagnostics.Debug.WriteLine(
"Error!" + cc);
}
}