For example, TagWrite("PLC_Array", 24, 4) will set the 14th element in PLC_Array to 24 (because means the 10th element, and an offset of 4 means 4 elements after the 10th = element 14).Īn optional boolean argument that specifies whether theĬommand is synchronous (blocking) or asynchronous (non-īlocking). Note: If you enter an array index as part of the sValue argument, it will be added to this offset value. If you enter an array offset using the nOffset argument, it will be added to the index value. The above example tells the function to write to the 10th element in the array variable PLC_Array (remember, the address of the first element in an array is 0 (zero)). To write to a particular element in an array, you can enter the array name here, followed by an index to the element as follows: The correct format, and then writes it to the variable. Is specified as a string, however if an integer or real is used the compiler will convert it to a string. The value to be written to the I/O device variable. Note: If the tag name exceeds the length limit of 254 characters the hardware alarm "Tag name exceed length limit" will be raised. The name of the tag can be prefixed by the name of the cluster, for example, "ClusterName.Tag" or "". If the element name is not specified, the writing will be performed to the Field VQT element. An alarm equipment item property - for example, "".An alarm property - for example, "AlarmFire1.On".An equipment item property - for example, "".A tag property - for example, "Fire1.v".An equipment item reference - for example, "Motor1.Fire".TagWrite( STRING Tag, STRING sValue )Ī string that can be one of the following: This function checks a value before writing it to a PLC. Note: When using this function and parameter ScaleCheck is set to 1, the attempt to write an out-of-range value to a device will not occur.
0 Comments
Leave a Reply. |