Can I Modify Custom Device Input from Itself

Updated Feb 28, 2023

Reported In

Software

  • VeriStand

Issue Details

In some situation, a Custom Device (CD) might process a Data and regarding the value read, I would like to overwrite the value on the input of the custom device.
This can be generic but in order to give a better explanation, let's take the following concrete example:

I've developed or use a Custom Device (CD) that read some digital signal on a specific protocol. This Custom device  (CD) decode the input frame and process the data. Some inputs of this CD are driven by the operator on the Veristand UI. Among these frames, the Custom device should be able to decode and react regarding a specific frame (ie: error frame). On this situation, the CD should report this event and the input of the CD should be set to a defined value.
 

Solution

In a CD, Inputs are write protected and you can only read this value. The main reason is to avoid race condition and let the mapping engine of Veristand to transfer the data into the CD inputs.

In this case, the best option is:
  • Create a output Flag that represent this frame decoding event inside the CD
  • In the system definition file, create an Alarm that is sensitive on this particular Flag.
  • When this Alarm is triggered, Call a Procedure
  • This Procedure will then be able to driver VeriStand Channels, and in this case, the Custom Device Inputs