Industrial Automation
Industrial Automation | Europe


Main > Product Type > Software
Minimize Text   Default    Enlarge Text


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

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.





TextReadWrite.cdm - Size: 171520
TextReadWrite.opc - Size: 985
TextReadWrite.xls - Size: 108544

Comments (View All Comments / Add Comment)

Related Articles
No related articles found.
Created 2008-10-26
Modified 2009-04-30
Views 7753


You are not logged in.