VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to manage several instances of the same custom device?

Hi all, something went wrong! Smiley Surprised

 

I'm working on a PXIe-1075 with two DAQ boards: one PXI-6259 and one PXIe-6358. Just to make some practice with veristand, i developed an asynchronous custom device able to interact with one DAQ card, acquiring 8 AI channels.

 

No errors when i deploy to the rt tatget a system definition file with one instance of the custom device which points to one of the two boards.

The errors raise when i deploy a system definition file with two instances of the custom device, the first pointing to one board and the second to the other.

 

Which can be the reason of this behaviour?

 

 

 

 

 

0 Kudos
Message 1 of 4
(5,870 Views)

custom device VIs are ran reentrantly by NI VeriStand. This works fine usually, but sometimes things go wrong if the custom device code has non-reentrant code inside it.

 

Some examples of things that would cause code interaction between two devices:

  • Passing data with global vairables
  • named queues
  • named fifos
  • Nonreentrant subVIs
  • Nonreentrant subVIs with internal shift registers or feeback nodes (a big no no)
    • Including "functional global variables" and "action engines"
  • Uninitialized shift registers or feedback nodes

Best practice in NIVS custom devices is make sure every VI you make is reentrant and you wire everything to everything (aka no "background data holding" or "saved state" stuff like the above list)

Stephen B
Message 2 of 4
(5,859 Views)

It would also help to know the error you are seeing. Another troubleshooting technique would be to try to run a system definition with just the second device pointing to the second board and see if that runs successfully. From your description I don't know if you've tried that yet.

Jarrod S.
National Instruments
0 Kudos
Message 3 of 4
(5,851 Views)

Thanks, i solved substituting global with local variables!

 

Anyway, Stephen, is what you said documented somewhere inside the NI manuals? If not, NI should be warned.

 

Smiley Wink

0 Kudos
Message 4 of 4
(5,833 Views)