Skip to content

Allow usage of asynOctet interface for ADST_STRING #28

@AndreFavotto

Description

@AndreFavotto

It seems to be possible to read a parameter of type ADST_STRING only if the underlying linked record has DTYP set to asynInt8ArrayIn/asynInt8ArrayOut, as seen below:

case ADST_STRING:
switch(paramInfo->asynType){
case asynParamInt8Array:
// handled in fireCallbacks()
ret=asynSuccess;
break;
default:
asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s: Type combination not supported. PLC type = %s, ASYN type= %s\n", driverName, functionName,adsTypeToString(paramInfo->plcDataType),asynTypeToString(paramInfo->asynType));
return asynError;
break;
}
break;

That way, it is possible to retrieve the string value only explicitly formatting the waveform output value, i.e, caget -S <pvname>.
Instantiating an asynOctetRead fails with:

adsAsynPortDriver:adsUpdateParameter: Type combination not supported. PLC type = ADST_STRING, ASYN type= asynUnknownType

Feature Request: allow usage of asynOctetRead/asynOctetWrite.

Expected behaviour:

When trying something like

record(lsi, "$(P)$(R):MyLongString") {
    field(DESC, "my lsi")
    field(DTYP, "asynOctetRead")
    field(SIZV, "50")
    field(SCAN, "I/O Intr")
    field(INP, "@asyn($(PORT),0,1)ADSPORT=$(ADSPORT)/MAIN.text1?")
}
#or
record(stringin, "$(P)$(R):MyShortString") {
    field(DESC, "my stringin")
    field(DTYP, "asynOctetRead")
    field(SCAN, "I/O Intr")
    field(INP, "@asyn($(PORT),0,1)ADSPORT=$(ADSPORT)/MAIN.text2?")
}

we should be able to get the string values directly without output formatting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions