Hi All,
I wish to have a structured datapoint, with one element in the structure of type "dyn_int", that is, an array of 16 bit integers.
Next I wish to provide a periphery address (Modbus driver in my case) to each member of the list.
As far as I could see, the PARA module allows me to provide an address to the dyn_list, not to its' single elements, therefore I'm able to read one single Modbus registry.
Is there a way to provide addresses to a given "n" of elements of a dyn_int array? I also tried some hacks with Control language but I failed.
Thank you for your attention,
Ezio
dyn_int datatype and periphery address
- aorange
- Posts:147
- Joined: Thu Nov 04, 2010 10:07 am
Re: dyn_int datatype and periphery address
Hi Eizo,
I don't think what you are trying to do is possible with a dyn datatype, I think you'd be better off creating a struct with 16 int type elements and assigning a Modbus address to each one of these. If you have a lot of structures of this nature that you need to create and parameterise, then I'd suggest embedding the DP-Type and parameterising each instance using CTRL.
I don't think what you are trying to do is possible with a dyn datatype, I think you'd be better off creating a struct with 16 int type elements and assigning a Modbus address to each one of these. If you have a lot of structures of this nature that you need to create and parameterise, then I'd suggest embedding the DP-Type and parameterising each instance using CTRL.
- Gertjan van Schijndel
- Posts:634
- Joined: Mon Aug 02, 2010 10:37 am
Re: dyn_int datatype and periphery address
If you have a really lot of structures of this nature, you could get a change request offer for this feature.
When the addresses are directly after each other, then the first address and the number of values are sufficient, just like the 'B' postfix in the snmp address parametrization.
Otherwise you have to specify a list of addresses, just like the '|' separated addresses in the snmp address parametrization.
When the addresses are directly after each other, then the first address and the number of values are sufficient, just like the 'B' postfix in the snmp address parametrization.
Otherwise you have to specify a list of addresses, just like the '|' separated addresses in the snmp address parametrization.
- olduser2343
- Posts:20
- Joined: Thu Jan 01, 1970 1:00 am
Re: dyn_int datatype and periphery address
Hi Jonathan, thanks for your reply.
I agree I chose the wrong datatype, but even using a "Structs.int" kind of Element, I'm not able to figure-out exactly the way I can apply a periphery address to each member of the struct.
I cannot see any hint of an underlying structure below the "Latency" element.
In the attached screenshot (StructDP) http://bbbsw.it/download/StructDP.png, you see what I get when I try do provide _address to my Struct (Subnet77.Latency): the same screen I see for the scalar datapoint.
One thing I noticed is that "LatencyScalar" has the "_original" config, whereas "Latency" has not.
The other two attachments show what I see when I click on the structured value (Latency.png) http://bbbsw.it/download/Latency.png that really looks like displaying an array of values and on the scalar value (LatencyScalar.png) http://bbbsw.it/download/LatencyScalar.png.
Unfortunately, there is no help available in help button of the Latency.png screenshot ... maybe, that would help
Thanks and Ciao,
Ezio
I agree I chose the wrong datatype, but even using a "Structs.int" kind of Element, I'm not able to figure-out exactly the way I can apply a periphery address to each member of the struct.
I cannot see any hint of an underlying structure below the "Latency" element.
In the attached screenshot (StructDP) http://bbbsw.it/download/StructDP.png, you see what I get when I try do provide _address to my Struct (Subnet77.Latency): the same screen I see for the scalar datapoint.
One thing I noticed is that "LatencyScalar" has the "_original" config, whereas "Latency" has not.
The other two attachments show what I see when I click on the structured value (Latency.png) http://bbbsw.it/download/Latency.png that really looks like displaying an array of values and on the scalar value (LatencyScalar.png) http://bbbsw.it/download/LatencyScalar.png.
Unfortunately, there is no help available in help button of the Latency.png screenshot ... maybe, that would help
Thanks and Ciao,
Ezio
- olduser2343
- Posts:20
- Joined: Thu Jan 01, 1970 1:00 am
Re: dyn_int datatype and periphery address
Hi Gertian ... I just missed your reply, as I was answering back to Jonathan.
>If you have a really lot of structures of this nature, you could get a change request offer for this feature.
No, it's not so "big" as to require a special feature, just figuring-out how to assign _address(es) to a Struct.
Or in case of a large volume of DP, I can manage with some clever CTRL script.
>When the addresses are directly after each other
Unfortunately this is not the case, we have non-contiguous address ranges, but we also have some contiguous too.
>Otherwise you have to specify a list of addresses, just like the '|' separated addresses in the snmp address parametrization.
Yeah, I'll try that and let you know ... ehm ... in which screen exactly can I put the "|"? The Modbus parameter screen does not allow me to put lists in the "Reference Number" field
Ciao and Thanks,
Ezio
>If you have a really lot of structures of this nature, you could get a change request offer for this feature.
No, it's not so "big" as to require a special feature, just figuring-out how to assign _address(es) to a Struct.
Or in case of a large volume of DP, I can manage with some clever CTRL script.
>When the addresses are directly after each other
Unfortunately this is not the case, we have non-contiguous address ranges, but we also have some contiguous too.
>Otherwise you have to specify a list of addresses, just like the '|' separated addresses in the snmp address parametrization.
Yeah, I'll try that and let you know ... ehm ... in which screen exactly can I put the "|"? The Modbus parameter screen does not allow me to put lists in the "Reference Number" field
Ciao and Thanks,
Ezio
- aorange
- Posts:147
- Joined: Thu Nov 04, 2010 10:07 am
Re: dyn_int datatype and periphery address
hmmm I am puzzled as to why you are seeing a DPE with no _original config, I have never seen this before.
Regarding the data structure that you are creating, your best bet would be to create a DPT with the following structure;
DPT
- Integer1
- Integer2
- Integer3
...
...
...
- IntegerXX
Then add a periphery address parameterisation to each datapoint element and parameterise them either manually or individually. If you have multiple Modbs subnets, e.g. Subnet77, Subnet78, etc. I would suggest using a master datapoint to set them all up with the correct configs.
Regarding the data structure that you are creating, your best bet would be to create a DPT with the following structure;
DPT
- Integer1
- Integer2
- Integer3
...
...
...
- IntegerXX
Then add a periphery address parameterisation to each datapoint element and parameterise them either manually or individually. If you have multiple Modbs subnets, e.g. Subnet77, Subnet78, etc. I would suggest using a master datapoint to set them all up with the correct configs.
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: dyn_int datatype and periphery address
Hello,
if you want to split a 16bit-array into single bits you can use the following solution if the items can be addressed using the subindex at the peripheral address. This only works for an input-address:
-- define an element of type bit-structure at the datapoint-type (Elements --> Structs --> bool at the DP-type editor)
-- below this structure node define the number of needed items
-- save the datapoint-type
-- create a datapoint for this DP-type
-- at the structure node you have to add the _address-config
-- define the peripheral address without defining the sub-index
The driver automatically splits the array into the single bits when a value from the PLC is received.
For counting the I/Os the number of elements below the structure node with _address-config is taken despite the fact that only one _address-config was configured.
Best Regards
Leopold Knipp
Senior Support Specialist
if you want to split a 16bit-array into single bits you can use the following solution if the items can be addressed using the subindex at the peripheral address. This only works for an input-address:
-- define an element of type bit-structure at the datapoint-type (Elements --> Structs --> bool at the DP-type editor)
-- below this structure node define the number of needed items
-- save the datapoint-type
-- create a datapoint for this DP-type
-- at the structure node you have to add the _address-config
-- define the peripheral address without defining the sub-index
The driver automatically splits the array into the single bits when a value from the PLC is received.
For counting the I/Os the number of elements below the structure node with _address-config is taken despite the fact that only one _address-config was configured.
Best Regards
Leopold Knipp
Senior Support Specialist
- olduser2343
- Posts:20
- Joined: Thu Jan 01, 1970 1:00 am
Re: dyn_int datatype and periphery address
Thank you Jonathan for your reply.
A few remarks.
>your best bet would be to create a DPT with the following structure;
Sure that's trivial and was my very first solution, but it's hard to handle from the application standpoint.
A list of integer datapoint elements does not allow the features and felxibility of arrays or structures, like addressing by index etc.
Since PVSS allows structured datapoints I wanted to exploit them for my application needs.
The hurdle is: "How do I assign a periphery address to an element of the Struct? How do I refer to such elements from GEDI or CTRL?"
I believe that if PARA allows a DPT to contain an array of int (a Struct, in my understanding), then, there must be a way to address the elements of such array, both in terms of periphery address or GEDI/CTRL.
Ciao,
Ezio
A few remarks.
>your best bet would be to create a DPT with the following structure;
Sure that's trivial and was my very first solution, but it's hard to handle from the application standpoint.
A list of integer datapoint elements does not allow the features and felxibility of arrays or structures, like addressing by index etc.
Since PVSS allows structured datapoints I wanted to exploit them for my application needs.
The hurdle is: "How do I assign a periphery address to an element of the Struct? How do I refer to such elements from GEDI or CTRL?"
I believe that if PARA allows a DPT to contain an array of int (a Struct, in my understanding), then, there must be a way to address the elements of such array, both in terms of periphery address or GEDI/CTRL.
Ciao,
Ezio
- olduser2343
- Posts:20
- Joined: Thu Jan 01, 1970 1:00 am
Re: dyn_int datatype and periphery address
Hi Leopold,
LK>if you want to split a 16bit-array into single bits
No, that's not what I want. I want an array on int(s) each one of them mapped to a Modbus address.
What I do have is a set of Modbus PLCs, each one of which is managing a number of devices, the input registers of the PLC hold operational parameters of the device, such as temperature, speed, latency etc.
The addressing of the relevant data inside the PLC memory is pretty much scattered, there is no such thing as a contiguous array of latencies.
I need to keep in check these parameters, so I want to have an array for all latencies, one for all speeds and so on.
LK>-- below this structure node define the number of needed items
That's cool ... where do I find the place to set this number of needed items? I think it could bring me a little forward.
Ciao and thanks,
Ezio
LK>if you want to split a 16bit-array into single bits
No, that's not what I want. I want an array on int(s) each one of them mapped to a Modbus address.
What I do have is a set of Modbus PLCs, each one of which is managing a number of devices, the input registers of the PLC hold operational parameters of the device, such as temperature, speed, latency etc.
The addressing of the relevant data inside the PLC memory is pretty much scattered, there is no such thing as a contiguous array of latencies.
I need to keep in check these parameters, so I want to have an array for all latencies, one for all speeds and so on.
LK>-- below this structure node define the number of needed items
That's cool ... where do I find the place to set this number of needed items? I think it could bring me a little forward.
Ciao and thanks,
Ezio
- olduser2343
- Posts:20
- Joined: Thu Jan 01, 1970 1:00 am
Re: dyn_int datatype and periphery address
Trying to add members to my Struct of Int (my "Latency" element) I found out that the Latency element is just a placeholder, sort of an empty vessel for holding integer subelements.
The good news is that this explains why Latency has no _original configuration.
The bad news is that I'm back to square one, the subelements are not a proper array, they cannot be indexed, it's a "static" structure, just as a plain sequence of integers elements.
So, I needed a change in strategy, I went back to the status of my original post, where I started with dyn_int (as in the thread subject) instead of a Struct of ints.
So, now, my "Latency" is a Dynamic List -> dyn_int.
dyn_int looks richer than Struct -> ints ; as you can see here:

