Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Simulating EnumValues for MultiStateValueDiscreetType
March 28, 2023
12:21, EEST
Avatar
gaurav.kumar3
Member
Members
Forum Posts: 5
Member Since:
March 28, 2023
sp_UserOfflineSmall Offline

Hi,

We use the PROSYS client server SDK 4.10.4. We have a client implementation that uses EnumStrings and TrueState and FalseState properties to resolve points as an MultiStateDiscreetType and TwoStateDiscreet type as enums, because checks like “dataValue instanceof Enumeration” don’t seem to work. We’re trying to add support for MultiStateValueDiscreetType by checking for “EnumValues” property. But the simulation server doesn’t allow us to add an array of EnumValueType as the value of “EnumValues,” so we’ve been stuck with that part. Is that a known bug?

March 30, 2023
10:36, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

I’m not sure what you are applying the “dataValue instanceof Enumeration” check to, but the Values of TwoStateDiscreteType and MultiStateValueDiscreteType are not Enumerations. Those VariableTypes have Properties that provide descriptions of their Values but the Values of these Properties are LocalizedText and EnumValueType for TwoStateDiscreteType and MultiStateValueDiscreteType respectively. The intended way of using these VariableTypes is to read their Values as usual and then check the Properties for the meanings of those Values.

For example, if the Value of a MultiStateValueDiscreteType Variable is 3, then you could check its EnumValues Property for the meaning of 3 by searching the list of EnumValueType values for one with 3 as the value of its value field. Similarly for TwoStateDiscreteType, if the Value is True, then you would check the TrueState Property for the meaning of this Value.

Regarding Simulation Server, you should be able to define an array of EnumValueType values for the EnumValues Property of a MultiStateValueDiscreteType Variable, but apparently there is a bug that prevents doing that and instead allows you to define only one EnumValueType value. We are investigating the cause of this bug and it shall be fixed in a future release. Thank you for bringing this bug to our attention.

April 4, 2023
12:08, EEST
Avatar
gaurav.kumar3
Member
Members
Forum Posts: 5
Member Since:
March 28, 2023
sp_UserOfflineSmall Offline

Thanks Matti,

After writing here, I went on to follow the same methodology you mentioned, and I was able to parse the values as non-contiguous Enum. I had to use the UaCPP server to simulate the MultiStateValueDiscreetType for the time being. It would be nice to have a simulated point for MultiStateValueDiscreetType on the PROSYS simulation server.

Regards,
Gaurav

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
8 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 684

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1