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: 349
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: 1919

Currently Online:
39 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 726

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_gallery

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1