There is a listbox where, probably, the values of the elements of the list can be displayed and a number of fancy buttons on the right of it.
Trouble is ... if I try to add new lines in the listbox (hinting to the possibility that I can add more data in my dyn list) they are cleared as soon as a new data read cames from the driver.
In the driver configuration panel, I can set only ONE address, no way to insert a "|"-separated list as Gertjan suggested.
Any way out?
Thanks you for your attention,
Ezio
The good news is that this explains why Latency has no _original configuration.
The bad news is that I'm back to square one, the subelements are not a proper array, they cannot be indexed, it's a "static" structure, just as a plain sequence of integers elements.
So, I needed a change in strategy, I went back to the status of my original post, where I started with dyn_int (as in the thread subject) instead of a Struct of ints.
So, now, my "Latency" is a Dynamic List -> dyn_int.
dyn_int looks richer than Struct -> ints ; as you can see here:

There is a listbox where, probably, the values of the elements of the list can be displayed and a number of fancy buttons on the right of it.
Trouble is ... if I try to add new lines in the listbox (hinting to the possibility that I can add more data in my dyn list) they are cleared as soon as a new data read cames from the driver.
In the driver configuration panel, I can set only ONE address, no way to insert a "|"-separated list as Gertjan suggested.
Any way out?
Thanks you for your attention,
Ezio