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

Scripting Support #27

Open
skthelimit opened this issue May 22, 2020 · 1 comment
Open

Scripting Support #27

skthelimit opened this issue May 22, 2020 · 1 comment

Comments

@skthelimit
Copy link

My goal is to create a script that add SLSC 12201 custom device under SLSC and configure each channel/port etc. Does this custom device support scripting in any way?

@buckd
Copy link
Collaborator

buckd commented May 26, 2020

@skthelimit Unfortunately, when this custom device was created, there was no scripting API created for it. Also, there are portions of the system definition for this custom device that contain information about the UI. However, if you were able to script the system definition without using the UI, I still think your system would deploy, you just wouldn't be able to open it in System Explorer and keep all the scripted properties.

That said, there are some VIs that are called by the UI that you might be able to use for scripting something. The primary VIs you would use would be SLSC-12201 DIO System Explorer.lvlib:Initialization VI.vi, SLSC-12201 DIO System Explorer.lvlib:SLSC Create Bank Properties.vi, SLSC-12201 DIO System Explorer.lvlib:Create Line Properties, and SLSC-12201 DIO System Explorer.lvlib:SLSC Create Commands.vi in conjunction with NI VeriStand - Set Custom Device Channel Default Value.vi.

For examples of how you might use these VIs, look at the Bank0 Select Vsup case in SLSC-12201 DIO System Explorer.lvlib:Main Page.vi. In this case, the bank properties are created and then based on the UI configuration, those properties are set to the correct values by finding the tree item in the system definition and applying default values so those are the properties set on deployment. You could probably write a wrapper VI around that to call from LabVIEW outside of System Explorer. However, I have not attempted to do this, so I don't know what issues you may hit.

Additionally, VeriStand does not provide a way to script SLSC modules into your SLSC chassis in the system definition. I needed that functionality for another SLSC custom device, so I made a library that will allow you to do this (with just a little more work). It's currently located in the Routing and Faulting Custom Device source, but I would like to make it a separate repo so it could be consumed by other projects. The library is generic, but in order to use it, you'll need to provide the path to the custom device XML and call the Initialization VI. To see how I did this, look at Add SLSC Switch Custom Device.vi. Screenshot below.

image

Additionally, the Routing and Faulting Custom Device has an example of using this library to add the module to a system definition.

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

No branches or pull requests

2 participants