LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

testbench for myDAQ

Solved!
Go to solution

Hello everyone,

 

I am designing a testbench for myDAQ  I implemented it using a test VI for each function in testbench template and at the end i am writing all these results to a word file. Actually there is not any specific problem i want the community to please check this test if it needs any improvement specifically in report making.

Thanks in advance for you help and time.

 

Regards

Omer

0 Kudos
Message 1 of 10
(3,551 Views)

In general it looks ok, so you just run through certain functions using a state machine. You close the resources and references properly as I see after testing each DAQmx function.

Some parts should be fixed/cleaned up:

  • When you start the VI, first you check whether the myDAQ is present. If not, you stay at the "Start the test" case. The problem is, you should have some delay, otherwise you hammer your CPU (your CPU tries to run your VI as fast as possible). To avoid such problems, put some delay into the while loop, like 50 msec (Wait function).
  • The "SAving results" case: here you have many identical parts. I would put the "Word Edit Cell" subVIs into a FOR loop. If you build arrays out of your error booleans, error codes/descriptions (6 elements in each array), and autoindex these arrays into the FOR loop, your block diagram would clean up a lot.
Message 2 of 10
(3,533 Views)

So you could simplify some parts where you repeat same blocks, something like see below. Besides, personally I would not use local variables, but a cluster with 3 array elements (each size of 6) corresponding to the 3 types of values (error code, passed?, error string). I would add elements to this cluster through the steps of the state machine, and keep the cluster in a shift register.

 

testbench_BD.png

 

 

Message 3 of 10
(3,525 Views)

Thanks for such good ideas. Can you please clarify me the idea of clusters (3 array elements each of size six??) since i have not used them earlier or forward me a link where i can study them please.

0 Kudos
Message 4 of 10
(3,518 Views)

Hmm, maybe it is better to use a cluster with 6 subclusters. In this case you can convert the main cluster to array, and do the FOR loop as I showed above. Also, you do not need to split error cluster info at the cases, you can do this when you save info to Excel report.

 

myDAQ_testresults.ctl_FP.pngtestbench_BDddddd.pngtestbench_BDxdfd.png

Message 5 of 10
(3,509 Views)

Hello can you please attach the file myDAQ_testresults.ctl for 13 or 14 version. And also attach the pictures so it can be clear.

I will be very thankful.

0 Kudos
Message 6 of 10
(3,484 Views)

Also if its possible please tell me how will i then use it in report making. Since i am not very familiar with clustors and not an expert in LabVIEW. I will be very thankful.

0 Kudos
Message 7 of 10
(3,476 Views)
Solution
Accepted by Omershah

To see a picture (or save it) in bigger size, just right click on it with your mouse, and click on the first option in Firefox (show picture or something in English).

I have also attached the typedef control in version 2013. BTW, You should use a LabVIEW project, to accomodate your main VI and the typedef controls in one place.

 

So an example how to add elements to your typedef control:

 

add_elements.png

 

Unbundle the cluster for creating report:

 

unbundle_and_save.png

EDIT: finish the missing parts, and wires for your VI.

Message 8 of 10
(3,471 Views)

Thanks alot brother.

One more thing to ask can the report be any better means shouls i add some extra information in it or?

Thanks once again dear.

0 Kudos
Message 9 of 10
(3,461 Views)

I only checked the main "skeleton" of the VI, I did not examine the DAQmx part (the passed or not passed logic), neither the report making procedure. I have no idea what additional things involved during HW test. You should know what kind of tests you want to perform, and how you want to report it....

0 Kudos
Message 10 of 10
(3,447 Views)