BE

MrPLC Member
  • Content count

    41
  • Joined

  • Last visited

Community Reputation

5 Neutral

About BE

  • Rank
    Sparky

Profile Information

  • Country Australia
  1. Ahh, I didn't know about that method. Must remember that next time I am doing online edits, would probably be a bit quicker
  2. Open the Global Variables tab, the go to Project-Online Edit-Start. Same as you would for any other parts of your program. From memory, once you are in online edit in Global Variable, you can only add variables, they cannot be deleted.
  3. Are you looking for the execution time or the set period time? The "Set Period" time is setup in the the task settings. In the case of a program I have in front of me, it is set to 4ms (4000us), this is what photovoltaic was referring to. The Execution Time is the time that the PLC takes to run each cycle. This is what IO_Rack was referring to I believe. This can vary between executions (in my case 1.76ms - 2.7ms).   If you need the cycle time, you will know what that is from your Task Settings (in my case, 4ms), so just create a variable with the same value. If you are looking for execution time, then I dunno how that can be done.    
  4. When I am using the simulator, the initial time is the same as my PC time. The longer I run the simulator, the more these times become out of sync. On my PC, the simulator runs about 3 times slower than 'real life' (ie. 1 second in PLC time takes about 3 seconds of real time). This difference does cause the time in the simulation to become out of sync with the PC. I don't know if the simulation 'running slow' is normal or not. I have calibrated my PC, but it really the difference doesn't bother me when I am doing simulations, unless I have some timers set for longer periods of time.
  5. Out of curiosity, were the LAPP cables prefabricated or where they custom made cables using LAPP branded CAT6? On a different note, thanks for posting the end result 
  6. I haven't used Beckhoff IO. But on one of my projects I did have an Omron EtherCAT coupler with IO cards that was exhibiting similar behaviour. It ended up being a fault Ethercat Hub (Omron Junction Slave) that was downstream of the Ethercat Coupler (Network topology was CPU to Coupler to Hub to VSD's). Not sure if you have any of these in your network, but if so, see if you can remove them to test if you still have the same problem. To be honest, tech support didn't know why my setup was exhibiting that behaviour. I only removed the hub because I was at the stage of removing parts of the network so that I could find the problem area.
  7. Do you have any custom IAG's in you HMI that reference the datatype you are changing? I have encountered a similar problem before when I had custom IAG's in my project that referenced the datatype that I was changing, particularly when renaming or deleting members. I had to update them in my IAG project, and re-import them into my PLC/HMI project (remembering to delete the old version also). But that would only apply if you were using custom IAG's that referenced the datatype you are changing.
  8. Quite late to the party, but thought I would post in case someone else needed this in future. Normally I would also just put my "stop" contacts after the TOF output. But I came across a scenario where I really needed to be able to cancel a TOF timer when another function block completed its task (SQL inserts etc). So I created a Function Block for it. It goes inline in the ladder logic just like any other timer. There are 3 variables: "Initial Time" is the value that you would normally allocate to the PT of a regular TOF. "Delay Time" is the time between when the cancel bit is triggered and the TOF timer is cancelled (I needed this for my program, feel free to remove it if you don't need it for yours). "Cancel Trigger" is the bool that cancels the TOF. So lets assume "Delay Time" was set for 2s. If "Cancel Trigger" changes to True, 2 seconds would elapse before the timer output changes to False.  The block contains a standard TOF timer. When the "Cancel Trigger" bool changes to True, the PT on this timer changes to 0.1s, which causes the output to turn off. When the "Cancel Trigger" changes back to false, the PT value changes back to the "Initial Time" input value. As far as I can tell, when the PT changes to 0.1s, the output turns off and doesn't wait another 0.1s. I could be wrong about that, but either way, it worked for me . As for writing a value to the ET of a TOF timer, Sysmac Studio will throw errors during the program build, as you can't write to the output of a Function Block. Cancellable TOF Timer.smc2
  9. I have used the "GetTime" function previously. It outputs a variable with a DATE_AND_TIME data type that includes both date and time. It is based on the clock in the PLC, which does track date and time. I then used DT_TO_DATE & DT_TO_TOD to split up the date and time, but that was because I needed them to be separate for some CSV fields. This was using an NX102 CPU.  Edit: Screenshot didn't upload, apparently I can't upload JPEG files 
  10. If you run the HMI program in the simulator, can you see the values then? Or do they only not appear when actually connected to the HMI? Is it only Booleans that have the problem or is it all variables? What happens if you put a system variable from the HMI in the watch tab? Does it show a value?
  11. Viewing the values of a variable can be done in the "watch" tab or page. View-Watch Tab Page. Once you are there, you can type the name of the variable into the name field, and it will show you the value. It updates in real-time, so you can go to another part of your program, and still be able to see its value. If it is a value from physical I/O, you can also set a value for it. I have never had to use memory addressing, but I would assume that the value of the %D1000 address is the same as the variable assigned to it, and can therefore be view using the watch tab. I can't comment on the HMI side of things, as I only have experience with the NA series, and I assume you are using an NB series based on your other posts and because there is memory addressing in the variable table.
  12. I have not had your specific issue and by the sound of it you have done a pretty good job of trying to troubleshoot so far. The following points might help if you haven't tried them already: I assume this PLC is being connected direct to you PC. Have you manually set up the IP address etc on you PC? Is you colleague's PC running the same version of Windows as yours? Sometimes different version do different things (I have no idea why. That's above my pay grade ) This might not be possible, but are you able to connect the PLC to a router, connect your computer to that router and see if you can access it that way? (the router will need to be set up to use the relevant IP address range that the PLC is using). As you're using a laptop, is your WiFi turned off (airplane mode works well) when trying to connect to the PLC? I have had issues with this in the past. Can't think of anything else to try at the moment, best of luck 
  13. I created a function for this on my last project. It basically uses the method that @BobLfoot said, and also has an input so you can set how many decimal places you want. From memory, when looking at the output variable from this function, they still showed a heap of decimal places (ie. 123.45000000), but they were only ever trailing 0's. Personally, I needed it just to round off scaled temperatures & weights (which were on analogue inputs) to make my life a bit easier on the HMI side of things. I have attached the function below in case it might be of use. Trunc Real Decimals Function.smc2
  14. EtherCAT Issues

    I had a lot of EtherCAT issues on my last project, so played around with this a fair bit (ended up being a faulty EtherCAT hub and a fault VSD EtherCAT comms card). I found that if a cable is unplugged, all devices downstream of that cable disconnect (obviously), but everything upstream is fine. Plugging the cable back in resulted in the network reconnecting and working as intended. That said, I did have some code in place to automatically reset EtherCAT faults as the operators usually don't check such things, and if they do, the ring me for every little error . Without that code however, I can't recall if the EtherCAT automatically reset itself when an uplugged cable was reconnected. I can confirm that it definitely does not need a power cycle, but the error on the PLC might need to be reset/cleared (unless you code an automatic reset). Someone else might be able to confirm if the EtherCAT network resets itself without that code. As a side thought, the reason Omron say that could be (they might have other reasons too) is if you disconnect the slave from the network using sysmac studio or a button, no EtherCAT errors will be raised on the PLC. Basically, the device is still in the code and shown in the network topology, but the PLC no longer "looks for it" so to speak. I had to do this for one of my VSD's while waiting for a new comms card to arrive. However, my VSD was at the end of the network topology, and I don't know how downstream devices are handled if an upstream device is disconnected through Sysmac Studio (assuming the cables remain connected and the device is powered on).
  15. multifunction button NA5

    I am no expert on this, but if I had to create something like that, I would create an IAG for it along the following lines: Lamps: Create a bit lamp for each option. Set the OFF colour to be transparent, and the ON colour to whatever it needs to be Background: Create a shape the same size and shape as the lamps. It is to the the OFF colour. Manual Flashing: Create another the same size and shape as the lamps. It is to be the OFF colour and have 2 animations. 1 animation causes the shape to blink (with a transparent blink colour), the other triggers it's visibility. Both will use the "Manual Mode" bit as their trigger. Button: Create a button the same size and shape as the lamps. It is to be fully transparent. With all the above, you want to overlay everything in such a way that the Background is at the back, Lamps are next, Manual Flashing on top of the lamps, and Button on top of the whole thing. I haven't actually made what you are needing, so it might need some tweaking to get it right (kinda going off memory atm lol). The theory being that because all the lamps are transparent when off, any lamp can display. The manual mode is basically just a shape appearing over the buttons, and then blinking on/off with the same colour as the background, so it give the impression of a flashing lamp. And the button goes over the whole thing so it actually triggers when touching the lamp (I have lost count of how often I have inadvertently left the button under the lamp.........and then wondered why it wasn't working ) The variables can be set up to either be taken from a structure, individual booleans or a combination of both. The only catch with using an IAG, is should you use them in your HMI program, and then decide to adjust the IAG, the don't update in the HMI project. The new version needs to be imported into the HMI project, and then all the instances need to be manually replaced. Somewhat painful if you have a lot of instances. Moral of the story, get it right before using it lots