ni / niveristand-scan-engine-ethercat-custom-device

Provides NI Scan Engine, EtherCAT and Remote IO support for NI VeriStand
MIT License
16 stars 22 forks source link

Add capability to get the references to the modules when looking for … #135

Closed oscarfonloz closed 3 years ago

oscarfonloz commented 3 years ago

TODO: Check the above box with an 'x' indicating you've read and followed CONTRIBUTING.md.

What does this Pull Request accomplish?

Adding the capability to get the references to the slots from the Find Local Chassis function

Why should this Pull Request be merged?

It is very useful for the scripting API to be able to get all the references to the slots inside a chassis

What testing has been done?

Added a unit test that ensures this functionality works properly

niveristand-diff-bot commented 3 years ago

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

Scan Engine Custom Device.lvlib--Get Local Chassis Active Slots References.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-09/20%3A09%3A58/Scan%20Engine%20Custom%20Device.lvlib--Get%20Local%20Chassis%20Active%20Slots%20References.vi.png)
Scan Engine Custom Device.lvlib--Get Local Chassis All Slots References.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-09/20%3A09%3A58/Scan%20Engine%20Custom%20Device.lvlib--Get%20Local%20Chassis%20All%20Slots%20References.vi.png)
Scan Engine Custom Device.lvlib--List Local Chassis Modules.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-09/20%3A09%3A58/Scan%20Engine%20Custom%20Device.lvlib--List%20Local%20Chassis%20Modules.vi.png)
Scan Engine Scripting API Custom Device Unit Tests.lvclass--test_Find Local Chassis Returns Modules.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-09/20%3A09%3A58/Scan%20Engine%20Scripting%20API%20Custom%20Device%20Unit%20Tests.lvclass--test_Find%20Local%20Chassis%20Returns%20Modules.vi.png)
Scan Engine Scripting.lvlib--Find Local Chassis.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-09/20%3A09%3A58/Scan%20Engine%20Scripting.lvlib--Find%20Local%20Chassis.vi.png)
oscarfonloz commented 3 years ago

@Sarci1 just reminded me that we need to return the slots in order, so this PR is not ready yet. I will add that functionality on Friday because I’m OOO tomorrow Thursday.

niveristand-diff-bot commented 3 years ago

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

Scan Engine Custom Device.lvlib--Get Local Chassis Active Slots References.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-11/14%3A58%3A02/Scan%20Engine%20Custom%20Device.lvlib--Get%20Local%20Chassis%20Active%20Slots%20References.vi.png)
Scan Engine Custom Device.lvlib--Get Local Chassis All Slots References.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-11/14%3A58%3A02/Scan%20Engine%20Custom%20Device.lvlib--Get%20Local%20Chassis%20All%20Slots%20References.vi.png)
Scan Engine Custom Device.lvlib--List Local Chassis Modules.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-11/14%3A58%3A02/Scan%20Engine%20Custom%20Device.lvlib--List%20Local%20Chassis%20Modules.vi.png)
Scan Engine Scripting API Custom Device Unit Tests.lvclass--test_Find Local Chassis Returns Modules.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-11/14%3A58%3A02/Scan%20Engine%20Scripting%20API%20Custom%20Device%20Unit%20Tests.lvclass--test_Find%20Local%20Chassis%20Returns%20Modules.vi.png)
Scan Engine Scripting.lvlib--Find Local Chassis.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-11/14%3A58%3A02/Scan%20Engine%20Scripting.lvlib--Find%20Local%20Chassis.vi.png)
oscarfonloz commented 3 years ago

@Sarci1 just reminded me that we need to return the slots in order, so this PR is not ready yet. I will add that functionality on Friday because I’m OOO tomorrow Thursday.

@rtzoeller @buckd I have addressed this concern and the PR should be ready for review :)

niveristand-diff-bot commented 3 years ago

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

