Gregory,
you can print into CSS console with:
from org.csstudio.opibuilder.scriptUtil import ConsoleUtil
ConsoleUtil.writeInfo("Hello!")
Luca
On Mon, 2018-05-07 at 21:17 +0000, Lang, Keenan C. wrote:
print(type(pvs[0])) would do it in a normal python script, though I'm not perfectly certain how CSS BOY handles output to stdout.
From: Gregory, Ray <[email protected]>
Sent: Monday, May 7, 2018 3:32:36 PM
To: Lang, Keenan C.; Engbretson, Mark S.; [email protected]
Subject: RE: error calling PVUtil.getString()
I am creating the PVs list in the OPI editor in the ‘Attach Scripts’ dialog. For pvs[0] I have defined it to be ‘$(S):INTYPE$(IN_CHN)_S’ in the ‘Input PVs’ tab of the ‘Attach Scripts’ dialog, where S and IN_CHN are macros.
Can you please tell me how to print
pvs[0]'s type in the code?
Thank you for your help,
--Ray
Your error indicates that pvs[0] is a different type of value than the function expects to find.
How are you creating the pvs list? And/or could you print what pvs[0]'s type is right before the command on line 24?
caget gives:
$ caget BL104:SE:LS:INTYPE0_SS
BL104:SE:LS:INTYPE0_SS Platinum RTD
The PV is a mbbo record.
--Ray
Ray Gregory
Data Acquisition and Controls
HFIR Instrument Operations
Instrument and Source Division
Neutron Sciences Directorate
Oak Ridge National Laboratory
Building 7964K Room 19
ph (865) 241-1116
cell (417) 827-6515
email:
[email protected]
Oak Ridge National Laboratory
1 Bethel Valley Road, MS-6430
Oak Ridge, TN 37830
What is the value of pvs[0] ?
In a CSS BOY OPI I am calling PVUtil.getString() from a script attached to my OPI. I am passing it one of the script’s PV values:
Line
…
22 from org.csstudio.opibuilder.scriptUtil import PVUtil, ScriptUtil
23
24 sensor_type = PVUtil.getString(pvs[0])
…
However I am getting the following error:
Traceback (most recent call last):
File "scripts/lakeshore_input_setup_monitor.py.py", line 24, in <module>
TypeError: getString(): 1st arg can't be coerced to org.csstudio.simplepv.IPV
What does this mean?
--Ray
<< Le informazioni contenute in questo messaggio di posta elettronica e relativi allegati sono riservate e confidenziali e ne è vietata la diffusione in qualunque modo eseguita. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invitiamo
ad eliminarlo e a darcene gentile comunicazione. Quanto precede ai fini del rispetto delle Legge 675/96 e del Decreto Legislativo 30/06/2003 n.196, sulla tutela dei dati personali >>
<< This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice of its status. Please notify us immediately by reply e-mail and then delete this message from your system. Please do not copy it or use
it for any purposes, or disclose its contents to any other person: to do so could be a breach of confidence. Thank you for your co-operation. Please contact our IT Helpdesk on +3902380481 or email [email protected] if you need assistance >>
|