NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

passing arrays with Test Stand to DIO 96

Does anyone know the easiest way of sending data arrays from Test Stand to a DIO 96 using a LabView dll? I have a Test Stand sequence where I will need to set bits and read bits from a DIO 96 and am going to make a LabView dll. I guess I will need to pass either arrays to and from each port or numeric data to and from each port to a dll and also figure out how the status of the bits in the DIO 96 will be remembered.
What is the best strategy for dealing with Test Stand and a DIO 96?
Has anyone any ideas or example code?
 
 
0 Kudos
Message 1 of 6
(3,158 Views)

Hi,

I'm wondering whether you've had a chance to look at the following example:

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3E16F56A4E034080020E74861&p_...

I hope this helps!

Kurt.

0 Kudos
Message 2 of 6
(3,083 Views)

Another approach would be to make your own custom step type. Both general and specific examples can be found at:

http://zone.ni.com/devzone/devzone.nsf/webcategories/6F8978B74F0425D7862567F3001CF97F

I almost always create a custom step type with an Edit step to make it easy for a developer to use.
0 Kudos
Message 3 of 6
(3,078 Views)
Also, You can use nidaq32.dll his place in the windows\\system32 directory.
"Only a life lived in the service to others is worth living..." - Albert Einstein
0 Kudos
Message 4 of 6
(3,064 Views)

I guess I am trying to find the best strategy for passing data to and from a dll, and am still unsure what the best strategy is as I imagine the program that I am building is likely to be around for 10 years or more.

1) Should I use ordinary parameter passing to the dll or should I use active x? It seems to me that active x is more difficult to follow where the data is, how likely is active x to be still around in a few years?

2) Whether to do a Test Stand custom step as surely a Test Stand custom step can only be used for Test Stand, and is useless if you want to call the dll from another program? What advantage is a custom step?

 

 

0 Kudos
Message 5 of 6
(3,060 Views)
Hi Steve,
   either approach is perfectly valid, and as you say, the activeX approach does remove some of the flexability of where you get the data from, however, what you've really described is two separate things, rather than two separate styles of approach.
 
ActiveX or direct passing are simply the means of getting data from and to your TestStand data space.
Step types are a convenient way of wrapping up particular layouts and functionalilty into a very easily re-usable TestStand development item. You would still need some sort of code module to put with a step type, so you're not necessarily limiting your developed code to the Teststand environment.
 
Making links through ActiveX allows you to make a solid definition on configuration type items, and allow for edit substeps. For example, the NumericLimitTest step type has step.limits.high and step.limits.low. Rather than pass those to the edit substep as a dll call (which is perfectly valid), passing the sequence context (which also allows you to run the termination monitor etc) allows for the fixed references to the fixed data layout of the step. Self containment like this works when the data sources are fixed as you get with a step type to use the edit substep, or the pre/post substeps.
Working on a dll call allows more re-use because then you concentrate on the data, rather than where it's come from, however, for large amounts of different sources, the dll prototype can become very complex and difficult to document. You end up having to pass lots of parameters and some of them you might not use.
 
The question you're ultimately trying to answer is "what does it do to my architecture?"
 
The holy grail of TestStand architectures is any step type can be used in any sequence in any sequence file with any process model under any operator interface. Now this isn't always practical, but the closer you get to it, the more flexibility your system as a whole contains, and the easier it becomes to add in or change the layout / functionality of the system
With this comes code re-use, but the extra development time it takes to make good re-usable maintainable code isn't re-couped until the 4th or 5th re-use.
 
If you want in this case your passing of the array to occur from many different places in your sequences, and you're building up lots of sequences to use them, then making a step type, and passing through the most convenient method you decide upon will make the implementation of the sequences easier to do.
If you only need it in a couple of ways, then you can do without the step type, and if it's not many different data sources, then pass by parameter to the dll through the function prototype directly, and use a regular DLL adapter to acheive it.
 
Mostly my 2-cents worth.
 
Thanks
Sacha Emery
National Instruments
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 6 of 6
(3,041 Views)