Git Product home page Git Product logo

niveristand-aim-milstd1553-custom-device's Introduction

AIM MIL-STD-1553 Custom Device

The AIM MIL-STD-1553 Custom Device allows use of AIM MIL-STD-1553 PXIe Modules in VeriStand. The custom device targets one BIU (Bus Interface Unit) of an AIM MIL-STD-1553 PXIe module. To target multiple modules or multiple BIUs on the same module, use multiple instances of this custom device.

The custom device supports the following functionality:

  • Import configuration files via scripting and System Explorer
  • LabVIEW scripting of the custom device configuration
  • Viewing read-only configuration in System Explorer
  • Transmit and Receive configured messages, command words, and status words
    • Scheduled and Acyclic
    • Multiple parameters per message
    • Multiple messages per BIU
    • Log all messages per BIU

Using the Custom Device

Requirements

  • PXI Linux RT Controller
  • Supported AIM MIL-STD-1553 PXIe Module

Custom Device features based on bus function

Bus Function Single Function Full Function
Logging Yes Yes
Simulate RTs Yes Yes
Simulate BC Yes Yes
Simulate BC and RTs concurrently No Yes
Supports example assets No Yes

LabVIEW Source Code Version

LabVIEW 2021

Dependencies

Running the custom device

Real-Time target software components

  • AIM MIL-STD-1553 Board Software Package (BSP)
    • Must enable the ni-third-party feed in MAX to install the MIL-STD-1553 Board Software Package component

Developing or building from source

Note: This custom device was originally branched from the VeriStand Communications Bus Template. The guides for the template may prove useful when getting started developing or building this custom device:

Git History & Rebasing Policy

Branch rebasing and other history modifications will be listed here, with several notable exceptions:

  • Branches prefixed with dev/ may be rebased, overwritten, or deleted at any time.
  • Pull requests may be squashed on merge.

License

This AIM MIL-STD-1553 custom device is licensed under an MIT-style license (see LICENSE). Other incorporated projects may be licensed under different licenses. All licenses allow for non-commercial and commercial use.

niveristand-aim-milstd1553-custom-device's People

Contributors

ashukumani avatar buckd avatar douglasnorman avatar karl-g1 avatar papowerni avatar rtzoeller avatar

Watchers

 avatar  avatar  avatar

niveristand-aim-milstd1553-custom-device's Issues

Importing empty frames creates empty clusters of data that are compiled and passed around the custom device

Is your feature request related to a problem? Please describe.
Right now, if a major frame, minor frame, or acyclic frame is empty, it is still generated in the configuration data and compiled into the engine. Ideally, these would be skipped of the XML does not have any contained references for the frames, since they function as containers.

Describe the solution you'd like
I think ideally the Import code could be modified to check for the contained references, and if zero are found, skip parsing that item as if it were not there.

Describe alternatives you've considered

  • We could also continue to pass around the empty containers and notify the user that empty containers are in the XML in some way

Additional context
This was identified during PR #54

Scripting API for Ballard and AIM create naming conflict when used in the same project

Describe the bug
When working on a project where I need to script custom devices from either Ballard and AIM. If I mix both APIs in the same project, I get several naming conflicts as there are VIs with the same name, for example:

Shared folders (<vi.lib>\addons\VeriStand Custom Device Scripting APIs\Ballard MIL-STD-1553\Shared and the one for AIM) have VIs / ctls. with same name
Import folders have lvlib with the same name

To Reproduce
Use scripting APIs for both Ballard and AIM on the same project to

Additional context
One option I quickly tested is the creation of new libraries for those folders that don't have any and renaming the existing libraries with the same name. Something like:

Vendor / Protocol Current namespace Proposed namespace
AIM / 1553 MIL-STD 1553 Import.lvlib AIM MIL-STD 1553 Import.lvlib
Ballard/ 1553 MIL-STD 1553 Import.lvlib Ballrd MIL-STD 1553 Import.lvlib
AIM/ 1553 no namespace AIM MIL-STD 1553 Shared.lvlib
Ballard/ 1553 no namespace Ballard MIL-STD 1553 Shared.lvlib

Modify XSD to enable XML Serialization

Is your feature request related to a problem? Please describe.
In order to improve Serialization of XML files from applications written in LV or Python, I am proposing some changes to the XSD file to enalbe MS xsd utility to generate C# classes.

These changes should not impact the VS CD logic for parsing xml files.

Changes proposed (I have a PR ready for it):

line 55:
<xs:element type="xs:string" name="minorFrameRef" maxOccurs="unbounded"/>

line 180

remove
<xs:choice maxOccurs="unbounded" minOccurs="0">
add
<xs:sequence>

Minor Frame transmission is set to 0.001 milliseconds instead of configured value

Describe the bug
The "period" of the minor frame can be set in the parameters XML to a certain value, but currently the custom device ignore this and uses the default bus transfer setting of 0.001 milliseconds

To Reproduce
This was idenfitied will implementing Logging, which is not currently in the custom device. With Logging enabled, the extra frames can be seen in the logs.

Expected behavior
The minor frame parameter configuration should apply to the bus controller instead of the default value.

Screenshots
image

Implement Logging capability

The custom device should be able to log messages available to the AIM driver without explicitly reading messages by buffer ID.

Currently, the logging section is being scripted into the custom device upon initialization and some engine initialization is present. However, this will not be complete for the first release, so we will note in System Explorer that Logging is not yet enabled.

Example Parameters file specifies a buffer ID offset, which is confusing

Describe the bug
When using the Parameters file in the User Guide assets, the <startingBufferIndex>1</startingBufferIndex> makes it such that using this file for 2x BIUs on the same module will trample over the buffer ID allocation.

