VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Retain user channel value upon system failure or loss of power

Hello,

 

I'm using VeriStand 2012 with a cRIO-9022 and a pc for programming/workspace functions.

 

I have a real time sequence setup to cycle a part and increment a counter after each cycle.  The cycle count is included in a logging step.

 

In the event of a power failure or redeployment of the system definition file, upon restart of the stimulus profile, I would like to load the last known counter value into the user channel.  Is there a method to accomplish this?

 

I am relatively new to VeriStand and LabView in general.  If there is a method, can you please detail the steps or point me to a resource that outlines the process.

 

Thank you!

Michael

 

 

0 Kudos
Message 1 of 7
(6,326 Views)

Hey Michael,

 

When you say you want to load the last known value into the user channel, is this a channel that you are reading as a parameter in your real-time sequence?

 

This is a neat question. I'm trying to find a solution with only needing to use VeriStand and doesn't require manually setting the channel. My initial thought was to use a startup procedure to set the variable value but, I can't see an easy way to read something from a file as a reference.

 

I'm moving toward possibly creating a workspace tool, that allows you to load a file and set parameter values using .NET, but I'm not sure if that is the simplest solution. Are you opposed to doing a bit of development in LabVIEW to make this possible?

Tim A.
0 Kudos
Message 2 of 7
(6,306 Views)

Hello Tim,

 

Yes.  I'm using the channel, cycle count, to determine whether the test should continue or stop based on the cycle count channel compared to a channel that contains the total numbers of cycles for the test.

 

I am not at all opposed to using LabView to implement a solution.  I've attended Core I and II training but haven't developed anything outside of class so I'll probably need a good bit of help with the programming.

 

Thanks and I look forward to working through this with you!

 

Michael

0 Kudos
Message 3 of 7
(6,296 Views)

Hey Michael,

 

Glad to hear you're ready to start exercising those LabVIEW muscles! Admittedly, extending VeriStands capabilities using LabVIEW can be tricky at first but once you start working with it more, it has some great possibilities. I can think of a lot of different ways to approach this. I will list them out and some benefits/drawbacks and let me know which you think would work best for your application. Then, we can go from there.

 

A. Open the file from memory and manually enter the number. You can enter this number on your workspace The most work from the user but requires no added development.

 

B. Make a VI that updates the default value of your User Channel for your system definition. You can do this by opening the system definition before deploying your system, or by linking your User Channel to a control on your workspace and writing it on the workspace after the system is deployed. This is easy to develop because you have to do little coding, but it requires more manual inputs.

 

C. Create a VI that runs the stimulus profile using the VeriStand Execution Palette in LabVIEW. You can then use the Execution API's to set the value of a parameter in a real-time sequence. That parameter will be set based on LabVIEW loading your log file and reading what the last count number was. This is a little bit of code but it means you will have to run a LabVIEW VI to manage all of your tests. This may actually be a decent idea, because you can have LabVIEW automate your Stimulus Profile tests.

 

D. Create a VI that reads the count value from a log file, uses the VeriStand System Definition .NET API's (C:\Program Files\National Instruments\LabVIEW 2012\examples\NI VeriStand\API) to set the user channels default value in the system definition file automatically. You could call this VI into execution using either the Command Shell Step in the stimulus profile or by building it into a Custom Workspace Tool (using <labview>\examples\NI VeriStand\Workspace\Workspace Tool Example.vi as a reference), adding the workspace tool to the worksapce, and then open the workspace tool from the Stimulus Profile. This method is nice because it lets you do everything from the workspace and gives you a large amount of flexibility because you can setup the Workspace Tool to complete many different things aside from setting user channels values. The limitation here is the amount of work and coding. It will take time to program and setup these components.

 

E. Use TestStand to automate VeriStand and maintain all of your test information. TestStand has the ability to store configuration information across multiple iterations using station global variables. You could write to a count variable in between running your VeriStand Stimulus Profiles. This is similar to automating your tests using LabVIEW except its in a different environment. The advantage is that TestStand gives you a huge range of test sequencing capabilities (which is great if you plan on automating other software and hardware components outside of VeriStand) and it already has custom steps developed for automating VeriStand. The downfall though, is that this is a whole new set of software, if you don't already have it, and it is a whole new thing to learn!

 

Based on these, my recommendation would be as follows.

 

Best solution: C

Automating the Stimulus Profile from LabVIEW is not very complex and offers you a lot of capabilities. Plus you have the CoreI and II experience!

 

Best solution if you have TestStand experience: E

If you're comfortable with running automated tests in TestStand it will be the perfect platform for managing your Real-Time tests in VeriStand.

 

Best solution if you want to maintain your tests in the Stimulus Profile Editor: D

You wont have to use LabVIEW or TestStand to manage your tests but you will still have to do some programming.

 

I hope this gives a good overview without providing too much at once. I know it can be rough sometimes to drink from the fire hose. Cat LOL

 

What do you think about these options Michael? Which do you think would be most suitable for your needs? What else can I expand on for you?

Tim A.
0 Kudos
Message 4 of 7
(6,268 Views)

Hello Tim,

 

Thanks for all the great ideas!  I like option C with as little manual input as possible when running the test.  There are other values I'd like to set based on settings in the log file so I can see this working in multiple ways.  Can you get me started on this path?

 

Thank you.

 

Michael

0 Kudos
Message 5 of 7
(6,225 Views)

Hey Michael, 

 

I would start with the examples in the LabVIEW Example Finder, and by browsing through the VeriStand .NET API Help

 

The LabVIEW examples for VeriStand can be found using, 

 

NI Example Finder > (Browse by Directory Structure) > NI VeriStand > API > Execution API 

 

There are a couple good examples here that you can reference for Stimulus Profiles,

 

  • Stimulus Profile>Execute Stimulus Profile.vi - This example will show you how to programmatically run a Stimulus Profile from LabVIEW. 
  • Sequences>Stimulus Profile Control Tool.lvproj - This project presents a good example of a stimulus profile control tool

 

The .NET Help is located at, 

 

Start Menu: 

Start>All Programs>National Instruments>NI VeriStand 20##>VeriStand .NET API Help

 

It will give you a good overview of the different API's we have set for VeriStand. Remember that these API's are .NET Interop .dll's registered in the GAC. So any program that can leverage the .NET framework, can interact with VeriStand through these API's. 

 

Hope this helps!

Tim A.
0 Kudos
Message 6 of 7
(6,169 Views)

I have a similar application [retain user channel value upon system failure or loss of power] and was curious if there were any additional or new recommendations in light of later releases of VeriStand [ie. 2019, 2020, etc.] that do not utilize the Workspace? 

 

For my application, I will not be using TestStand or the Stimulus Profile Editor.  I'll be using VeriStand 2019 R3 with a cRIO running PharLap or Linux.  

0 Kudos
Message 7 of 7
(2,066 Views)