DLB

MrPLC Member
  • Content count

    46
  • Joined

  • Last visited

Community Reputation

0 Neutral

About DLB

  • Rank
    Sparky

Profile Information

  • Country United Kingdom
  1. Am I right in thinking that you can't pass arguments into a subroutine (SR Section) in Unity Pro? I am using v8 and can't seem to find a way of doing it. I want a reusable function that I can just call on demand, so a subroutine is perfect. But I need to call it with different parameters. Will have to be a DFB is this isn't possible, I guess.
  2. Thanks My2c. From what you say then, lowering the poll rate in the OPC topic configuration in RSLinx may actually make a difference? If I understood your comments correctly, the 1000ms I have in the RSLinx sort of dictates the servers "best effort". Right? I have lots of logs so plan to try and correlate the handle errors in the RSLinx log to test logs showing the data we were attempting to read at the time the error occured.
  3. I am using an OpenOPC client to talk to RSLinx to read and write PLC tag values. I'm finding that I occasionally get cached data returned when I do a PLC read. As an example, I have a Boolean tag that I can see on a PLC trace has dropped from 1 to 0, but I still get a 1 when I read via OpenOPC for a period of time before I get the most up to date value of 0 returned. I’ve noticed my PLC topic configurations in RSLinx have the “Polled Messages (mSec)” parameter (Data Collection tab) set to 1000ms. However, my OpenOPC clients set the update rate argument to 100ms whenever they read anything, which I thought would override the update rate specified in the RSLinx topic configuration, is that correct? After noticing this I changed the RSLinx Topic configuration so that poll rates match on both Server and Client, but I won’t know for a while whether it has helped or not. However, if my understanding of the client poll rate overriding the server poll rate is correct then I guess it won’t make much difference. Also, I'm seeing 2 other issues which I guess could be related but I am unsure: - I am seeing active topics/groups hanging around in RSLinx after I've closed all OPC connections (which looking at the OpenOPC code, should remove all groups: “self.remove(self.groups())”). I'm not really sure what is going on here? - I'm seeing a few RSLinx communication errors with the description of “Desc: A DDE/OPC Client has passed an invalid server handle while attempting a Remove Item call. Handle value is 0x79ac130.” i) How can I figure out what is causing this? ii) Is it logical to think that this could be related to the above issue where some groups aren’t being removed? iii) Snipped of an RSLinx communication error log below ---------------------------------------------------------------------------------------------------------------- -none- : -none- : 11/29/13 - 01:12:05 : 00h Items: -none- Type: READ Mfg: Allen-Bradley PlcType: Desc: A DDE/OPC Client has passed an invalid server handle while attempting an Async IO Read call. Handle value is 0x79ac130. Number of occurrences: 814 Last Error occurred: 11/29/13 - 07:59:02 -none- : -none- : 11/29/13 - 08:07:00 : 00h Items: -none- Type: READ Mfg: Allen-Bradley PlcType: Desc: A DDE/OPC Client has passed an invalid server handle while attempting a Remove Item call. Handle value is 0x79ac130. Number of occurrences: 1 Last Error occurred: 11/29/13 - 08:07:00 ---------------------------------------------------------------------------------------------------------------- Any help would be brilliant. Thanks.
  4. Sounds like you need OpenOPC: http://openopc.sourceforge.net/ We have an automated test framework written in Python that we use to create tests which poke the PLC and read back data to check that things are functioning as we expect. OpenOPC allows you to read and write data via any OPC server. It's very easy to use and so is Python if you haven't ever used it.
  5. PLC Integration

    OpenOPC (Python library) is a really simple way to read tags. I use it for automated testing. http://openopc.sourceforge.net/
  6. That's great. The example makes it really clear!
  7. I'm running Unity Pro and need some help writing some ladder to control the mode of some equipment (via DO) with delays in place to stop mode switching happening too fast. I essentially need the program to decide what mode it should be in (based on inputs) and then switch the PLC to that mode (by setting specific outputs), providing it has not been in the previous mode for less than a given amount of time. On paper this seems like an extremely simple task yet I can't seem to put together something that works. I'm relatively new to writing my own PLC code but I am familiar with it. I've spent more time looking at other peoples code for one reason or another and discussing the design, but haven't had much experience designing my own logic from scratch. I think it would really help me if someone could give me a simple and general example to cover what I'm trying to do. Maybe something that switches between 3 modes based on a combination of 3 inputs, but won't switch until the current mode has been in place for X seconds. Thanks in advance for any help.
  8. Hi, I've been handed some PLC code and asked to make some modifications. The mods are minor but naturally I need to test them and use simulation mode to make sure it's good to go before it gets downloaded to the hardware on site. I've used RSLogix5000 quite a lot but I am new to Unity Pro S (using v5.0) and could do with some help. When I am in simulation mode and the simulated hardware is running I see I can use animation tables to force tag values. This works for normal tags but I don't seem to be able to force things within DFBs. For example, the mods I have made are to an SFC Transition Section. In the transition section is a simple AND block. I need the output of the AND block (and consequently the transition) to be TRUE so to do so, I need to force all of the inputs to the AND. However one of the inputs is an output variable from a DFB (ie "DFBName.VariableName") and it will not allow me to force it. Is there any way I can do this? If not then I guess the only way to achieve it is to follow this tag back through the DFB and force other tags to eventually get it to the value I need? Only thing is I did this and I run into the same issue: I need to force tags which Unity won't allow me to. The documentation for Unity doesn't seem great at first glance and I can't seem to get what I need from it. Any help would be great! Cheers
  9. Hi dimmitrisd, I'm not sure if I quite understand what you mean? Please can you try and explain it again and I will do what I can to help? The Modbus work I have been doing however is a little different. I have been working with a PC running some custom software which needed a Modbus TCP driver writing for it. I've not been doing the PLC side of things but what I do know is that the M340 acting as Modbus Slave shouldn't need any configuration. Just give it an IP and connect over the RJ45 Modbus port. Does this help at all?
  10. Thanks DanW! I'll check out that forum now :)
  11. Aha, i understand what you mean now. However we are going to be using RSLogix5000 :) Reading the data from the PLC won't be a problem, it is the coding (Cicode or VBA) to build the array elements back into a file that I am unsure of.
  12. I'm not sure quite what you mean? Do you mean list the elements of the byte array in a data file and read them from there? The way I am looking at it is that the PLC will have a register holding an byte array. If I read the array from the PLC like I read any other tag, I then need to make Citect process the array elements into a file and give it the correct extension (.jpg/.bmp). I'm thinking that a VBA function might be able to handle this?
  13. Brilliant! Thanks for that. Since posting I have been doing some reading online and your post has pretty much summarised everything I have read which is exactly what I was looking for. Thanks! Next stop is writing a Modbus TCP/IP driver. I need to read/write data from/to a PLC over modbus, from a PC running a custom piece of software (ie not a SCADA package with a built in Modbus TCP/IP driver). Anybody had any experience with this?
  14. Hi, I am trying to gather information on serial communication using a Modicon M340 and Modbus. I have never worked with serial comms or an M340 before and I have some really basic questions: 1. Modbus is a serial communications protocol that can be used over RS422. Is this correct? 2. How do you code the PLC to transfer data to another device over Modbus? Is there an instructions set which allows the message to be configured easily? 3. What is the difference between RS422, RS485 and RS232 and can they all be used to transfer data over Modbus? 4. I have heard of Modbus RTU, Modbus Plus, Modbus TCP/IP, can anyone give a clear brief description of each? I apologise if some of these questions are very general. I want to make sure I have the basics straight in my head before I go any further with things. Thanks
  15. The original image will most likely be of JPG or BMP format. I am told that the image file will be converted to an array of bytes. I am unsure of the model of the PLC which will create this byte array from the image file (which is originally stored on a the disk of a device acting as a DVR), but it will be passed to an Allen Bradley ControlLogix over a Rockwell DF1 radio link. The ControlLogix is where I need to read the byte array from and read the array elements back into a the correct file format. When the system is under development I will know for definite which type of image file (JPG or BMP) is being used so will know of the extension to apply to the built file. The image will then be displayed on a SCADA terminal running Citect. I know that Citect supports the display of BMP files. If it does not support JPG files then an image of that format will require further processing to convert it to BMP. If anyone else can think of a better solution to passing the image down the chain to Citect I'd be glad of it. I think the reason for the current situation is due to network segregation, ie the SCADA terminal is unable to see the first PLC (the one that holds the initial byte array representing the image file). I understand the concept seems a little unorthadox but it's not my call as to how the image is dealt with. I'm just investigating someone elses idea :)