Forums.MrPLC.com: Micrologix 1100 question - Forums.MrPLC.com

Jump to content

This Month's Allen Bradley Forum is:

Sponsored by PDF Supply - PDF Supply sells New and Remanufactured GE Fanuc and Allen-Bradley PLC's
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Micrologix 1100 question comms with PC via rs-232 port Rate Topic: -----

#1
User is offline   Moe 

  • Hi, I am New!
  • Pip
  • Group: MrPLC Member
  • Posts: 4
  • Joined: 05-June 12
  • Country:Ireland
    Ireland
Hello there fellow PLCers. I'm new to this interesting game so excuse my ignorance.

I have used RSLogix micro starter lite for the first time to write a basic counting application. The PLC is connected to a limit switch that signals the count. This value is displayed via ethernet to a c600 touch screen. I created an L12:1 register, which is the address/tag that is displaying the 32bit count on the PV screen. I want to send this data string via the RS-232 to a PC less than 2m away. I'm getting confused with converters, DH-485 networks, factory talk and all the comms solutions out there that I can't find the appropriate answer. Can I send the contents of this register using the MSG command to a PC easliy. If so how, and what will need to be done on the PC side to receive this string? Is any software driver needed on the PC or will the string be visible via com port.

One more question; the counter value is incremented by one after power down and up again. I can fix this but I'd like to know why it's happening.

Any help would be much appreciated.

This post has been edited by Moe: 08 August 2012 - 07:56 AM

0

#2
User is offline   Ken Roach 

  • Propeller Head
  • PipPipPipPipPipPip
  • Group: MrPLC Member
  • Posts: 1,850
  • Joined: 31-January 02
We'd have to see the ladder code to determine why the Counter is increasing by 1 every powerup. It's likely that the Input you are counting is True on powerup, so the controller considers that a False-True transition. All A-B SLC-500 family controllers (including MicroLogix) have a Status bit addressed S:1/15 that is true only during the First Scan of the program, and is frequently used as a condition to prevent powerup or first-scan transitions or events.

The second question is a little more complicated. What do you want to do with the data once it's on the PC ?

The simplest possible thing would be to run a serial port capture program and send a String with the counter value in it.
0

#3
User is offline   Moe 

  • Hi, I am New!
  • Pip
  • Group: MrPLC Member
  • Posts: 4
  • Joined: 05-June 12
  • Country:Ireland
    Ireland

 Ken Roach, on 08 August 2012 - 08:35 AM, said:

We'd have to see the ladder code to determine why the Counter is increasing by 1 every powerup. It's likely that the Input you are counting is True on powerup, so the controller considers that a False-True transition. All A-B SLC-500 family controllers (including MicroLogix) have a Status bit addressed S:1/15 that is true only during the First Scan of the program, and is frequently used as a condition to prevent powerup or first-scan transitions or events.

The second question is a little more complicated. What do you want to do with the data once it's on the PC ?

The simplest possible thing would be to run a serial port capture program and send a String with the counter value in it.


Hi Ken, Thanks for that very helpful advice. Regarding the comms question, the data is to be used in SQL software. What is the best way to send the string. Is the MSG command the way to do it? I've never done this before. Really appreciate the help.
0

#4
User is offline   Ken Roach 

  • Propeller Head
  • PipPipPipPipPipPip
  • Group: MrPLC Member
  • Posts: 1,850
  • Joined: 31-January 02
Taking data from a serial port into an SQL database is generally done by an industrial datalogging software package, with a full-blown PLC protocol driver.

Do you have one of those software packages, or are you from scratch attempting to write a component or feature to handle the serial port buffer, parse the incoming data, and write it to SQL ?

Unless there's a fully-implemented DF1 driver on the PC side, you won't use the MSG instruction. That instruction includes headers and framing and addressing to manage data types and checksums and offsets.

Instead, you'll use the ASCII data handling instruction set to convert an Integer to a String, then use the ASCII port handling instruction set to write that String out from the serial port.

The "Integer to String" instruction (AIC) and the ASCII Write (AWT) instruction are the ones you'll need to start learning about if you're going to send raw ASCII strings out of the MicroLogix serial port.
0

#5
User is offline   Moe 

  • Hi, I am New!
  • Pip
  • Group: MrPLC Member
  • Posts: 4
  • Joined: 05-June 12
  • Country:Ireland
    Ireland

 Ken Roach, on 10 August 2012 - 12:20 PM, said:

Taking data from a serial port into an SQL database is generally done by an industrial datalogging software package, with a full-blown PLC protocol driver.

Do you have one of those software packages, or are you from scratch attempting to write a component or feature to handle the serial port buffer, parse the incoming data, and write it to SQL ?

Unless there's a fully-implemented DF1 driver on the PC side, you won't use the MSG instruction. That instruction includes headers and framing and addressing to manage data types and checksums and offsets.

Instead, you'll use the ASCII data handling instruction set to convert an Integer to a String, then use the ASCII port handling instruction set to write that String out from the serial port.

The "Integer to String" instruction (AIC) and the ASCII Write (AWT) instruction are the ones you'll need to start learning about if you're going to send raw ASCII strings out of the MicroLogix serial port.



Hi Ken,

Thanks again for sharing your wisdom. I'm fresh out of college and I only practiced programming on Mitsubishi PLC's. However it was all set up for us in the labs and there were no comms issues.
There is no available DF1 driver on the PC side to answer your question. I am not too concerned about writing the incoming data to the SQL software yet. If I could figure out how to send the count value to the PC that would be a break through for me at this point. It's all new territory for me. Thanks for pointing me in right direction. Is it possible to send the count value via serial from the PLC to PC using the AIC & AWT without having to spend money on software for the PC side as this a very basic counting application? Is it relatively straight forward or is there a lot of work involved? Will I be able to see the count in Hyper termainl for example? Have you done this before without a DF1 driver? Excuse my ignorance.

This post has been edited by Moe: 13 August 2012 - 04:13 PM

0

#6
User is offline   Joe E. 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 198
  • Joined: 14-April 09
  • Gender:Male
  • Location:Christiansburg, VA
  • Country:United States
    United States
If you use Visual Studio, try Advanced HMI. They have DF1, Ethernet/IP, and other drivers.
0

#7
User is offline   Moe 

  • Hi, I am New!
  • Pip
  • Group: MrPLC Member
  • Posts: 4
  • Joined: 05-June 12
  • Country:Ireland
    Ireland

 Joe E., on 15 August 2012 - 11:19 AM, said:

If you use Visual Studio, try Advanced HMI. They have DF1, Ethernet/IP, and other drivers.



Thanks for the help lads. I'm having trouble using the AWT command. It works fine. At the moment I can only get one count value sent to hyperterminal via serial, as the DN bit is set. What is the best way to toggle this bit. This is very basic I know but I'm having trouble with it.

And what command will allow a carraige return between each count value so the numbers come out readable in hyerterminal.

Any help would be much appreciated.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users