SummerIntern Posted June 11, 2012 Share Posted June 11, 2012 As the title says, I was hoping I could get help connecting an Allen-Bradley MicroLogix 1100 PLC to DAQFactory. The bulk of the programming is running through the PLC, but the main stuff I need help with is getting DAQFactory to communicate with the PLC, to be able to read the information coming from the PLC, and occassionally being able to flip switches to say start a motor or begin collecting data. Thanks in advance. Link to comment Share on other sites More sharing options...
AzeoTech Posted June 11, 2012 Share Posted June 11, 2012 Are you connecting via Modbus or DF1? Link to comment Share on other sites More sharing options...
SummerIntern Posted June 11, 2012 Author Share Posted June 11, 2012 I'm not sure. This is the first time I've ever used a PLC and someone else did the programming for it. So, I have been put to the task of getting DAQFactory to work with it. If it is just a matter of choosing one, whichever one is easiest to get working. I'm going to be using an ethernet to usb adaptor if that makes a difference. Link to comment Share on other sites More sharing options...
AzeoTech Posted June 13, 2012 Share Posted June 13, 2012 Unfortunately, you are going to have to figure out the PLC programming first, including what registers are where. Then you can decide which protocol to use (it will have to be Modbus or DF1). What do you mean by an Ethernet to USB? Did you mean Ethernet to serial? Link to comment Share on other sites More sharing options...
SummerIntern Posted June 13, 2012 Author Share Posted June 13, 2012 Yes, I meant Ethernet to serial. The PLC programming is done, I am just waiting to hear back from the person that programmed it what registers are where. The protocol that is going to be used is DF-1. Link to comment Share on other sites More sharing options...
AzeoTech Posted June 14, 2012 Share Posted June 14, 2012 You'll need the register map first. Then refer to the help for the details on setting up DF1. Post if you have specific questions. Link to comment Share on other sites More sharing options...
SummerIntern Posted June 25, 2012 Author Share Posted June 25, 2012 So, I am still having issues getting communications between the PLC and DF. The configuration that I have for the PLC IS: Connection Name: ML1100 Port: 3 Baud: 19200 Byte Size: 8 Parity: None Stop Bits: 1 Timeout: 1000 Flow Control: None In the comm monitor, the only responses that I am receiving back are the exact same with the exact same time: Tx (11:54:35.593): B3:0/1 Rx (11:54:35.593): B3:0/1 Tx (11:55:34.211): B3:0/0 Rx (11:55:34.211): B3:0/0 The last 0 and 1 should switch a motor on and off, but there is no response. Any ideas/suggestions on getting this to work? Link to comment Share on other sites More sharing options...
AzeoTech Posted June 27, 2012 Share Posted June 27, 2012 Chances are you have issues with the PLC programming, but I can't say. I'm not really an expert on that particular PLC. It looks, however, like you might just be getting an echo. You might try going to the comm monitor and just typing in some garbage and seeing if it echos back in the Rx. Link to comment Share on other sites More sharing options...
SummerIntern Posted July 13, 2012 Author Share Posted July 13, 2012 I am still having trouble getting this to work. It is just echoing whatever I type and send. Are there any suggestions as to what could be causing it to echo instead of sending/receiving anything? Link to comment Share on other sites More sharing options...
AzeoTech Posted July 16, 2012 Share Posted July 16, 2012 Wiring problem most likely. Does it echo garbage? Link to comment Share on other sites More sharing options...
SummerIntern Posted July 16, 2012 Author Share Posted July 16, 2012 Yes, it echos whatever I type, whether it is commands or garbage. Link to comment Share on other sites More sharing options...
AzeoTech Posted July 16, 2012 Share Posted July 16, 2012 What about if the PLC is disconnected? You almost certainly have a wiring problem. Link to comment Share on other sites More sharing options...
SummerIntern Posted July 16, 2012 Author Share Posted July 16, 2012 Yes, it still just echos whatever is typed in, even if the cable is unplugged. I'll go back and check all the wiring and see what I can figure out. Link to comment Share on other sites More sharing options...
AzeoTech Posted July 16, 2012 Share Posted July 16, 2012 Then you absolutely have a wiring problem. Pins 2 and 3 must be crossed. Link to comment Share on other sites More sharing options...
SummerIntern Posted July 16, 2012 Author Share Posted July 16, 2012 Is it pins 2 and 3 for the ethernet cord that you are talking about? If not, pins 2 and 3 for what? Link to comment Share on other sites More sharing options...
AzeoTech Posted July 17, 2012 Share Posted July 17, 2012 No, serial. If you had the wires crossed on Ethernet you wouldn't get anything. With a serial / ethernet you have both ethernet and serial. Most likely your wiring problem is on the serial side. Its also possible that the serial / ethernet converter has a setting that causes it to echo. Link to comment Share on other sites More sharing options...
SummerIntern Posted July 17, 2012 Author Share Posted July 17, 2012 After talking to the PLC programmer, he asked it the comms have to have SMPT enabled on the PLC for it to work. Would this be true or should it work without SMPT enabled? Link to comment Share on other sites More sharing options...
AzeoTech Posted July 17, 2012 Share Posted July 17, 2012 I can't say. You have a hardware issue, not a DAQFactory software issue, and unfortunately will likely have to post on an Allen Bradley forum or contact their tech support. DF1 is DF1 and DAQFactory talks DF1. The issues you are having relate to getting the DF1 connected between the PC and the PLC. It would be like if we were chatting on the phone and lost the connection. We are both talking English, so can communicate, but if the hardware goes down that supports the phone call, we aren't going to get very far. Personally, I'd start by eliminating the ethernet to serial converter and just go serial out of your PC directly into the PLC. Then you will know whether the issue is with the PLC or the converter. Then you can work from there. Link to comment Share on other sites More sharing options...
SummerIntern Posted July 23, 2012 Author Share Posted July 23, 2012 So, working with the PLC programmer, we got the PLC and DAQFactory talking with the use of an Allen-Bradley adaptor. The one line of code that we could get working was from the bottom of page 8 in the Serial Guide included with DAQFactory. The problem is that the line is entered as \016\002\001\000\015\000\042\000\162\002\007\137\000\000\016\003\136\065 and I don't know how to decifer it and put it into something that I can use. What does that line say? Thanks! Link to comment Share on other sites More sharing options...
AzeoTech Posted July 23, 2012 Share Posted July 23, 2012 I don't remember. Did you get a valid reply? Your best bet is to simply move on and create a single channel to try and read a value. Link to comment Share on other sites More sharing options...
SummerIntern Posted July 23, 2012 Author Share Posted July 23, 2012 I assume that I got a valid responses. The responses that I got were \016\005 and then with some adjust to the mechanical part I was getting \016\006. Link to comment Share on other sites More sharing options...
AzeoTech Posted July 24, 2012 Share Posted July 24, 2012 What about when you try creating a single channel? Link to comment Share on other sites More sharing options...
SummerIntern Posted July 24, 2012 Author Share Posted July 24, 2012 So, here is what I am trying to accomplish, maybe you can point me in the right direction with this. The operator presses a button to start the motors on. Upon each set of measurements completing, the data is placed into N7:0, N7:6, and N7:7 and sets a bit (B3:1/0) to signal that the data is ready to be transfered over. So when the bit goes high, DAQFactory requests data from N7:0, N7:6, and N7:7. This will repeat until the operator presses a button to finish the processes and stop the motors. We were able to setup a local OPC server on the machine and at least pull the tags into DAQFactory, but I have been unsuccessful in being able to get any values besides a -1 for the motors and 0's for the other values. Are there any suggestions as to being able to get either of these to work? Link to comment Share on other sites More sharing options...
AzeoTech Posted July 24, 2012 Share Posted July 24, 2012 OPC is weird. Its built on COM which kind of came out of VB, and so they often use -1 for true instead of the normal 1 used by most every other programming language. So, most likely if you are getting 0's and -1's, its working, you just need to take the abs() of the result to get 0 and 1, and remember when setting, to use -1 for on instead of 1. I haven't run into this in a while, so I could be wrong. I have this vague notion that -1 was used instead of 0 for false. Anyhow, its something like that and its all related to OPC, not DF1. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.