Hello,
I could use some help formatting an output from a waveform record that uses stream.
My IOC is built with:
Base 7.0.4
Asyn 4.40
StreamDevice 2.8.8
SNCSEQ 2.2.6
Here is the record definition.
record (waveform, "$(P)$(R):ScanListC")
{
field(DESC, "Send configuration command.")
field(DTYP, "stream")
field(OUT, "@daq970A.proto set_scan_route $(PORT)")
field(NELM, "22")
field(FTVL, "STRING")
}
Here is the stream protocol.
set_scan_route {
separator=",";
out "ROUT:SCAN(@%d)";
}
Here is the part of the SNL program that I use to put data into the waveform record. It may put anywhere from 0 to NUM_CHANNELS (currently 22) integers into the waveform record.
int scan_list[NUM_CHANNELS];
assign scan_list to "{P}{R}:ScanListC.VAL";
ss set_scan {
state construct_list {
when (set_scan_list == 1) {
set_scan_list = 0;
counter = 0;
for (channel = 0; channel < NUM_CHANNELS; channel++)
{
pvGet(channel_include_in_scan_901A[channel]);
if (channel_include_in_scan_901A[channel] == 1)
{
scan_list[counter] = channel + 101;
counter = counter + 1;
}
}
pvPut(scan_list);
} state construct_list
}
}
Here is the output on the asyn port when that part of the program runs after I have selected channels 101 and 103 on the MEDM screen and clicked the “Set Scan List” button.
ROUT:SCAN(@101,103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
What I want the output to be is:
ROUT:SCAN(@101,103)
Is there a way to have stream reject the zeros that are not valid data?
Chris
--
Christian Roehrig
Principal Controls Engineer
Accelerator Systems Division
Argonne National Laboratory
Office: 630-252-7278
Cell: 630-327-6855