Skip to Content.
Sympa Menu

opal - Re: [Opal] String variable for aperture

opal AT

Subject: The OPAL Discussion Forum

List archive

Re: [Opal] String variable for aperture

Chronological Thread 
  • From: Christof Metzger-Kraus <christof.j.kraus AT>
  • To: Simon Friederich <s.friederich AT>
  • Cc: opal <opal AT>
  • Subject: Re: [Opal] String variable for aperture
  • Date: Wed, 1 Apr 2020 15:26:47 +0200
  • Authentication-results: localhost; iprev=pass ( smtp.remote-ip=; spf=pass; dkim=pass header.s=20161025 header.a=rsa-sha256; dmarc=pass

Hi Simon,

it seems that this isn't supported (yet). The variable names apert1 and apert2 are evaluated as strings instead of taking their values. 

Have to look into the code to check if we could change that behavior. 


Simon Friederich <s.friederich AT> schrieb am Mi., 1. Apr. 2020, 13:26:

Dear all,

As we have changing apertures throughout our beamline I'd really like to use string variables but I don't get the correct syntax. I want something like:

STRING apert1 = "circle(0.015)"
STRING apert2 = "circle(0.030)"

drift1: DRIFT, ELEMEDGE=0.5, APERTURE=apert1, L=0.5;
drift2: DRIFT, ELEMEDGE=1, APERTURE=apert2, L=0.5;

But the error appears
Error> *** User error detected by function "OpalElement::getApert()"
Error>     Unknown aperture type 'APERT1'.
Error>     Unknown aperture type 'APERT1'.

Do I miss something?

Best regards

P.S.: I know this workaround does it
REAL napert1 = 0.015;

REAL napert2 = 0.030;

drift1: DRIFT, ELEMEDGE=0.5, APERTURE="circle(" & STRING(napert1) & ")", L=0.5;
drift1: DRIFT, ELEMEDGE=1, APERTURE="circle(" & STRING(napert2) & ")", L=0.5;

But maybe there is a better way to do it.

Dr. Simon Friederich
Helmholtz-Institut Mainz
Kollaboration B / ACID
Johannes Gutenberg-Universität Mainz
Staudingerweg 18
55128 Mainz, Deutschland

Tel.: +49 (0)6131 39-23160
E-Mail: s.friederich AT

Archive powered by MHonArc 2.6.19.

Top of Page