AdvancedHMI Software
General Category => Support Questions => Topic started by: sds5150 on February 07, 2020, 04:45:12 PM
-
We have a PLC tag that is defined as a String1 which has a max character of 1
How do I write to this tag?
When I try to do a
Write(String.Format("Q3_Pan[0].Part.Type.Code", "x")
I get the following error
MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException: 'Unknown data type. Unable to create byte stream. 50345'
Thanks
-
Your code is missing a bracket and seems to be incorrect format all together.
Have you tried Write("Q3_Pan[0].Part.Type.Code", "x")?
See also what response you will get if you try using:
WriteCustomString(ByVal tagName As String, ByVal value As String, definedStringLength As Integer)
which in your case would be:
WriteCustomString("Q3_Pan[0].Part.Type.Code", "x", 1)
-
I just tested this and you have to use the WriteCustomString in the code.
As for the visual control, the attached modified version of the BasicLabel will allow you to read the String1 data type, as well as to write to it.
This will work for as long as you enable its InterpretValueAsCLXString property, set the correct length in the CustomCLXStringLength property and add your tag to both PLCAddressValue and PLCAddressKeypadCollection properties.
-
That helped!
Thanks!