ni / niveristand-ballard-milStd1553-custom-device

Custom device for Ballard MIL-STD-1553 hardware
MIT License
2 stars 4 forks source link

Checking if data changed prior to Tx writes is not valid when multiple instances exist #253

Closed buckd closed 3 months ago

buckd commented 5 months ago

Describe the bug This is the same issue as Ballard ARINC 429 issue 264.

When multiple instances of the custom device are run on a single target, the data check for whether any values have changed prior to writing to the driver is invalid and may cause not all data to be written.

To Reproduce Steps to reproduce the behavior: Create multiple instances of the custom device and note that values sometimes don't update if they are being changed to match values on the other core.

Expected behavior Each execution unit should have its own copy of the previous data to compare against the latest data.

Desktop (please complete the following information): Linux RT

Additional context The Ballard ARINC 429 issue was resolved by PR 265 and was implemented using call by reference due to urgency of getting a fix out and ease of re-implementing in case an older release of the custom device needed to be patched. Calling VIs dynamically likely is not as performant as performing the check inline in Write to Hardware.vi.

If performance issues are noticed it is also possible to implement this fix by keeping the previous values in the Execution Unit's class data and simply doing an equal comparison. This looks like what the [AIM MIL-STD-1553 custom device does](Source/Custom Device Support/Engine/Implementation/Tx Execution Unit/Write to Hardware.vi).

vijayvasu-ni commented 3 months ago

Fixed as part of https://github.com/ni/niveristand-ballard-milStd1553-custom-device/pull/255