Including string.h in the top of your .st file should allow you to use `strcmp`:
%%#include “string.h”
William
From: Tech-talk [mailto:tech-talk-bounces at aps.anl.gov]
On Behalf Of Manoussakis, Adamandios via Tech-talk
Sent: Friday, March 12, 2021 2:12 PM
To: tech-talk at aps.anl.gov
Subject: [EXTERNAL] SEQ Record Question
|
EXT email: be mindful of links/attachments.
|
|
Hello,
I am working on the sequencer record and wondering where to place conditionals, I was trying to do a string compare inside the when() but it did not want to compile.
I see some examples in the documentation where they place a conditional in the when() block
when (voltage > 2) {
/* turn light on */
light = ON;
pvPut(light);
} state light_on
}
But I have also seen where they have if statements inside of a when() with no check
when () {
if(strcmp(voltage, "STANDBY")==0){
/* turn light on */
light = 8;
pvPut(light);
} state light_on
}
I was hoping to do something like this
when(strcmp(voltage, "STANDBY")==0){
}
Thanks,
Adam