Author Topic: Problem writing to PLC  (Read 2049 times)

cls

  • Newbie
  • *
  • Posts: 5
    • View Profile
Problem writing to PLC
« on: January 22, 2014, 06:00:56 AM »
Hi

I have create a form and a button on the form that runs the following code:

Me.EthernetIPforPLCSLCMicroCom1.Write(Me.DigitalPanelMeter1.PLCAddressValue, CSng(0))

If I write to the plc it always has the value -416 no matter what I write).

Am I doing something wrong?

The PLC is a AB 1761-NET-ENI. The register is called C5:0.ACC in the PLC.

Best regard
Claus

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: Problem writing to PLC
« Reply #1 on: January 22, 2014, 10:33:36 AM »
The Net-ENT isn't a PLC, that is just an Ethernet to serial converter.  Can you find out what PLC it is connected to?  I've never worked with a Net-ENI and AdvancedHMI, but try this instead:

EthernetIPforPLCSLCMicroCom1.Write("C5:0.ACC", 1)

See if that writes a 1 to your counter accumulated value.

cls

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problem writing to PLC
« Reply #2 on: January 23, 2014, 02:16:54 AM »
I have tried several values (including 1) and no matter what I write to the PLC (/converter), the value in the register always become -416.

Writing bits to another register works ok.

I have been using a very old version 3.16 (or something like that), and it works fine in that version.
« Last Edit: January 23, 2014, 02:21:24 AM by cls »

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: Problem writing to PLC
« Reply #3 on: January 23, 2014, 11:02:27 AM »
Oh I see, my reading comprehension has been failing me lately.  For some reason I thought AdvancedHMI was returning the -416.  Clear as day though now that I read it again.

Maybe a bug for Archie to look into...