Forums.MrPLC.com: Mapping Inputs to memory arrays - Forums.MrPLC.com

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Mapping Inputs to memory arrays How does one do it in Unity Pro 3.0 Rate Topic: -----

#1
User is offline   rajsiyer 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 264
  • Joined: 15-July 04
  • Gender:Male
  • Location:704/83, Panchavati Bldg., Vasant Vihar, Pokhran Road-2, Thane. (near Mumbai)India pin:400610
  • Interests:AB,Schneider, Citect, HIMA, Siemens,Intouch, ABB, GEFanuc etc. A seasoned electrical engineer.
  • Country:India
    India
:-(

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, :idea: If anybody knows how to tackle this, or at least shows me a way about, I would be genuinely grateful. :argue: 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 :burn: .

Why on earth have they complicated things in Uity Pro? beats me :helpme:

Regards., best wishes

Raj S. Iyer
My name is Raj. I live and work in my beloved country India, as head of projects, Prolific systems & Technologies Pvt. Ltd. I am primarily an electrical engineer from the College of Engineering Pune. (grad.1983). I look up to this site as friend philosopher and guide and always endeavor to help out my fellow automation engineers in any doubt.
0

#2
User is offline   tragically1969 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 177
  • Joined: 22-February 07
  • Country:United Kingdom
    United Kingdom

View Postrajsiyer, on Jun 19 2008, 05:33 AM, said:

:-(

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, :idea: If anybody knows how to tackle this, or at least shows me a way about, I would be genuinely grateful. :argue: 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 :burn: .

Why on earth have they complicated things in Uity Pro? beats me :helpme:

Regards., best wishes

Raj S. Iyer


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
0

#3
User is offline   rajsiyer 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 264
  • Joined: 15-July 04
  • Gender:Male
  • Location:704/83, Panchavati Bldg., Vasant Vihar, Pokhran Road-2, Thane. (near Mumbai)India pin:400610
  • Interests:AB,Schneider, Citect, HIMA, Siemens,Intouch, ABB, GEFanuc etc. A seasoned electrical engineer.
  • Country:India
    India
Hi tragic? :-0 ?(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. :-1

Raj S. Iyer
My name is Raj. I live and work in my beloved country India, as head of projects, Prolific systems & Technologies Pvt. Ltd. I am primarily an electrical engineer from the College of Engineering Pune. (grad.1983). I look up to this site as friend philosopher and guide and always endeavor to help out my fellow automation engineers in any doubt.
0

#4
User is offline   tragically1969 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 177
  • Joined: 22-February 07
  • Country:United Kingdom
    United Kingdom

View Postrajsiyer, on Jun 26 2008, 03:16 PM, said:

Hi tragic? :-0 ?(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. :-1

Raj S. Iyer


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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users