rajsiyer Posted June 19, 2008 Report Posted June 19, 2008 Hi fellas, This one has flummoxed me for the past week! I've yet to find my way with Unity Pro.... PL-7 users may recalll that it is possible to map groups of PLC's inputs/outputs (both Digital & analog) to %mi and %mwi arrays like this, within an operate block For example transferring the bunch of 16DI at slot2 to a bit table beginning at %m100 was like this... |------------------------------- [%m100:16:= %I:2.0:16}-----------| or even when you want to read a group of 8 analog inputs from slot 4 (premium PLC) you do something like this. |---------------------------------------------[%mw100:8:=%Iw0.4.0:8]---------| Surprisingly, Unity Pro does not allow you to do this. There is this concept of an IODDT which is a special composite data type. Each channel on a I/o module has to be configured as an IODDT with channel referred to as %CHi. The corresponding equivalent to %Iw0.4.1 is nested as "%ch0.4.1.Value," as an integer element, within the IODDT's structure which of course consists of many other bits and integers. The implications of this kind of nesting means that for example...."%ch0.4.1.value" is not consecutive with "%ch0.4.2.value" and since these are not consecutive integers, the value property of each analog channel, cannot be readily moved to integer arrays! (integer tables that is). At least this is my understanding. Of course, its possible that I am terribly wrong, If anybody knows how to tackle this, or at least shows me a way about, I would be genuinely grateful. This problem for mapping large masses of I/Os raises its ugly head, whenever we use HMIs. For SCADA with OPC drivers, mapping is not required but HMI's require "located"variables . Why on earth have they complicated things in Uity Pro? beats me Regards., best wishes Raj S. Iyer
tragically1969 Posted June 23, 2008 Report Posted June 23, 2008 Hi Raj Look up the function MOVE_AREBOOL_INT, to map inputs to %MW60 your command would look something like this: MOVE_AREBOOL_INT(%I0.2.0:16, %MW60); Cheers
rajsiyer Posted June 26, 2008 Author Report Posted June 26, 2008 Hi tragic? ?(hate to greet anyone with that, esp one who is helpful!) Thanks. I tried Move_AREBOOL_ARINT and it works successfully. So does the COPY_AREBOOL_AREBOOL function block. So about 1/2 of my problem is resolved. However Move_ARINT_ARINT did not work with %IW adresses as compilation yields a topological adress mismatch error. Please experiment and revert. I think you need to write a function to extract the %IWi integer from the %Chi data structure by means of a for loop and deposit the integers in the target %mw array! But as I said, I'm still not an expert with Unity. Raj S. Iyer
tragically1969 Posted June 26, 2008 Report Posted June 26, 2008 Well half way there is better than nowhere !! Which PLC are you using ? There are slight differences between Quantum and Premium etc. for this type of thing
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