Adding a new data types

pierrer

Member
Join Date
Nov 2018
Location
Quebec
Posts
10
Hi,

I'm currently trying to use a GSV instruction in an AOI but i get block when it's time to create the parameter for the instance name.

I do know that i need to create an IN/OUT parameter. My problem is to give the right data type to the parameter (which is the MODULE data type).

Currently, i don't have the MODULE data type in the predefined one. Can someone help me add the correct data type in my list or help me recreate the data type?

Anything that i could try to copy to make my own data type ressembling the one i need Anything that i could directly import to my program would be even more appreciated.

Or maybe just redirect me in the right direction

Thanks in advance
 
Unfortunately you can't pass a module in a AOI because it's not a data type. It is an exact module reference you select from the available modules in the IO tree.
 
Correct me if im wrong....

But I did this exact same thing the other day. To pass a data type of 'MODULE' in an AOI; you need to be using RSLogix V24 or higher. It needs to declared as an In/Out Parameter.

When I rolled back the version- it then became incompatible; then the only solution was the collect the GSV outside the AOI then pass in as an Input Parameter.
 
Last edited:
JaxGTO said:
Unfortunately you can't pass a module in a AOI because it's not a data type. It is an exact module reference you select from the available modules in the IO tree.

Hi again,

For one of your Logix 5000 projects, where you have modules added to the I/O Configuration, if you go to the Module-defined section in the left hand side explorer, you will see the generic module-defined data types for all your added modules. Incidentally, if you've previously added certain modules but then deleted them, their module-defined data types may still be there. If a module type is currently not used in the project then the data types may be deleted. That's just a pedantic "clean-up" tip for those interested (but may also be useful to the OP here).

The actual instances for each module type added and their module-defined data type tags are of course viewable under Controller Tags.

So while they are indeed an "exact module reference" i.e. predefined, of which we choose to add as I/O modules, there are still made up of module-defined data types, of which are transparent to the End User, and usable with an AOI.

But, only under certain circumstances...

collinsd70 said:
Correct me if im wrong....

But I did this exact same thing the other day. To pass a data type of 'MODULE' in an AOI; you need to be using RSLogix V24 or higher. It needs to declared as an In/Out Parameter.

When I rolled back the version- it then became incompatible; then the only solution was the collect the GSV outside the AOI then pass in as an Input Parameter.

No correction required. You are on the money...

Before Logix Designer v24 you had the individual IN and OUT parameters available within the definition of an AOI. These parameters pass AOI argument tags by value only and are synchronous with the execution of the AOI instance, and hence slower. The value is referenced once during the execution of the AOI and is then not referenced again until the next execution. They are also restricted to the atomic data types only - SINT, INT, DINT, REAL and BOOL.

At v24 and above, the individual INOUT parameter was added, among other things. This parameter now allows us to pass AOI argument tags by reference. As such the value of the tags are not passed, only the reference. It is therefore asynchronous to the execution of the AOI, and hence faster. The tag is referenced during the execution of the AOI and may change again during a single execution (important to know). Most importantly here, it is not restricted to just the atomic data types but also supports arrays and structures i.e. message, motion group, all axis, and module data types.

So now we know that as of v24 we can use module-defined data types as a reference with INOUT parameters, but what good is it?...

New feature in Studio 5000 v24.00 -

Access to the Module Object

You can now reference a hardware module from within an Add-On Instruction using an InOut parameter with the MODULE data type. Full access to the hardware module from inside the Add-On Instruction allows you to generically reference the hardware module in the Add-On Instruction program code, and then connect to a specific hardware module through the InOut parameter in a GSV or SSV instruction. This includes access to the path to the module through the Path attribute in the instruction. You can then reuse the Add-On Instruction with different hardware modules without changing the Add-On Instruction program code. You can also write reusable, encapsulated routines to abstract the hardware so that you do not have to identify a particular hardware module in the routine. These features give you an increased amount of encapsulation which allows for a higher degree of modularity.

Nice, but how does one implement it?...

676548 - Using GSV instruction in AOI in RSlogix5000 v24 and higher
Access Level: Everyone

