Author Topic: Read/Write AOI tags  (Read 2605 times)

johwaa

  • Newbie
  • *
  • Posts: 20
    • View Profile
Read/Write AOI tags
« on: April 13, 2015, 03:50:18 PM »
Hi guys,

Does anyone know what the syntax would be for reading or writing to a tag in an Add On Instruction?


Thanks!

johwaa

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Read/Write AOI tags
« Reply #1 on: April 13, 2015, 05:31:06 PM »
FWIW, this is what I have:

      EthernetIPforCLXCom1.Write("PD_AB300:AB301:HMI_AB301_F2103PT.ACtrl[0]", CSng(0.09))
      EthernetIPforCLXCom1.Write("PD_AB300:AB301:AB301_F2103PT.ACtrl.LowFaultSP", CSng(0.09))

Which causes a "PLCDriverException was unhandled" fault (without a Try - Catch). With the Try - Catch, it responds with a "CIP Error Path Segment Error".

I've got the PLC address correct, and the slot number is correct as well. The PLC can be pinged with no problem, and I have it up in RSLogix at the moment.


Thanks!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Read/Write AOI tags
« Reply #2 on: April 13, 2015, 10:05:57 PM »
Is the Add On Instruction tag a global scope? What is the tag name used for the instance of the Add On Instruction. If it is a global scope tag, then you should be able to drill down into the tag name of the AOI to get to the variable you want, then copy that complete name.

johwaa

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Read/Write AOI tags
« Reply #3 on: April 15, 2015, 05:50:03 PM »
Hi Archie, thanks for the reply.

PD_AB300 is the controller name. And AB301 is a program within the PD_AB300 controller. And the tags were created in the AB301 program (I think that you already knew all of this).

The Add On Instruction's tag name is: zaAB301_F2103PT and it was created in AB301 as well.

From reading some of the other posts on this subject, I thought that: "PD_AB300:AB301:AB301_F2103PT.ACtrl.LowFaultSP" would work.


Thanks,

John

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Read/Write AOI tags
« Reply #4 on: April 15, 2015, 06:12:41 PM »
PROGRAM:AB301.zaAB301_F2103PT.ACtrl.LowFaultSP

johwaa

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Read/Write AOI tags
« Reply #5 on: April 15, 2015, 06:56:57 PM »
It works great, thanks Archie!

I had tried using "PROGRAM" in my efforts as well, but my mistake was using a colon when I needed a period. Thanks again! :)