From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get channel value

Hi all,

 

in order to allow an asynchronous custom device getting the value of the channel of another asynchronous custom device, i discovered that the only function inside the NI VeriStand palette which delas with the retrieving of the value of a channel, is the "Get Channel Value By Data Reference" VI. Unfortunately, it only works with inline custom devices.

 

Considering that i already succeed getting the U64 reference of the channel, i'm wondering how to get the channel value using that reference.

 

Thanks!

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

HI,

 

Did you try to use named queues?

 

Kind Regards,

 

 

 

 

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

This is exactly why I tend to use Inline Custom devices.

 

I am not aware of a way to read channel values outside your custom device from an Aynchronous device, but I'd be eage to hear of one!

Chris
Project Engineer
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 3 of 6
(6,336 Views)

This function works in inline devices only because you are guaranteed that no other process is writing to the value when you are reading it from the inline device. This is because your device is running in the control loop and the control loop is waiting for your device before it continues.

 

The same is not true with an async custom device. It could try to read a channel value at the same time the control loop is writing to it. It might even be possible to read half of the old channel value and half of the new channel value, which would cause corrupted data. This is the reason the function is not supported in async devices.

Jarrod S.
National Instruments
0 Kudos
Message 4 of 6
(6,334 Views)

Above all, thanks for your answers.

 

The only way to access Veristand channels, as correctly noticed, is to use an inline custom device. If there is the necessity to perform other operations in parallel, the solution is to start an asynchronous VI in the initialization or start case of the RT driver of the inline custom device.

 

Usually, the generation of the channels references is done in the initialization or start case of the RT driver using the VI named "Get channel data reference". Considering that there can be the necessity (from a certain moment) to read/write a new set of channels, do you think that this VI can be called in the read from HW or write to HW cases too?


I think that the initialization and the start case execute only once (in the beginning), exactly like the stop case (in the end). Do you think it's possible to execute these cases more than one time without undeploy/deploy?

0 Kudos
Message 5 of 6
(6,235 Views)

Hello aRCo,

 

Though I have not tried it myself, you should be able to use the Get Channel Data Reference VI within the Read from HW and Write to HW cases and this is even mentioned in the help file for the VI. With regards to executing the Intialization and Start cases more than once, this is not a possiblity. The VeriStand Engine dictates when each of these cases are called and cannot be modified to call either of these cases more than once. Instead, behavior you need to have occur repeatedly either need to be in a launch async loop or in the Read from HW or Write to HW cases.

 

Lynn

National Instruments
Senior Systems Engineer
0 Kudos
Message 6 of 6
(6,196 Views)