VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Set Input Channel Value from Asynchronous Cutsom Device

Solved!
Go to solution

How can I set the value of an input channel from an asynchronous custom device in VeriStand 2016?  The input channel belongs to the custom device in my case.  The Set Channel Value by Data Reference documentation says, "This VI should only be called in the Execute Model case of a Model Inline Custom Device, or in the Read Data from Hardware or Write Data to Hardware cases of a Hardware Inline Custom Device. Do not use this VI outside an Inline Custom Device."  So I don't think I can use this VI.

 

Thank you,

 

Steve K

0 Kudos
Message 1 of 8
(3,544 Views)

Asynchronous Custom Devices communicate with the VeriStand engine using RT FIFOs instead of the Read/Write Channel By Reference VIs. 

 

There is more info in the VeriStand 2017 Help here:

 

  • Device Inputs FIFO—The array of inputs received from the system on the Device Inputs FIFO corresponds one-to-one to the Inputs array the Get Custom Device Channel List VI returns. The NI VeriStand engine pushes data to the Device Inputs FIFO every iteration of the PCL. If the FIFO is full, the new data packet will overwrite the oldest data packet.

A common architecture is to create an Inline custom device which then launches asynchronous loops. This will have extra overhead and complexity versus creating a standard asynchronous custom device, but we do have some tools available to get started. There is an Inline-Asynchronous Custom Device library as well as a LabVIEW project template wizard which will generate an example custom device here:

 

VeriStand Development Tools VIPC

 

 

0 Kudos
Message 2 of 8
(3,525 Views)

I want to set the value of an input channel from inside the asynchronous custom device.  For example, the RT FIFO channel value will be non-zero, then I want the custom device to return it to zero after doing something.

0 Kudos
Message 3 of 8
(3,519 Views)
Solution
Accepted by topic author Pie566942.0

My apologies - I read your question too quickly. 

 

Using an input channel as a "flag" as you describe is a common reason to use an inline-asynchronous architecture. I don't think there's a way to do this using a purely asynchronous custom device. 

 

 

0 Kudos
Message 4 of 8
(3,516 Views)

IMHO, a simple requirement like this shouldn't drive a complex design, but oh well.

 

Thanks for confirming input channels can't be written from async devices.

 

-Steve K

0 Kudos
Message 5 of 8
(3,509 Views)

I do not disagree. If you do need this functionality I highly recommend looking at the template/libraries I linked above if you haven't seen them already. They provide a significant head start to designing an inline + asynchronous custom device. 

0 Kudos
Message 6 of 8
(3,501 Views)

If you stumbled on this thread, the trick in the inline custom device is to obtain Write references to the Input channels you want to write, as mentioned here: https://forums.ni.com/t5/NI-VeriStand/Set-input-value-from-Custom-Device/m-p/3115637/highlight/true#....

0 Kudos
Message 8 of 8
(3,475 Views)