Author Topic: AB MicroLogix 1400 Write String Tags  (Read 2923 times)

Igor

  • Newbie
  • *
  • Posts: 7
    • View Profile
AB MicroLogix 1400 Write String Tags
« on: March 18, 2015, 01:12:03 PM »
I am trying create simple HMI application and i need read and write tags. With Integers and float points is OK but String tags I get trouble:

        for      EthernetIPforPLCSLCMicroCom1.Write("ST10:30", "12") in PLC I am reading: "^A^B"

        for      EthernetIPforPLCSLCMicroCom1.Write("ST10:30", "AB")

interrupts program and gives me this message (Attached image), what I am doing wrong?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: AB MicroLogix 1400 Write String Tags
« Reply #1 on: March 18, 2015, 01:33:04 PM »
There is a problem that was created when porting the code to Linux. Try this:

- Download the latest version of 3.98a
- Open AllenBradleySLCMicro.vb
- go to line 1957
- Change the code where the error is occurring to this:

            ConvertedData(0) = CByte(dataToWrite.Length - 1)
            Dim i As Integer = 2
            Dim StringBytes() As Byte = System.Text.Encoding.ASCII.GetBytes(dataToWrite)
            While i <= dataToWrite.Length
                ConvertedData(i + 1) = StringBytes(i - 2)
                ConvertedData(i) = StringBytes(i - 1)
                i += 2
            End While

Igor

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: AB MicroLogix 1400 Write String Tags
« Reply #2 on: March 18, 2015, 02:11:32 PM »
It works great