pierrer,

I've my fingers crossed that you are using v24 or above?...

Regards,
George
 
I've my fingers crossed that you are using v24 or above?... - Geospark

Sadly i only have the version 20. Is there a way to create my own data type that would ressemble the MODULE one and that i could use to replace it in my version 20?

Or is my only solution to migrate to version 24 or higher? (if i would prefer not to execute a GSV instruction outside of the AOI)

Just to be clear, i want to use the GSV instruction to monitor the communication between my program and my drives PowerFlex 525. Maybe i should find another way to monitor the communication that would not require me to use a GSV instruction.
 
Hi Pierrer

I had the same thought as you...the only solution I could think of was to try and pass MODULE in as a STRING but unfortunatley you cannot pass STRINGs into an AOI.

The only solution I have is to enable the GSV outside the AOI then pass in.

On some of my PLCs running <v24 I am using the technique as above for all EtherNet/IP Nodes. Any other PLC running >=V24 I am using the AOI fully encapsulated with the GSVs


Regards

Daniel
 
Last edited:
The only solution I have is to enable the GSV outside the AOI then pass in.
- collinsd70

Thanks for the info.

I also think I'm gonna have to use this method to have my AOI working.
 
I just recently updated my Powerflex 525 AOI to use the GSV online check exactly as you're wanting to do. Before that, I had another method of checking if the drive was online from within the AOI. It's quick-and-dirty, but it works.


