Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket 8406 #5

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

esmith1729
Copy link

@esmith1729 esmith1729 linked an issue Oct 10, 2024 that may be closed by this pull request
1 task
@@ -329,37 +329,43 @@ asynStatus ADSPortDriver::ADSConnect(asynUser *pasynUser) {
status = static_cast<asynStatus>(
adsConnection->resolve_variables(ads_read_vars));

if (status) {
if (status && lastReadError != status) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic not quite right here. Need two 'if' statements to return status regardless.

if (ads_read_vars.size()) {
        status = static_cast<asynStatus>(
            adsConnection->resolve_variables(ads_read_vars));

        if (status) {
            if (lastReadError!= status){
 LOG_ERR_ASYN(pasynUser,
                         "Could not resolve ADS read variable names (%i): %s",
                         status, ads_errors[status].c_str());
            lastReadError = status;
            }
           
            return status;
        }
        lastReadError = 0;
    }

Also applies to further 'if' statements, for write and sumread.

@@ -32,10 +32,10 @@
LOG_MSG_ASYN(asyn_user, ASYN_TRACE_ERROR, "ERROR", format, ##__VA_ARGS__)

#define LOG_WARN_ASYN(asyn_user, format, ...) \
LOG_MSG_ASYN(asyn_user, ASYN_TRACE_WARNING, "WARNING", format, ##__VA_ARGS__)
//LOG_MSG_ASYN(asyn_user, ASYN_TRACE_WARNING, "WARNING", format, ##__VA_ARGS__)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would rather keep these messages in case useful. Different case to above where repeated messages were lost.

return EPICSADS_NOT_RESOLVED;
}
last = "";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to reset last variable here? Could be done in the header file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Beckhoff: do not fill logs when PLC is disconnected
3 participants