Author Topic: Read and Write to a variable with MicroLogix 1100?  (Read 1851 times)

KanHaz

  • Newbie
  • *
  • Posts: 19
    • View Profile
Read and Write to a variable with MicroLogix 1100?
« on: February 11, 2014, 10:06:58 AM »
Hello,

First off thanks for creating this program. It's amazing and easy to use.
My problem is I want to be able to read a counter to a variable and then reset it.
I used rich text boxes on my form and want to display the number from the counter.
I'm using a MicroLogix 1100 and I can get the numbers to show up when I use the Digital Display that came with AdvancedHMI.

The program I'm trying to make will keep track of the number of parts made (Variable name "actual") and compares them to the number of parts that should have been made (Variable name "goal"). A timer in the PLC increments a counter to keep track of "goal" and another counter keeps track of "actual". I have it in the program that if "actual" < "goal" the text in the box is red, if "actual" > "goal" the text is green. The program will also store the "actual" and "goal" of each shift and display them on the screen with the same red or green text.

This is where I have problems. These lines don’t read from the PLC and give me an error message.

actual = EthernetIPforPLCSLCMicroComm1.Read ("C5:1/ACC")
goal = EthernetIPforPLCSLCMicroComm1.Read ("C5:0/ACC")

I haven't tried to reset them, haven't got that far yet. I'm new to this so thank you for any advice or tips.

BLFTech

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • BLF-Tech LLC Website
Re: Read and Write to a variable with MicroLogix 1100?
« Reply #1 on: February 11, 2014, 03:44:06 PM »
I tested it on a MicroLogix 1100 trainer I sell and it worked. The only difference is your driver had 2 letter m's in the driver name in front of the .read.

My driver  ==> actual = EthernetIPforPLCSLCMicroCom1.Read("C5:1/ACC")

Your Driver ==> actual = EthernetIPforPLCSLCMicroComm1.Read("C5:1/ACC")

KanHaz

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Read and Write to a variable with MicroLogix 1100?
« Reply #2 on: February 17, 2014, 07:16:19 AM »
Once I fixed that mistake it works great. Thanks for the help.