There are two BOOL tags within your PF525 data structure (whose exact name I can't recall off the top of my head) called something similar to CommLogicCtrl and CommFreqCtrl. The first is true when the VSD is configured to receive a start/stop command by ethernet, and the second is true when the VSD is configured to use the ethernet speed reference. Now, I don't actually use these tags for anything within my AOI, because, well, if I'm not controlling start stop or speed over ethernet, why am I talking to it at all? So, to check if the drive is online, I unlatch those two bits and wait 250ms. If the drive is online and communicating normally, it'll turn at least one of them back on sometime in that 250ms (as long as your drive is configured to update at least that fast, adjust the time if not). So, after my 250ms is up, if both bits are still off, the drive is offline. If at least one bit has turned back on, the drive is online, and I turn them off again ready for the next test in 250ms time.

The reason I use both tags is because there are some instances where I've had to use hardwired start/stop logic and give the speed command over ethernet, or where I start/stop the drive over ethernet but the speed command is by analog signal from a legacy device. It's very unlikely that you'll ever be giving start/stop and comms from a source other than ethernet, and yet still trying to talk with the drive via ethernet. I've had it happen exactly twice since the PF525 was released, and I use them a lot.


Hope that helps!
 
A passing argument...

pierrer said:
Sadly i only have the version 20. Is there a way to create my own data type that would ressemble the MODULE one and that i could use to replace it in my version 20?...

To answer your question at face value - you can replicate many Predefined or Module-Defined data type structures by creating a User-defined Data Type (UDT). However, there are still a couple of things here that would prevent you from doing so -

1. The "MODULE" data type is listed under the Predefined data types but it is not exposed to the End User. You cannot create a module reference tag of your own without knowing its structure. It is special and only used to access the generic Module Object within a CIP module device. It is, in fact, not really a data type but more a CIP "Class". Also, while "Module-Defined" data types for hardware modules are exposed to the End User, they too are structures...

2. For v20 - (and as I've explained) you only have the "Input" and "Output" parameters available for an AOI definition which only pass reference tag values. These parameters do not support passing structured data types. Only the "InOut" parameter at v24 or higher supports the passing of structured data types or arrays, and by reference, not value.

So even if you could create your own "MODULE" or "Module-Defined" data types, you have no way of passing them with an AOI for a GSV/SSV instruction to reference them.

pierrer said:
...Or is my only solution to migrate to version 24 or higher? (if i would prefer not to execute a GSV instruction outside of the AOI)...

Yes, if trying to implement a GSV method to accomplish your goal.

pierrer said:
...Just to be clear, i want to use the GSV instruction to monitor the communication between my program and my drives PowerFlex 525...think I'm gonna have to use this method to have my AOI working.

Using a GSV to access module "EntryStatus" and "FaultCode" attributes is, in my opinion, the best way to determine if a module is status "Running" with respect to the controller. You can also timestamp the event so you can retrospectively see when a non-running or fault condition may have occurred. If you still want to consider using the GSV instruction in v20 to accomplish your goal...

47624 - RSLogix 5000: Using the GSV Instruction to Check Module Status
Access Level: TechConnect

1049147 - How can I monitor the Ethernet connection between my PowerFlex 525 drive and my controller?
Access Level: Everyone

552012 - PowerFlex Drives: Monitoring the Connection Status of a drive via a ControlLogix Processor
Access Level: Everyone

pierrer said:
...Maybe i should find another way to monitor the communication that would not require me to use a GSV instruction.

ASF said:
...I had another method of checking if the drive was online from within the AOI. It's quick-and-dirty, but it works.

There are two BOOL tags within your PF525 data structure (whose exact name I can't recall off the top of my head) called something similar to CommLogicCtrl and CommFreqCtrl...

Hi my friend, just me "hole picking". I know it's "quick-and-dirty" and has probably worked and been available for all "your" drive configurations, but just a little "did-you-know?"...

Input Status Tag:
CommFreqCnt = Main Frequency -
0 = Not Controlled by Active Com
1 = Controlled by Active Com

Input Status Tag:
CommLogicCnt = Operation Command -
0 = Not Controlled by Active Com
1 = Controlled by Active Com

These two Logic Status Word input tags are "Module-Defined" when you are using "Velocity" Mode. Within the Drive AOP, as you know, we can change this to "Position" Mode. This "Mode Select" option changes parameter C122 [Cmd Stat Sel] in the drive. If an application is using Position Mode, say with an Encoder feedback, then the Logic control is usually via the feedback and the speed reference is a preset frequency. As such, these two Logic Status Word input tags are not required for this Mode and are therefore not "Module-Defined".

Now you may say...

"...in that case why would I still have Ethernet communications to a drive in this sort of Position Mode?..."

Well, there may be a few reasons, such as wanting the ability to programatically or user modify a preset frequency for various steps, etc. But the simplest reason may also be just to monitor a drive's status, as we're considering here.

Granted, Position Mode may not be as common for many applications out there, and you may certainly have next to never worked on one with all the PowerFlex 525's you've done, but they do exist. That's the only reason I would mention it. If someone with a Positioning Mode application was attempting your method in an older project then they would certainly have been scratching their head thinking "what's he on about?". Other than that, not a thing in the World wrong with it.

As an alternative method, here is another little "did-you-know?"...

Note: This is available on the PowerFlex 525 only and is only for the Embedded EtherNet/IP interface (not the optional 25-COMM-E2P)

If you can afford, or have a spare Input Datalink, then way down the vast list, and belonging to the Fault and Diagnostic Group, you should find "683 - Com Sts-Emb Enet" - (type 683 in the field to find it quickly). This will Module-Define an extra INT input tag - "...I.ComSts_EmbEnet".

F683 reads back an INT but normally when communications are healthy the INT value will only display, or "appear" to display (I'll explain in a minute), as 3 digits decimal or one-hundred-and-eleven "111" (can be 4 digits if a higher level error is present; max value = 1911). Of the 3 digits normally observed, the least significant Digit 1 (right-most) represents the Embedded EtherNet/IP Receive (Rx) activity and the second or "middle" Digit 2 represents its Transmit (Tx) activity. Digit 3 (left-most) represents the Embedded EtherNet/IP "Active/Inactive/Faulted" status.

At the default module RPI of 20ms, and with a healthy connection to the drive, the 3 digits will appear to be static at "111", but in reality the Rx/Tx digit updates are actually faster than the software can display their transitions. At this RPI, if you watch for long enough, you may see the values "flicker" to "0" once in awhile. For demonstration, if you increase the RPI to say 100ms or higher, you may then start to see the Rx/Tx digits transition.

One method here could be to toggle a condition based on one or both of these transitions, and if either are static for a preset time, then flag a comms loss condition. I've not used this method and have only considered using it before, so it would need testing.

Similar to ASF's method, I have used this method before - if you continuously map this input INT to another INT and then continuously zero the value of the mapped INT, then the module should indirectly write a non-zero value back to the mapped INT after the next scheduled RPI, else time out and flag a comms loss condition, if the value equals zero for the preset time. You could also zero and mask examine just Digit 3 for this purpose but I don't go that far.

Mixed into that - you also may have the scenario where the comms have not been lost but the Embedded EtherNet/IP interface may be "Not Active" (Digit 3 = 0), or the interface may be connected but "Faulted" (Digit 3 = 9).

I also don't go this far, but you could additionally examine the Digit 3 value for "0" or "9" (or equals "1") value before you zero it to check comms. This way you can halt the zero instruction and flag a "Not Active" or "Faulted" condition instead.

PF525%20-%20F683.jpg


I also know that for some applications Datalinks can either be available or only to be used at a premium. In those cases there is one other method similar to the "lets zero something and monitor it for a change" method above (and ASF's). You could similarly look to the value of the ever present Module-Defined Logic Status Word - "...I.DriveStatus". This INT is the one that changes in its content based on which Mode (Velocity/Position) is selected. But we're not concerned here with the contents, just the INT value.

Without getting into what each BOOL within the INT represents for each Mode; suffice to say that for either Mode, the Logic Status Word INT should always be a non-zero value when there are status conditions being actively reported back from the drive. So if we likewise continuously zero a mapped copy of this INT, it should refresh to a non-zero value after the next RPI. So again, we can time this zero value out to a comms loss condition.

This cat is getting well flayed!

Regards,
George
 
Last edited:
Now you may say...

"...in that case why would I still have Ethernet communications to a drive in this sort of Position Mode?..."

Well, there may be a few reasons...

I knew someone would call me out on that one, and I rather suspected it would be you :p

There certainly are applications where my approach doesn't work - in my 7 years as a systems integrator I have found exactly two. So in both those cases, I used the GSV method instead. I could have used another datalink as you also suggested, but my PF525 AOI has the datalinks fully utilised.

If you don't have GSV available due to firmware restrictions, and/or your datalinks are all used up doing more useful things than checking to see if your drive is online, my quick-and-dirty fix will in most applications get you up and running (which is, let's be honest, pretty much the motto of quick-and-dirty solutions everywhere) (y)
 
Experience can be an assassin's needle or a warrior's broadsword...

ASF said:
I knew someone would call me out on that one, and I rather suspected it would be you...

I suppose it's more to do with the evolutionary trend of Industrial Ethernet communications to these drives becoming pretty much a given or necessity nowadays, regardless of what the drive or drives are intended to do within an application. If for absolutely "nothing" else, look at how much quicker and easier it is to configure these drives from Logix 5000 software once they are added into a CIP I/O Configuration in a project. Especially when there are many on Ethernet and they are networked. DHCP Persistence, ADC, Firmware Supervisor, allowing "quick-and-dirty" drop in replacements. Less need for "walk-up-plug-in" connectivity. Less and less need for dedicated software such as Drive Executive, DriveTools SP, Drive Explorer, and Pocket Drive Explorer. All now consolidated for these newer drives. CCW can also still be used for a reasonably quick and intuitive User experience with these drives on CIP networks.

ASF said:
...in my 7 years as a systems integrator...

I also suppose, whether 1 year, 7 years or 70 years at this, it all depends on the typical types of applications you've worked with. Your focus could be much narrower on Velocity or "don't care leave it at default" applications and someone with only 1 year experience may have already done several Positioning Mode applications.

Experience can be an assassin's needle or a warrior's broadsword. As I always say - "it is application dependent" and we can't really assume that our World is everyone's World, in such cases. This viewpoint is what usually keeps me focused on what is in front of me or ahead of me, more so than what is behind me.

ASF said:
...my quick-and-dirty fix will in most applications get you up and running (which is, let's be honest, pretty much the motto of quick-and-dirty solutions everywhere) (y)

Yeah, but my last one (DriveStatus) will get "all applications" up and running, so there ! :angr:

Hey!...While I'm praising the ease at which we configure these Drive AOPs in Logix Designer, I just remembered something that's changed and thought I'd share it here for those who've not met it yet but are likely to in the near future. Just when we thought we were becoming wizards at configuring our PowerFlex Drive AOP tabs, they've up and changed it all at Studio 5000 v31...

1072622 - PowerFlex AOP Design Change in V31 of Studio 5000
Access Level: Everyone

It's now "Synchronize" instead of "Match Drive" and you access it via the drop-down menu in the top-right corner, which I suppose makes it a bit quicker to get to.

The "Change" button that is normally accessed under the old "General" tab is now under the new "Overview" section that you access on the top of the left-hand side list. But "Change" is now called "Device Definition" (old "Change" opens "Module Definition" - so much the same).

When you open Device Definition you will see another list of options on the left-hand side. You can see these in the technote. The first is Identity and this should be what is currently open. It shows much the same basic settings as the old definition. On the left-hand list, if you select "Connection Format" you can then see the old "Mode Select" option which is now simply "Mode". Again, for Velocity or Position Mode.

Also underneath Mode you will now see an "Input" and "Output" tab. These are for the Datalinks.

Like the old Drive AOPs, the properties list obviously differs depending on which drive you've added. But if you poke around your drive AOP you'll find pretty much everything the same, just re-arranged and slightly renamed.

For me, the most interesting read in the technote is the fact that they have changed the Drive AOP layout in the more powerful and relatively expensive software that is Studio 5000 Logix Designer, to align with the changes made in the not so powerful and free CCW software. It's just aesthetics we're talking about here, at the end of the day, and it may have been the plan all along to visually align somewhere along the way, and CCW just "got there first". But I would hope that in all other aspects of software development the tail is not wagging the dog?

Regards,
George
 
Last edited:
I also suppose, whether 1 year, 7 years or 70 years at this, it all depends on the typical types of applications you've worked with. Your focus could be much narrower on Velocity or "don't care leave it at default" applications and someone with only 1 year experience may have already done several Positioning Mode applications
Absolutely true, and my intention was not to suggest that my experience is the baseline to judge anyone else's - only that there are at least 7 years' worth of wide and varied applications that will work with my quick-and-dirty solution, so it's a useful one to have in your toolbox. My comment about "if you're not controlling start/stop or speed over ethernet, then why are you talking to it at all" was intended to be a throwaway line to quickly convey an idea, not a hard-and-fast declaration of truth that I think is always applicable.


Yeah, but my last one (DriveStatus) will get "all applications" up and running, so there ! :angr:
Well, as long as "all" your applications...
Geospark said:
can afford, or have a spare Input Datalink
:whistle:

1072622 - PowerFlex AOP Design Change in V31 of Studio 5000
Access Level: Everyone

It's now "Synchronize" instead of "Match Drive" and you access it via the drop-down menu in the top-right corner, which I suppose makes it a bit quicker to get to...It's just aesthetics we're talking about here, at the end of the day, and it may have been the plan all along to visually align somewhere along the way, and CCW just "got there first". But I would hope that in all other aspects of software development the tail is not wagging the dog?


Interesting. Installing Studio 5000 v31 is on my hit list for today, so I'm interested to have a play with it. In my opinion the AOP design in previous versions left a few things to be desired, so hopefully this is a step forward, and not, as you say, the tail wagging the dog.
 
Details and facts...leave your feelings at the door...

Good morning A,

My meanings or intentions are often misconstrued on this Forum, and it does disappoint me when I feel I've possibly "irked" someone, even just a little. But I know we're not falling out here. We're too fond of each other for that.

Still, to make my position clear, as I'd hate to think I upset you, even just a little? (ya big softy!:ROFLMAO:)...

I wasn't dismissing your line of thinking at all my friend. Now that you have explained what you had meant I can say for sure I definitely understood your meanings. I was only pointing out a very small "loop-hole", if you will. Very small as I too, based on my experience, would argue there are far more applications out there and to come that will support your excellent method and that Positioning Mode applications are likely the lesser, in the main. So we are in full agreement on that. But still, positioning applications do exist, somewhere, for someone. That was all. It was in no way intended to detract from the method you put forward.

Also, on the Ethernet connectivity - I was not pulling you up on that either. Just pointing out a couple of reasons people tend to use it regardless of application dependency. Your thinking has merit for lots of situations, or I might argue it used to have? Granted, not every application has to have all the "bells and whistles". However, the reason I explained my thinking on why it is so prevalent was to point out that I think it has just become the norm, more so than a luxury add-on, or "bells and whistles". Aside from my narrow focus on PowerFlex drives and AOPs and the benefits they bring at configuration time, OEMs and users are naturally leaning (or racing?) towards Ethernet connectivity as the main player. Device-level smart connectivity has exploded with the Industrial IoT revolution that has begun. As I know you are aware. If our smallest of sensors and actuators are to be Ethernet (or whatever) capable slaves, and commonly utilized, then it stands to reason that slightly larger devices like drives and servos will de facto be networked to their masters. My point being, the reasons we might have decided to, or not to, network such devices have changed dramatically, and possibly the decisions even taken out of our hands, so to speak. That's what revolutions inevitably tend to do.

For me it's about details and facts, that's all. Giving good, accurate and informative information to the "Public", as best I know. Wherever I see something I think I can add to, or "slightly" correct, or even turn on its head, I will try to dispense whatever information I think is helpful. Both to the original author, and to other readers. I don't think "...will this hurt someone's feelings if I point this or that out?...". It should, as I'm sure most will agree, not. Especially when done politely.

As I often say in a work setting - Leave your feelings at the door!

So again, I hope my pointing out of the above didn't "go down the wrong way" with you?

Back in a min...just checking our comms status Geo<>ASF = ??? :ROFLMAO:

ASF said:
Geospark said:
Yeah, but my last one (DriveStatus) will get "all applications" up and running, so there !

Well, as long as "all" your applications...

Geospark said:
can afford, or have a spare Input Datalink

I think you've slightly misread how to implement my "second" method? I did bring two non-GSV methods to the table, you know? :D

My first suggested method does require an Input Datalink "...I.ComSts_EmbEnet" but for the second...

The Logic Status Word INT - "...I.DriveStatus" is, as I mentioned, ever present. It is Module-Defined and doesn't require a Datalink to pull it in to the controller. So it's always available when you drop in a PowerFlex 525 drive. It does change its BOOL contents depending on that Mode selection, but as I say, we can just look at the INT value, regardless of the current Mode.

Yes, details and facts! :nodi:

v31 - I don't think any specific features have changed in any meaningful way for the Drive AOPs, but there are some little changes in the software in general. But I won't spoil your fun. ;)

G.
 
Don't stress George, I have far too low a care factor to get upset by things on the internet ;)



I did miss your very last method using the DriveStatus, and you're right, that would get you over the line in all applications. If the OP is still following (doubtful!) then that's probably a good solution for them!
 

Similar Topics

Hello all, I am working on a project utilizing an s7-1200 cpu and Tia Portal v17. I currently have an external PCB with some sensors on it (and...
Replies
1
Views
792
Hi PLCs.net! I'm using Studio5k V32, and I have an EDS file for the Fanuc 30r-ib plus controllers. I have an excel spreadsheet with bitwise...
Replies
1
Views
1,484
Anyone know how to add weather history automatically to an access db? I want to display it on my reports page kind of like windows 10 does it on...
Replies
8
Views
2,314
Hello I was trying to add a "Message" data file in a SLC500 PLC controller. I'm not seeing the Message as a "type" to select. How do I add the...
Replies
4
Views
1,385
Hi folks, As the title suggests I'm trying to add tags to a data log without having to go into each individual block, pick out the bits I want...
Replies
1
Views
2,103
Back
Top Bottom