From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best method to manage a digital I/O board from TestStand?

Hello,
 
I'm a beginner with TestStand (3.5).
I want to create some Step types in CVI to write/read to a digital I/O board (PCI6509).
What is the best way to do this?
I don't know if it is better to build 2 big groups (i.e 48 input / 48output) and read/write all simultaneeusly or drive the lines one by one.
 
I would like to create a reusable code, also for multithreading.
 
Any help will be appreciated
 
Thanks
 
baloss
 
 
0 Kudos
Message 1 of 5
(3,235 Views)
Hi Baloss,
 
Teststand is a Test Sequenzer. So the functions you want to realize are written in CVI for instance. The way you organize your steps depends on what kind of reports you want to have, Loops you want to realize and so on.
 
For Example, if you want to test a special Hardware with Outputs 1-5 and resulting signals from Inputs 1-10 and a second hardware with Outputs 6-11 to drive the hardware and resulting signals from Inputs 11-48, than you would use 2 Steps - one for each Hardware. Due this you can create a Report or Test  for every Hardware and you can reuse the Steps to retest the Hardware Components on a different Position.
 
I hope this is what you ment.
 
Regards,
Stefan Henke
NIG
0 Kudos
Message 2 of 5
(3,208 Views)

Hi Stefan,

I'm quite familiar with DAQmx acquisition used in a CVI executable.

What it is not so clear to me is to how to split the DIO operations for a TestStand sequence.

For example, I can:

  • build a step for the configuration of one DIO (this means call 96 of these steps for a PCI-6509)
  • build a step for the read operation (line by line)
  • build a step for the write operation (line by line)
  • build a step for terminate operations on DIO

or:

  • build a "Init" step where 2 large tasks are craeted: 1 for input, one for output. In the same function, start (a thread) for continuous digital input acquisition
  • build a step for "read" operation (in fact just read the variable or safe queue with last digital input value)
  • build a step for write operation
  • build a step for close operations

I don't know if other methods are preferable (i.e configure, read or write, and close at each step call?)

For each step, I can associate a Report text, as you suggested.

What is the "best" method?

 

Thanks

baloss

0 Kudos
Message 3 of 5
(3,183 Views)
Hi Baloss,
 
in the general point of view there is no "best" method to do this. Again, there are advantages in both ways - it is depending on the Test you want to do.
 
I would not recommend to create Tasks and do all the writing and reading in different steps. Sure it might be faster if you are able to get it work, but to get in work it will take a bit of effort. The Task Reference is not Global, so if you pass the Reference to TS and unload the VI from Memory, your Reference will not be valid anymore. If your using Multithreading in some ways you must handle the Resscource so that the Hardware is not blocked by another Task. You see it will be tricky.
 
I would recommend to write down, what Tests has to be done. Than you can define steps which are as general as possible. So if you want to read a line in one test and 5 lines in another, it could be a could idea to define a step in which you read a hole port into a array and depending on a input array with a "wanted line pattern" you can pass the results of 1 , 2 or more lines needed to TS.
You have one step in which you can perform every read request depending on a input from TS.
The Step will be self-contained and reusable and you can create a Report with the Read-Results.
The same way I would recommend for Write Operations. All with focusing on the Test Results you want to get.
 
I really hope that helps a bit.
Stefan
NIG
 
 
0 Kudos
Message 4 of 5
(3,178 Views)

Hi Stefan,

thank you for your input.

I will try to follow your suggestions. I will let you know.

 

Bye

baloss

 

0 Kudos
Message 5 of 5
(3,175 Views)