Forums › SA Series Discussions › SA-API
- This topic has 7 replies, 3 voices, and was last updated 7 years, 11 months ago by
Andrew.
- AuthorPosts
dwcParticipantI have recently gotten the following error when loading a program that uses the SA_API:
This application was unable to start correctly, (0xc000007b).
I don’t get this error on other computers. Spike works correctly on the same computer. One difference is that this computer runs Windows 10. Any thoughts?
AndrewModeratorHello dwc,
The first thing that comes to mind, is the ftd2xx.dll file present in the same folder as your executable?
Windows 10 shouldn’t make a difference.
You could try to run your application out of the Spike directory. You could use dependency walker to determine if you are missing any dependencies.
Are you using Visual Studio to develop your application? Are you able to run your application from within Visual Studio on the Windows 10 machine?
Let me know if none of these work.
Regards,
Andrew
dwcParticipantOK, that was odd. It occured to me that I did not have a spectrum analyzer attached. I expected it to tell me that, instead I got the error above. So I connected a SA44B and ran Spike. It appeared to connect, then gave some error about a bad connection. I ran it again and it worked. Then I ran my application and it worked. If I disconnect the device now it gives the normal “no device detected” error. Not sure what that was all about, but working now.
I am developing using NI LabWindows CVI.
AndrewModeratorHello dwc,
Thanks for the update. Are you using one of our Labview example .vi’s?
Unless the .vi specifically checks that saOpenDevice passed and aborts properly, it might continue on and error out on some array allocation/access error. If it is one of ours, we could revisit it to ensure it behaves properly.Regards,
Andrew
raja62ParticipantHi,
Would any one have tried using the SA_API in Visual Basic 2010.
I managed to get most of the functions working.
Now I am trying to get Peak Frequency.
But there is no specific function.
Any assistance is much appreciated.Thank you
AndrewModeratorHello Raja,
Here is the code for finding the peak frequency in C.
In the code below, you will already have sweepSize, binSize, and startFreq from the API, and you will have the sweepMaxArray from the get sweep API function. This should be easy to convert to Visual Basic.
double peak = -2000.0; // Small initial value
int peakIndex = -1;
for(int i = 0; i < sweepSize; i++) { if(sweepMaxArray[i] > peak) {
peak = sweepMaxArray[i];
peakIndex = i;
}
}double peakFrequency = startFreq + binSize * peakIndex;
double peakAmp = peak;Regards
raja62ParticipantHi Andrew
Thank you for your help.
I managed to get the peak frequency.
To get the peak power in dbm, what should I do?Thank you
AndrewModeratorHello Raja,
You can find the peak amplitude by searching for the largest value in the sweepMax array that is returned from the API.
Regards,
Andrew- AuthorPosts
You must be logged in to reply to this topic.