Search found 3 matches
- Fri May 17, 2019 6:48 am
- Forum: Scripting
- Topic: Converting ASCII String to Bytes
- Replies: 5
- Views: 9283
Re: Converting ASCII String to Bytes
Assuming the string always has 10 characters you could use the following public partial class Home { void Button_Click(System.Object sender, System.EventArgs e) { string input = Globals.Tags.String_ROC.Value; byte[] array = Encoding.ASCII.GetBytes(input); Globals.Tags.Byte0.Value = array[0]; Global...
- Mon Apr 15, 2019 7:42 am
- Forum: Scripting
- Topic: Converting ASCII String to Bytes
- Replies: 5
- Views: 9283
Re: Converting ASCII String to Bytes
So I have the following on a button right now, will change it to a second tag once I get it to work. using System.Text; public partial class Home { void Button_Click(System.Object sender, System.EventArgs e) { string input = Globals.Tags.String_ROC.Value; byte[]array = Encoding.ASCII.GetBytes(input)...
- Tue Apr 09, 2019 8:43 am
- Forum: Scripting
- Topic: Converting ASCII String to Bytes
- Replies: 5
- Views: 9283
Converting ASCII String to Bytes
Hi, Hoping someone can help me out here and let me start off by saying I'm not very knowledgeable in C#. Due to limitations of our SCADA system I cannot pull back strings from our RTU so I would like to convert a 10 character ASCII string into 10 different bytes (Tags) in the HMI that I could then s...