justinmeyer77 Posted December 3, 2012 Report Posted December 3, 2012 I've seen references to an example project using data tables to create a kind of parameterized subroutine. However, I cannot find the example in the installed examples (Visilogic 9.4). Would someone be able to help me find this - or a similar example. I suspect I know how to approach this, but it's always nice to see an example. Thanks.
Gabriel Franco Posted December 3, 2012 Report Posted December 3, 2012 Take a look to: C:\Program Files\Unitronics\Unitronics VisiLogic_C\Examples\Version 900\Project examples\Data Table\V280_Function_Block_Multi_Process_via_Data_Tables.vlp
External Moderators tmoulder Posted December 5, 2012 External Moderators Report Posted December 5, 2012 There are two main reasons people look into using this method - reducing code line count and implementing some level of code portability. Reducing code line count stems from two laudable goals - reducing overall complexity and improving scan time. But ten minutes of serious review shows that this method does neither - in fact, the opposite. The way the code is structured under this method, it loads a different set of IO, timers, what-have-you into the ladder routine, processes it, then repeats using the next IO block. True, you only need one subroutine to manage multiple identical stations, but the complexity of loading, unloading (it's all based on indirect addressing) and managing the time-slice takes all of this and turns it into an impenetrable black box to your typical maintenance man. You need to be a pretty advanced programmer just to make sense of this method - pity the poor sparky just trying to see if his input is lighting up. With regard to scan time, some of the older PLCs, like the V280, had a scan time of up to 6 mS. Using this method 10 times on a bank of IO means each set is processed once every 60 mS. This latency can add up very, very fast. As for portability, the ability to reuse the code in another application, it doesn't play out so well either. The idea is that you can drop the routine and data table in another program, and assign IO values in the DT, and take off. This might be achievable, but in practice, I rarely ever have machines designed so similiarly as to allow me get away with it. I end up having to restructure the table, add this, disallow that, and would have an easier and faster time doing it in plain old ladder. Personally, I don't recommend using it. TM
justinmeyer77 Posted December 5, 2012 Author Report Posted December 5, 2012 Thanks for the replies. tmoulder: I agree entirely with your points. Well said. However, my application isn't a custom machine application - it's an OEM product. The PLC will be mostly, if not entirely, devoted to monitoring a CAN bus and setting, logging, and displaying parameters from one or more drives. Scan time is far less critical than in "normal" control applications. If scan time is less than 250ms, than everything will be fine. There will be limited control of the drives from the PLC and in those cases, I can reduce the scan time appropriately.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now