KB80298
Published: April 25, 2012
Revision: 3.0

OptoDataLink data update may fail with quick strategy tag updates


Applies To:

OptoDataLink

Versions Affected:

Problem was discovered in version: R8.1e
Problem is fixed in version: R9.1a

Resolved In Version:

Problem is fixed in version: R9.1a


Symptoms:

If a strategy variable is used by OptoDataLink to initiate a data exchange and the variable is updated too quickly to prompt another data exchange, then the data may not update. For example, the strategy sets a variable to 1 when a data exchange should occur. OptoDataLink exchanges data, and resets the variable to 0 if the Reset Opto 22 device value is checked. If the strategy sets the variable to 1 too quickly again, OptoDataLink may not detect the new request for data.

The image below shows how the Depending on Opto 22 device has the Reset Opto 22 device value set to indicate OptoDataLink should automatically reset the tag.

[image1]


Workaround:

Use the following logic to set the trigger variable back to True:

  1. Create a new Integer 32 variable such as nTriggerCount.
  2. Increment the variable nTriggerCount.
  3. Verify nTriggerCount rolled over to 0 and reset it to 1.
    (Reason: In PAC Control, Integer 32 variables are signed 32-bit integers. When a signed, 32-bit integer is incremented, it follows this incremental pattern: 0, 1, 2, ..., 2147483647, -2147483648, -2147483647, ..., -3, -2, -1, 0, 1, 2, ... All values evaluate as True except for zero.When the variable has incremented to zero, start over at 1.)
  4. Move the value of nTriggerCount to another Integer 32 variable nTrigger. In this manner, each time nTrigger is changed from false (0) to True (any non-zero value), it will be a value that is different from the last time it was set to True. This causes the data to be detected by OptoDataLink. When OptoDataLink detects the True value, it executes the next data exchange.

In OptoScript the logic is like this:

// Increment the value of nTriggerCount

IncrementVariable(nTriggerCount);

// Check to see if nTriggerCount rolled over to 0 and if so, set it to 1
if (nTriggerCount == 0) then
nTriggerCount = 1;
endif

// Copy the value of nTriggercount to nTrigger

nTrigger = nTriggerCount;


Resolution:

Opto 22 has resolved this issue.


Questions?

Contact: Opto 22 Product Support.
Phone: 800-835-6786 or 951-695-3080
Email: support@opto22.com


DISCLAIMER

This Opto 22 Knowledge Base ('OptoKB') article is intended to provide general technical information on a particular subject or subjects and is not an exhaustive treatment of such subjects. Accordingly, the information in this OptoKB article is not intended to constitute application, design, software, or other professional engineering advice or services. Opto 22 may modify the OptoKB articles at any time. Before making any decision or taking any action which might affect your equipment, you should consult a qualified professional.

OPTO 22 DOES NOT WARRANT THE COMPLETENESS, TIMELINESS, OR ACCURACY OF THE DATA CONTAINED IN THIS OPTOKB ARTICLE AND MAY MAKE CHANGES THERETO AT ANY TIME AT ITS SOLE DISCRETION WITHOUT NOTICE. FURTHER, ALL INFORMATION CONVEYED HEREBY IS PROVIDED TO USERS 'AS IS.' IN NO EVENT SHALL OPTO 22 BE LIABLE FOR ANY DAMAGES OF ANY KIND INCLUDING DIRECT, INDIRECT INCIDENTAL, CONSEQUENTIAL, LOSS PROFIT, OR DAMAGE, EVEN IF OPTO 22 HAS BEEN ADVISED ON THE POSSIBILITY OF SUCH DAMAGES.

OPTO 22 DISCLAIMS ALL WARRANTIES WHETHER EXPRESSED OR IMPLIED WITH RESPECT TO THE INFORMATION (INCLUDING HARDWARE, SOFTWARE, AND/OR FIRMWARE) PROVIDED HEREBY, INCLUDING THE IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTIBILITY, AND NON-INFRINGEMENT. Note that certain jurisdictions do not sanction the exclusion of implied warranties: thus, this disclaimer may not apply to you.

Copyright © 2024 Opto 22. All rights reserved.