How do I Read / Write Text Strings to a PLC using the OPC Server?

Modified on Mon, 6 Oct, 2025 at 9:19 AM

Attached is an example application to demonstrate Reading / Writing Text to a PLC using the OPC Server , two methods are shown:

1) When creating a new OPC point the default data type is Byte Array. The first example shows how to read the data in the byte array and convert to ACSII characters for display. When writing text the ASCII characters are converted to the format required by the Byte Array.

2) The preferred method is to use the second example using String data types and requires no specific conversion. When adding the OPC point the Data type format must be changed from Byte Array to String. When using this method it is important to Dimension the variable used for writing as a String.

 




 


 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article