Scan Engine Custom Device.lvlib--Get Local Chassis Active Slots References.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-11/16%3A00%3A04/Scan%20Engine%20Custom%20Device.lvlib--Get%20Local%20Chassis%20Active%20Slots%20References.vi.png)
Scan Engine Custom Device.lvlib--Get Local Chassis All Slots References.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-11/16%3A00%3A04/Scan%20Engine%20Custom%20Device.lvlib--Get%20Local%20Chassis%20All%20Slots%20References.vi.png)
Scan Engine Custom Device.lvlib--List Local Chassis Modules.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-11/16%3A00%3A04/Scan%20Engine%20Custom%20Device.lvlib--List%20Local%20Chassis%20Modules.vi.png)
Scan Engine Scripting API Custom Device Unit Tests.lvclass--test_Find Local Chassis Returns Empty Modules.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-11/16%3A00%3A04/Scan%20Engine%20Scripting%20API%20Custom%20Device%20Unit%20Tests.lvclass--test_Find%20Local%20Chassis%20Returns%20Empty%20Modules.vi.png)
Scan Engine Scripting API Custom Device Unit Tests.lvclass--test_Find Local Chassis Returns Ordered Modules.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-11/16%3A00%3A04/Scan%20Engine%20Scripting%20API%20Custom%20Device%20Unit%20Tests.lvclass--test_Find%20Local%20Chassis%20Returns%20Ordered%20Modules.vi.png)
Scan Engine Scripting.lvlib--Find Local Chassis.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-11/16%3A00%3A04/Scan%20Engine%20Scripting.lvlib--Find%20Local%20Chassis.vi.png)
rtzoeller commented 3 years ago

There is still an asymmetry between Add Local Chassis and Find Local Chassis, in that Add Local Chassis returns the user variables section. Since this change makes these entrypoints' signatures closer by adding the slots output, should we go one step further and add the user variables output?

oscarfonloz commented 3 years ago

There is still an asymmetry between Add Local Chassis and Find Local Chassis, in that Add Local Chassis returns the user variables section. Since this change makes these entrypoints' signatures closer by adding the slots output, should we go one step further and add the user variables output?

I like the suggestion. I added the indicator in the same place as the Add Local Chassis and swapped the Found boolean to be on top, instead. I also added the functionality to check that the user variables ref are correct when we test the function in the unit testing VIs

niveristand-diff-bot commented 3 years ago

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

Scan Engine Custom Device.lvlib--Get Local Chassis Active Slots References.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-15/11%3A37%3A39/Scan%20Engine%20Custom%20Device.lvlib--Get%20Local%20Chassis%20Active%20Slots%20References.vi.png)
Scan Engine Custom Device.lvlib--Get Local Chassis All Slots References.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-15/11%3A37%3A39/Scan%20Engine%20Custom%20Device.lvlib--Get%20Local%20Chassis%20All%20Slots%20References.vi.png)
Scan Engine Custom Device.lvlib--List Local Chassis Modules.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-15/11%3A37%3A39/Scan%20Engine%20Custom%20Device.lvlib--List%20Local%20Chassis%20Modules.vi.png)
Scan Engine Custom Device.lvlib--Main - Can Add Local Chassis.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-15/11%3A37%3A39/Scan%20Engine%20Custom%20Device.lvlib--Main%20-%20Can%20Add%20Local%20Chassis.vi.png)
Scan Engine Scripting API Custom Device Unit Tests.lvclass--test_Find Local Chassis Returns Empty Modules.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-15/11%3A37%3A39/Scan%20Engine%20Scripting%20API%20Custom%20Device%20Unit%20Tests.lvclass--test_Find%20Local%20Chassis%20Returns%20Empty%20Modules.vi.png)
Scan Engine Scripting API Custom Device Unit Tests.lvclass--test_Find Local Chassis Returns Ordered Modules.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-15/11%3A37%3A39/Scan%20Engine%20Scripting%20API%20Custom%20Device%20Unit%20Tests.lvclass--test_Find%20Local%20Chassis%20Returns%20Ordered%20Modules.vi.png)
Scan Engine Scripting API Custom Device Unit Tests.lvclass--test_Remove Local Chassis.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-15/11%3A37%3A39/Scan%20Engine%20Scripting%20API%20Custom%20Device%20Unit%20Tests.lvclass--test_Remove%20Local%20Chassis.vi.png)
Scan Engine Scripting.lvlib--Find Local Chassis.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-scan-engine-ethercat-custom-device/PR-135/2020-12-15/11%3A37%3A39/Scan%20Engine%20Scripting.lvlib--Find%20Local%20Chassis.vi.png)