Expected behavior
When using the example Parameters file, the startingBufferIndex tag is not present, meaning the custom device should use the result of BIU ID * 2000 + 1 as the starting buffer ID.

Coupling mode logic in the Hardware API looks wrong

Describe the bug
The coupling mode / bus selection logic in the Hardware API's Set Device Coupling.vi appears to be incorrect.
It looks like the Both option only configures the primary bus, Primary only configures the secondary bus, and Secondary configures both.

Looking at changes to that file, PR #22 appears to have changed the case structure logic when the Both option was added.

Right now, selecting Both results in the Primary bus having its coupling mode set as desired, so this issue has probably been masked during real-world testing.

Screenshots
image

How To Set Execution Time of Messages Within Minor Frame

I would like to set the time each message is sent in a minor frame, relative to the start of the minor frame. As far as I can tell from the documentation the only timing that may be set is the period of each minor frame. Am I correct in this? How is the timing of each message determined? Does it launch each message in a minor frame as quickly as it can, waits until the minor frame ends, then executes the following minor frame? Is there any workaround to setting the execution time of each message?

Scripting example parameters file does not import subaddress information

Describe the bug
When running the Import Parameters Configuration scripting example, the BC and RTs, along with their command channels are correctly imported, but the subaddresses and messages are not imported.

To Reproduce
Steps to reproduce the behavior:

  1. Run the Import Parameters Configuration example.
  2. Open the resulting sysdef in System Explorer and see that BC and RTs exist, but not subaddresses or messages are present.

Expected behavior
Everything should be correctly imported.

Desktop (please complete the following information):

  • OS: Windows 10

Using multiple BIUs on the same PXIe module doesn't work

Describe the bug
AIM 1553 PXIe modules can have 1, 2, or 4x BIUs. These are targeted with a CD instance per BIU, and they should be able to be controlled completely independently. For example, the same Parameters file should be able to be used for 2x CDs targeting 2x BIUs on the same module.

Currently, the buffer and buffer header IDs used to address the low-level driver API in the custom device prevents this from working.

To Reproduce
Steps to reproduce the behavior:

  1. Use the parameters file below to create 2x CD instances targeting 2x BIUs on the same module
  2. Deploy and modify the Tx values on one of the Tx words
  3. See the Rx values for both CDs update

Parameters - One Message.zip

Expected behavior
The Rx and Tx channels of the same configuration file deployed to 2x BIUs on the same module should be backed by separate buffers. A few different approaches are possible:

  • Use a fixed buffer ID range based on the BIU number
    It appears that 8191 buffer/header IDs are addressable (from testing on 1x and 2x BIU modules). A simple solution would be to limit the custom device to ~2000 IDs per instance, then offset by the BIU number. This would limit the maximum number of messages/endpoints that can be simulated, but it is the easiest to implement
  • Share buffer offsets between custom devices
    There are many possible ways to do this: calculate the buffers needed and store it in the sysdef, use some form of global during initialization to store the last used buffer per module, etc. However, all of these require the custom device to access data outside of its own configuration, making the approach non-ideal.
  • Make a parameter available to superusers to define the starting buffer ID to use
    This is relatively easy to implement and would give advanced users a way to bypass a hardcoded limitation such as the 2000-buffers-per-CD option. Provide an optional scripting entrypoint for setting the initial buffer offset for each CD instance. When not in use, default to a hardcoded offset.

Screenshots

Today, the behavior results in the same buffer IDs being used. This makes the data read by message on both BIUs the same:

image
image

If different buffer IDs are used, the values are independent:

image
image

Additional context

Buffer and Buffer Header ID from the API help:

image

Implement Terminal state control channels and status channels

To enable users to control and monitor the state of the simulated 1553 Terminals (including BC and RTs) in their system, we should implement the state control and status channels for each terminal.

Currently these are scripted for each terminal but not used in the engine. We will remove scripting them until they are implemented fully, so this issue is a placeholder for future enhancement.

image

Tests have hard coded hardware parameters, but would be better if they were part of a configuration file

Is your feature request related to a problem? Please describe.
This could be a problem if tests are run on systems with hardware in different locations in the future, or if developers want to quickly run the test suite without changing hardcoded values or setting up an identical system to the ATS.

Describe the solution you'd like
They could be put in an ini file like targets.ini or another configuration file.

Describe alternatives you've considered
The way it is now can work, it just pushes people toward having identical hardware setups for all hardware and development, which could lead to bugs slipping through.

Additional context

Allow advanced users to specify which Buffer and Header ID range to use

Issue #50 was worked around in PR #53 to allow multi-BIU deployments. However, this used a simple ID offset based on the BIU number, limiting all custom device instances to ~2000 Buffer and Header IDs.

As an enhancement, we could allow advanced users to expand the number of IDs allotted to one custom device instance using one of these methods:

  • Share buffer offsets between custom devices
    There are many possible ways to do this: calculate the buffers needed and store it in the sysdef, use some form of global during initialization to store the last used buffer per module, etc. However, all of these require the custom device to access data outside of its own configuration, making the approach non-ideal.
  • Make a parameter available to superusers to define the starting buffer ID to use
    This is relatively easy to implement and would give advanced users a way to bypass a hardcoded limitation such as the 2000-buffers-per-CD option. Provide an optional scripting entrypoint for setting the initial buffer offset for each CD instance. When not in use, default to a hardcoded offset.

Time Conversion Ignores Milliseconds

The milliseconds of the IRIG time stamp input is ignored by "Source/Custom Device Support/Shared/Convert AIM Time Stamp to NI Time Stamp.vi". This can be reproduced by running the VI in isolation and observing that the milliseconds field of the Time Stamp output does not match the milliseconds field of the input.

Bugfix in screenshot below.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.