Jump to content


Photo
- - - - -

Mapping Inputs to memory arrays


  • Please log in to reply
3 replies to this topic

#1 rajsiyer

rajsiyer

    Sparky

  • MrPLC Member
  • PipPipPip
  • 264 posts
  • 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

Posted 18 June 2008 - 11:33 PM

:-(

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.

#2 tragically1969

tragically1969

    Sparky

  • MrPLC Member
  • PipPipPip
  • 177 posts
  • Country:United Kingdom
    United Kingdom

Posted 23 June 2008 - 04:44 AM

:-(

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

#3 rajsiyer

rajsiyer

    Sparky

  • MrPLC Member
  • PipPipPip
  • 264 posts
  • 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

Posted 26 June 2008 - 09:16 AM

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.

#4 tragically1969

tragically1969

    Sparky

  • MrPLC Member
  • PipPipPip
  • 177 posts
  • Country:United Kingdom
    United Kingdom

Posted 26 June 2008 - 09:46 AM

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 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users