VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

modifying a procedure in labview

Solved!
Go to solution

Hi,

I am trying to change a variable in procedure which already created and saved in system definition file. I want to invoke that sys def file, change the procedure and deploy it on CRIO through LabVIEW. Is that possible ..?? If so Plz help me in this regard.

 

VJK

0 Kudos
Message 1 of 6
(6,240 Views)

Procedures are defined in the system definition.  The system definition gets compiled, deployed, and then runs on the execution target.  If you literally want to modify a procedure, you'll have to change the system definition offline then redeploy it.  There's probably a better way to get the end behavior that you want - either with a user channel, several procedures used together, maybe the execution API, or something else; but you'll need to describe your use case and requirements before we can give a solid recommendation.  What exactly are you trying to accomplish?

 

Steve K

0 Kudos
Message 2 of 6
(6,233 Views)

My question is how can I change the value of a Variable defined in procedure by using VeriStand APIs in LabVIEW. The aim is to have a GUI in LabVIEW where user

 

will set the value for the variable which is already defined in system def file and save the sys def file. After that the sys. def. Shall be dumped into the CRIO. I don't

 

want to open the system definition file and set the value of a variable in procedure manually. Every thing need to be done through labview from changing the value of

 

variable till dumping into the CRIO. I hope that my query is clear.

0 Kudos
Message 3 of 6
(6,225 Views)
Solution
Accepted by JKV999

The Procedure steps named "Set Variable" and "Set Multiple Variables" set VeriStand channel values.  Either step requires a "Channel to Set".  You can set "Channel to Set" to any one of the following:

  • Constant Value - Enable the "Use Constant Value" checkbox and specify the <value>.  When the step runs, "Channel to Set" = <value>.
  • Another Channel Value - Disable the "Use Constant Value" checkbox and specify a "Channel Value" that will source data to "Channel to Set".  When the step runs, "Channel to Set" = "Channel Value".
  • Function - Change "Function" to an operation other than "None".  Use the operation and either a constant or an additional "Channel Value" to source data to "Channel to Set".  When the step runs, "Channel to Set" = [Constant | Channel] [ + | - | * | / ] [Constant | Channel]

If I understand your case correctly, you can define a User Channel in the system definition called "Variable".  Create a "Set Variable" step in your procedure, and configure the step to set the output channel with the "Variable" channel.  The operator can change the value of "Variable" from the workspace, or by using the SetSingleChannelValue method, which is on the palette.

 

2012-01-10_162911.jpg

 

Steve K

Message 4 of 6
(6,213 Views)
also, if you must change that value before the system definition starts running on the target... You can use the system definition API to Change the value In the file before it is deployed
Stephen B
Message 5 of 6
(6,206 Views)

You might find the attached example useful. It doesn't change a procedure... but it does a lot.

 

To see how procedures are used in the sysdef API, see here:

C:\Program Files (x86)\National Instruments\LabVIEW 2011\examples\NI Veristand\API\System Definition API\Create a SDF File with Procedure.vi

 

You could use both of these references to assist in creating your own functionality.

 

Stephen B
0 Kudos
Message 6 of 6
(6,193 Views)