LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ant+ USB with LabVIEW

Solved!
Go to solution

Hello. Has anyone attempted to read sensor info via Ant+ USB into LabVIEW? I have some code that sort of works... regardless of whether I use the Dynastream provided driver or create a VISA driver using VISA Driver Wizard, I get the following errors in the LabVIEW VI "VISA Open":

"The specified VISA resource is not a USB device"
"Error -1073807346 occurred at VISA Open. Possible reasons: The given session or object reference is invalid."

I've tried using both "VISA Defaults" and "Load Configured Settings" for the "access mode" of the resource.

Any insight would be appreciated. LabVIEW code is attached. The main program is "Ahad_Vectorfinalpstruct_JFA" in JFA_Mod\Jamie.

Thanks,
-Jamie

0 Kudos
Message 1 of 11
(6,382 Views)
Solution
Accepted by jfalesi

Hi jfalesi,

 

This is Roel in Applications Engineering at NI. Some more information about your project might be helpful in assisting you. Are you able to see the device in NI Measurement and Automation Explorer (MAX)? If so, have you done a self-test? If yes to this also, try using the VISA test panels to interactively communicate with your task. Before troubleshooting code, it is best to follow these steps to ensure that the computer can indeed communicate with the resource.

 

Best of luck!

Best Regards,

Roel F.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 11
(6,335 Views)

Thanks Roel.  I managed to get it working with the help of NI-MAX and the VISA test panels.  Incidentally, I did a forum search on ANT+ and turned up no useful information.  Is no one else attempting to get LV to communicate with an ANT+ device (a Garmin Vector pedal in my case), or are we all too busy working in it to post about it?  😉

 

-Jamie

0 Kudos
Message 3 of 11
(6,080 Views)

Hello Jamie

I would like to read the data from the Garmin Vector pedals (Vector V2) in LabView. For this I use the Ant + USB Stick Garmin.

I have the following error messages:

10.JPG11.JPG

 

 

 

What settings you have made in MAX? Have you made changes to your VI (Ahad_Vectorfinalpstruct_JFA)?

for help I am very happy!

 

greeting

Ruedi

0 Kudos
Message 4 of 11
(5,670 Views)

Hi Ruedi.  Let me check and get back to you.  I have not worked on this project in quite some time - Unfortunately, I have been working in MATLAB lately 🙂

 

-Jamie

0 Kudos
Message 5 of 11
(5,651 Views)

Can You please explain about last parameter "Checksum" in your program...

 

What is it, how it is defined...?

 

I read this:

https://www.sparkfun.com/datasheets/Wireless/Nordic/ANT-UserGuide.pdf 

In Caption 7 ANT Interface there is 7.1 Message structure. It says : 

CHECKSUM: XOR of all previous bytes including the SYNC byte

But in your program there is just checksum of one byte calculated...

 

For example in your "Reset Ant-USB receiver" part of the program (see attached image), You calculate checksum of 0 and 239. Why there is 239? Why checksum only of 0?

0 Kudos
Message 6 of 11
(4,904 Views)

I know this is years late, but... yeah, that code is OBE, especially since I hear that LabVIEW supports ANT+ now (or is it the other way around?)

0 Kudos
Message 7 of 11
(3,256 Views)

Hi, 

I am trying to read data from an heart rate sensor (I can use either a Polar H10 or a Garmin HRM-Dual) on Labview v18.0.1 using the ANT protocol. I am aware that there is a Toolkit developed by iNU Solutions capable of interfacing with these devices and getting the job done more easily. However, I would like to develop a standalone solution with low-level functions. 

 

Firstly, I found the "Installing Visa Driver" pdf attached to this post. This document provides useful information on how to correctly install the VISA driver for Windows 7. However, I am currently using Windows 11. I tried following the steps contained in the pdf. I can see the device (with the name USB\VID_fcf&PID_1009). However, when I press it, no Descriptor Information appears (as shown in Figure 3 of the attached pdf) and I cannot continue. Did anyone face this problem? How did you solve it? 

 

Lastly, did anyone develop a VI to read data from these sensors? 

 

Thank you in advance for your help! 🙂

0 Kudos
Message 8 of 11
(61 Views)

Hi again,

unfortunately, I was not able to modify the previous message in time.

 

I wanted to add that this is what i see on my device and the errors I encounter while installing the VISA driver. I assume the error is due to the fact that there is no information in the "Descriptor Information" panel. However, I cannot fill it. Moreover, I don't know what I should write there. Do you know how to solve this issue? 

 

Again thank you for your help and time!

0 Kudos
Message 9 of 11
(46 Views)

Another person trying to go down into the dragon cave of USB Raw communication!

 

When NI introduced USB Raw support in NI VISA over 20 years ago, computer security was mostly concerned about preventing users to accidentally install Melissa and similar threats. The security landscape has since changed a lot and every piece of software is potentially a threat. This is especially true for kernel drivers. VISA USB Raw is a kernel driver that opens the door to the core of your operating system pretty wide.

 

Since Windows 7, Microsoft basically requires that every kernel driver needs to be signed or it will refuse to even try to install it.  And while the NI USB Raw driver is properly signed, the INF file generated by the driver wizard is not. And for the purpose of this discussion, the generate INF file to install VISA USB Raw as handler for your device is also a device driver. And NI can't sign it for you with their own certificate for several reasons. One of them is that they can not embed their certificate into the driver wizard as that would expose their private cryptography key in the certificate, and that would make their certificate worthless for everything (it would end up in no time in revocation lists and would not work anymore for any of their own software either).

 

While Windows 7 did allow self signed certificates, Windows 10 and newer requires the drivers to be signed with a real code signing certificate that has a trust chain back to one of the root certificate authorities. And maintaining a certification authority costs money, so those certificates are not for free. They cost typically a few 100 bucks per year. To make matters worse, Microsoft actually requires drivers since Windows 10 2018 or so to not only be signed with a normal code signing certificate but with a so called Extended Validation (EV) code signing certificate. EV means that the certificate authority will do extra checks that your business actually exists and is valid. It also means that you can only get a certificate if you have an actual registered business address. And the actual driver artefact (in this case your INF file) then needs to be sent to Microsoft for counter signing before the Windows 10 kernel will let you install it.

 

And if you think, but hey I don't want to pay for a code signing certificate, there are these open source certification authorities like LetsEncrypt, that must for sure work for this, you are out of luck. These provide so called SSL certificates that can be obtained for specific https URLs, but are not sufficient as code signing certificate and even less so as EV code signing certificate.

 

And while that in itself is already the death blow for almost any attempt to try to do VISA USB Raw communication, you are usually still far away from a working solution even if you could enable the USB Raw access for your device. USB Raw means that your device is accessed on a much lower level than your usual serial instrument. You are typically not sending text commands to such devices, but carefully crafted binary data arrays, with bits and bytes having very specific meaning. Most companies will not even give out the actual protocol documentation for their hardware and even if they do, you are basically looking at a document that looks more like your typical integrated circuit datasheet with register maps and all.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 11
(33 Views)