LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

in log file output few 00's are appended why? (Don't run the attached vi. It disables all the devices in your system)

Solved!
Go to solution

Dear all,

 

I have attached a zip file where co-existence.vi is the main vi file which communicates with a USB device and returns some ATR responses.

The responses are stored in a log file. I have attached the log file. In the log file at three places while displaying ATR, some unwanted 00's get appended. Please help me how it comes and how to remove it?

 

Thanks,

Mathan

 

[ Note: (Don't run the attached vi. It disables all the devices in your system) ].

0 Kudos
Message 1 of 4
(3,087 Views)
Solution
Accepted by topic author Mathan

It seems that the length depends on the value you get out of the dll (dwARTLen). You have it wired as 100, so it seems the dll simply returns the input. Maybe you want to check the documentation for the dll on how to get the real lenght.

 

 

A lot of your code is very confusing....

  • You have multiple subVIs that are basically identical, but with different names. Wouldn't one of those be enough?
  • What is the purpose of the FOR loop in the adhc.vi? Since you autoindex into a one-row array it will run only once and the result is the same as if you would delete the FOR loop.
  • Your main VI is extremely repetitive with lots of duplicate code. You have 12 instances of the filename constant, one would be enough! Enable.vi is identical to disable.vi except for a diagram constant. Many identical string constant ("ATR:", "Card access for device: ", etc.), again one each is enough.

 

Here a nice state machine would make all the difference.  You'll only need about 10% of the current code, eliminating all the repetitions. 🙂

Message 2 of 4
(3,077 Views)

altenbach wrote:

It seems that the length depends on the value you get out of the dll (dwARTLen). You have it wired as 100, so it seems the dll simply returns the input. Maybe you want to check the documentation for the dll on how to get the real lenght. 


Yes, i checked the documentation and as you told dwATRLen was an I/O parameter and hence just removing that input value now correctly just displays the proper ATR alone which is required one.

 


 What is the purpose of the FOR loop in the adhc.vi? Since you autoindex into a one-row array it will run only once and the result is the same as if you would delete the FOR loop.

 Thanks. I will follow this. 

 


  • Your main VI is extremely repetitive with lots of duplicate code.

That is actually required for some test cases. Leave this. Its completely necessary for particular test scenario. That's why.

 

 

Thanks thanks thanks a lot....

0 Kudos
Message 3 of 4
(3,066 Views)

mathan wrote:

That is actually required for some test cases. Leave this. Its completely necessary for particular test scenario. That's why.


That is very hard to believe. 😄

Message 4 of 4
(3,031 Views)