From: Kasemir, K. <kas...@or...> - 2016-08-29 12:53:12
|
Hi: If I understand your question correctly, you have an integer with several “magic” values. You want to display 30 as “State 1”, 60 as “State 2”, 100 as “State 3” and so on. The state strings aren’t very long, that’s not the problem. But you have more than 16 states, so the mbbi/mbbo won’t work. --> You’ll have to do some other database logic to convert the number into a string. In any case, since you do want to show the string in BOY, archiver, .. you really want a string-type PV being served by the IOC. Options: SNL/Sequence, sub record, aSub record, or maybe a bunch of records based on calc/calcout, sel and stringout records. # Worst case, need a pair of calcout and stringout for each state record(calcout, .. { ..INPA=“That Value” CALC=“A==60” OOPT="When Non-zero” OUT=“SetState1 PP” } record(stringout, “SetState1”) { VAL=“State 1” OUT=“TheStringRecord” } Actually not 100% sure about the stringout. How do you set its value to “State 1”? Cannot use DOL, because then “State 1” would be treated as a CA input link.. Could also use a calc record to turn the magic values 30, 60, 100, … into 0, 1, 2, 3, .. and then trigger the stringout records via a sel record. -Kay > On Aug 29, 2016, at 8:10 AM, Ralph Lange <Ral...@gm...> wrote: > > Channel Access supports strings longer than 40 characters only as "array of char". > There is no string manipulation record that works with arrays, as far as I know. So, using aSub record and coding your "conversion" in C might be your option. > Cheers, > ~Ralph > > On 29/08/2016 09:46, Claudio Rosati wrote: >> Hello all, >> >> a colleague here at ESS has the following problem: an integer number coming from an IOC should be always and everywhere (BOY, archiver, events, …) displayed as a string. >> >> This number has more than 16 different values (can be 30, 60, 100, …), and the string can be long (more than 40 characters), thus making MBBI unusable. >> >> Someone knows how to deal with them? >> >> Best regards, >> Claudio >> >> >> Claudio Rosati >> Software Engineer >> >> European Spallation Source ERIC >> P.O Box 176, SE-221 00 Lund, Sweden >> Visiting address: Tunavägen 24, Lund >> >> Phone: +46 46 888 34 24 >> Mobile: +46 721 79 24 24 >> E-mail: cla...@es... >> >> www.esss.se >> >> <Mail Attachment.png> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> >> _______________________________________________ >> Cs-studio-core mailing list >> >> Cs-...@li... >> https://lists.sourceforge.net/lists/listinfo/cs-studio-core > > ------------------------------------------------------------------------------ > _______________________________________________ > Cs-studio-core mailing list > Cs-...@li... > https://lists.sourceforge.net/lists/listinfo/cs-studio-core |