Duffanator

MrPLC Member
  • Content count

    180
  • Joined

  • Last visited

Everything posted by Duffanator

  1. ASCII to decimal conversion

    Well, I figured out one way to do it. I just used a DIS funtion to pull out every 4 bits and put it into it's own D register. Since it's ASCII code and a 0 in ASCII is 30 in HEX it actually works out that you can just pick out the digits you need. if the weight is 24.14: D52 = 2,SP(ASCII), 3220H you can use a DIS with K4 and get: D60 = 0 Decimal D61 = 2 Decimal D62 = 2 Deciaml D63 = 3 Decimal If you do that for every D register you can pull the weight digit out and mulitply it by what ever place it should be in (1000, 100, 10) and then add them together. Maybe not the cleanest way to do it, but it worked! Thanks for the help everyone, much appreciated.
  2. ASCII to decimal conversion

    oops, yeah sorry I forgot to say what PLC I am working with. It is an A2SH CPU, thanks!
  3. TCP/IP communication with A-series PLC

    I got it! I hooked the Comtrol up to my laptop and was able to recieve the data from it with Hyperterminal. At that point I rewrote the program to use a pair of connections with the H281 settings that funfrok had given me. After I did that it still would not work so I looked a little closer and found that you can program the remote node's IP adress and port # to return to. I programmed that in and set the Comtrol to send to port 2000 and listen to port 2001. After that it worked! Then I got curious and wondered if that was the problem the whole time, so I went back to my original program and tried it with the original settings that I had (H8001 for port settings) and programed in the Comtrols IP adress and listening port number. I tried it and it didn't work, so I changed the settings to Active, not paired (H201) and BAM, it started working! So I could still use 1 port per scale and didn't need paired ports. Thank you guys for the help and giving me things to check. It is much appreciated!
  4. TCP/IP communication with A-series PLC

    Do you need two ports if you just want to recieve data? The manual seems to indicate that you can have just one open connection if you want to recieve from a port. I haven't tried to have two ports per scale yet, I will have to try that.
  5. TCP/IP communication with A-series PLC

    Yes, I am using a "From" instruction. I have two ports open for a Citec system communication and they are buffers 1 and 2. I am using buffers 3 and 4 for the scale data. The problem is that I'm never getting the received complete signal for buffer 3 or 4 to come on, I have the received complete signal initiating the from command so it's never getting any data from the ethernet card. I'm not sure why I can't get the complete signal.