With regard to "Collection example" in the store,
I'd like to know why there are no collections for real type variable.(RealList, RealQueue, RealStack)
if i want to add real type variables into a collection, do i have to convert them to int type variables??
Another question is, what is a limitation of size of dynamic collection. no limit?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Since the Collection Elements are FB types you can program whatever you wish.
So implementing a REAL or LREAL will not be an issue. Either you implement the Collection Interface or you extend collection FB type (read the extensive help on it). If you do this you can design your own Element FB types. This choice is up to you.
Thank you for your reply.
but still i don't understand how to implement real type collection.
the library provides bool,int, dint, udint, lint, string, wstring type collection. only real type is missing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It all depends whether you need a (unique) hash in your solution? If you don't need hash codes in your collection elements, my suggestion would be to remove it.
Thank you so much for your reply.
I need to use a hash table in my project, so i would make the hashcode unique.
Thanks for the new example site, very convenient.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi.
With regard to "Collection example" in the store,
I'd like to know why there are no collections for real type variable.(RealList, RealQueue, RealStack)
if i want to add real type variables into a collection, do i have to convert them to int type variables??
Another question is, what is a limitation of size of dynamic collection. no limit?
Hello,
Since the Collection Elements are FB types you can program whatever you wish.
So implementing a REAL or LREAL will not be an issue. Either you implement the Collection Interface or you extend collection FB type (read the extensive help on it). If you do this you can design your own Element FB types. This choice is up to you.
On "dynamic" collections:
In theory there is no limit to maximum size of the collection, but please read the following article very very carefully.
https://help.codesys.com/webapp/_cds_operator_new;product=codesys;version=3.5.16.0
Thank you for your reply.
but still i don't understand how to implement real type collection.
the library provides bool,int, dint, udint, lint, string, wstring type collection. only real type is missing.
If you look at this part of the example, you can build it yourself.
Thanks for your kind reply. I would try it.
I was able to build a libary for Lreal type except "hashcode".
According to comments in the element example, "hashcode" is used in a hash table. Is it correct to just use LrealValue as the hashcode?
It all depends whether you need a (unique) hash in your solution? If you don't need hash codes in your collection elements, my suggestion would be to remove it.
PS instead of searching examples in the store, try searching your examples here. It is a new feature and more convenient IMHO:
https://forge.codesys.com/prj/codesys-example/
Last edit: aliazzz 2020-11-21
Thank you so much for your reply.
I need to use a hash table in my project, so i would make the hashcode unique.
Thanks for the new example site, very convenient.