adccommunitymod (AutomationDirect) asked a question.

DL06 Port2 Communication Stops

Created Date: August 26,2011

Created By: snydl0ga

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

On My DL06 in am reading a balance scale with no problem into Port 2. We need to switch between two scales so I use an A/B switch for DB9 connectors. When I switch between scales, sometimes the communication stops. My soft-PID control stops too. I need to either find why it does it or I need a way to automatically halt and start the PLC. When it does stop ....all I do to fix it is Halt then set back to RUN..(PLC)


  • adccommunitymod (AutomationDirect)

    Created Date: August 26,2011

    Created by: bcarlton

    It depends on how you are reading the scales. You must provide an input which signals to stop reading and clear the input buffers. After that you can switch the scales then release the input which gives permission to begin reading again.

    More information on the methods and protocol being used would help.

  • adccommunitymod (AutomationDirect)

    Created Date: August 28,2011

    Created by: andremholmes

    What form of communication are you using (rs232?) can you use rs485?. It would a good idea to use rs485 to communicate with the two scales.

  • adccommunitymod (AutomationDirect)

    Created Date: September 01,2011

    Created by: snydl0ga

    I am using RS232 into port2. It is strange, I used it today and when I switched it the PID Loop would not function although it shows Aouto mode. I have to halt the processor and restart it.

  • adccommunitymod (AutomationDirect)

    Created Date: September 01,2011

    Created by: bcarlton

    It sounds like control registers are overlapping somehow - cross affecting each other.

  • adccommunitymod (AutomationDirect)

    Created Date: August 26,2011

    Created by: snydl0ga

    On My DL06 in am reading a balance scale with no problem into Port 2.

    We need to switch between two scales so I use an A/B switch for DB9 connectors.

    When I switch between scales, sometimes the communication stops. My soft-PID control stops too.

    I need to either find why it does it or I need a way to automatically halt and start the PLC. When it does stop ....all I do to fix it is Halt then set back to RUN..(PLC)

    Expand Post
    • WesselCronje (Customer)

      Good afternoon

      I'm new to serial communications and are struggling for the past 4 week trying to read the values from a "Kentucky gauge linear scale" into a DL06 port 2. I have tried various methods like the ASCII IN as well as RX command but still can't get any values written into the V memory location.

      I also tried using PC terminal(HTerm 0.8.9) to simulate the data string.

      Would you be so kind and share the section of your PLC code that deals with the RS 232 communications.

      Regards.

       

      Expand Post
  • K Price (Customer)

    Yes, communicating with another serial, non-PLC device is tricky. The first thing to get right is the pin connections. Can you share the Kentucky Gauge model, or any comm. port specs.: RS232/RS485? Is gauge labeled as DTE or DCE? Note that the PLC is DTE. This determines TX and RX connections. Does it require hand-shaking connections? RTS/CTS? Do you configure the port settings? or does the gauge have fixed port settings? Baud, stop bits, etc. The next thing is the protocol. Do you have the ASCII protocol required for communicating to/from the gauge? (Assuming it communicates via ASCII codes) Note that the "RX" command is for the DL06 to communicate to another DL PLC. The next thing is the timing. The PLC must code and send (PRINTV) the ASCII code string to request the needed data, then wait for the response, then input (AIN) de-code and use the response, then code and send (PRINTV) the next ASCII code string, etc.. This timing can be in the PLC logic and/or use the hard-wired, hand-shake signals. And perhaps you may need to set up "fault" logic, what to do if communications are lost. Yes, using a terminal program will help verify the ASCII codes.

    Expand Post
  • K Price (Customer)

    You asked "share the section of your PLC code that deals with the RS 232 communications". Perhaps the original author is no longer available, as this was originally posted some years ago. I can share some screen shots dealing with RS232 communications from a DL PLC Port2. (but never used Kentucky Gauge) With other communications that required buffering and more capabilities, we used the BASIC Coprocessor module. But these screens shots are for the DL PLC Port2. For these projects, the Stage programming made communications, (and all the other control steps), much easier than standard ladder logic.

     

    We setup Port2 using ladder so port2 was setup going into run mode, no need to use DirectSOFT PLC Port2 setup utility. This is Port setup rung 1 of 2.

    Port2 Setup 

    This ladder rung was used to send ASCII codes to setup a serial printer.

    Printer Setup1 

    On a few projects, we gathered weights from a Siemens Milltronics scale. This ladder rung shows a Modbus Read Holding Register instruction. I don't know if Kentucky Gauge offers Modbus, but programming is easier getting data via Modbus because there's no de-coding/parsing of ASCII strings.

    Modbus Read

    Expand Post
    • Modbus Read
    • WesselCronje (Customer)

      Thank you for your reply.

       

      Unfortunately the Kentucky gauge is a Serial / RS-232 device only with the following parameters:

      Baud Rate : 9600

      Data Bits : 8

      Parity : None

      Stop Bits : 1

      Control : Xon / Xoff

       

      It is on a linear scale 180 inches long

      Expand Post
  • K Price (Customer)

    That gives some specs anyway for the port settings. And it looks like it uses ASCII codes in that Xon/Xoff is listed. As far as reading ASCII codes in the PLC, you should be able to connect your computer to the PLC, and using your terminal program, feed ASCII data into the PLC, and see it appear in the V-memory locations. I have a test DL06 setup, using a D2-DSCBL-1, USB-RS232 adapter, and (1) rung in a test PLC program with an AIN instruction with a N.C. "Complete" permissive bit, no timeouts, no handshaking. You should see data in the V-memory locations in Data View. You should also be able to send ASCII data from the PLC to the terminal program using PRINTV and VPRINT instructions. This will tell you your PLC port, cables, RS232 adapter, PLC programming are all functioning. At this point you don't have to worry about parsing out actual data. And since the cables are pre-wired, no need to worry about pin connections.

     

    Using the terminal program, are you able to input anything (even nonsense characters) into the terminal program from the gauge? Kentucky Gauge should provide more info on the port wiring and protocol. Without it, it is guessing, or trial-and-error. If nothing getting into the terminal program, it could be wiring: does the gauge port include control pins? Does RTS-CTS need to be jumpered? any other control pins?Does TX and RX need to be reversed? Does the gauge need anything to begin transmitting? Does it start transmitting out-of-the-box, or does transmitting need to be enabled? Doe the gauge need to see an ASCII code (Xon for example) to begin transmitting?

     

    I recommend testing the PLC first with the terminal program. This should be straight forward as there is detailed specs and instructions, and of course, Automation Direct tech support. You will also get more familiar with the PLC ASCII instructions. Next I would recommend trying to get more info from Kentucky Gauge.

    Expand Post
10 of 12