Author Topic: Allen- Bradley MicroLogix 1000 Serial USB connection set up  (Read 2067 times)

thug_

  • Newbie
  • *
  • Posts: 30
    • View Profile
Allen- Bradley MicroLogix 1000 Serial USB connection set up
« on: December 28, 2016, 11:16:52 AM »
Hi,

I have Allen-Bradley MicroLogix 1000 PLC, connected to my notebook with serial usb cabl on COM3. I downloaded AdvancedHMI, I created new project and add dlls from Advanced HMI.

I tried to use SerialDF1forSLCMicroCom driver and I tried to execute following code through my application

                plc.ComPort = "COM3";

                plc.PollRateOverride = 100;

                string plcRead = plc.Read("N7:0") // Value is 500

                txt.Text = plcRead;

but when I start application I am not getting any results, any ideas what I am doing wrong ? In PLC value is 500.

Thanks.
« Last Edit: December 28, 2016, 12:02:47 PM by thug_ »

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: Allen- Bradley MicroLogix 1000 Serial USB connection set up
« Reply #1 on: December 28, 2016, 11:30:07 AM »
I think the values are returned as a string. Try

  txt.Text = plc.Read("N7:0")

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Allen- Bradley MicroLogix 1000 Serial USB connection set up
« Reply #2 on: December 28, 2016, 11:45:18 AM »
If you add a BasicLabel to the form and set PLCAdressValue to N7:0, will it show the value when you run the application?

thug_

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Allen- Bradley MicroLogix 1000 Serial USB connection set up
« Reply #3 on: December 28, 2016, 11:45:53 AM »
Thanks but didn't work. This is the error I am getting

thug_

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Allen- Bradley MicroLogix 1000 Serial USB connection set up
« Reply #4 on: December 28, 2016, 11:58:47 AM »
I tried adding Basic Label to MainForm.vb, but still not displaying value. It says No Response from PLC ?

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Allen- Bradley MicroLogix 1000 Serial USB connection set up
« Reply #5 on: December 28, 2016, 12:07:57 PM »
Is your RSLinx shutdown?

thug_

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Allen- Bradley MicroLogix 1000 Serial USB connection set up
« Reply #6 on: December 28, 2016, 12:09:29 PM »
RSLinx is running, should I turn off ?

thug_

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Allen- Bradley MicroLogix 1000 Serial USB connection set up
« Reply #7 on: December 28, 2016, 12:10:14 PM »
Ahhhh I turned off, now it's working. Thanks guys.

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Allen- Bradley MicroLogix 1000 Serial USB connection set up
« Reply #8 on: December 28, 2016, 12:27:52 PM »
It's a good habit if creating any serial driver in RSLINX, set it to manual startup.

and C sharp code need to end with ;
« Last Edit: December 28, 2016, 12:29:30 PM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================