Kou Posted May 20, 2022 Share Posted May 20, 2022 @attilaI have AD2 and ADP, and I use AD2 to run the program "Analogio_AnalogDISCOVERy2_power. CPP", which can output voltage, but there is no voltage output when I use ADP5250, is there any explanation for this phenomenon Link to comment Share on other sites More sharing options...
0 attila Posted May 20, 2022 Share Posted May 20, 2022 Hi @Kou For ADP5250 supplies set current limit too. Link to comment Share on other sites More sharing options...
0 Kou Posted May 23, 2022 Author Share Posted May 23, 2022 Hi.@ According to my understanding, this example did not output voltage at positions 1, 2, and 3, but only enable the supply channel, so I added voltage output later,When I used AD2, I ran my modified example, channel 0 and channel 1 could output voltage of 1 and -1,When I used ADP,channel 0 and channel 1 cannot output voltage of 1 and -1. Link to comment Share on other sites More sharing options...
0 Kou Posted May 23, 2022 Author Share Posted May 23, 2022 @attilasry,Because the ADP channel 0 and 1 corresponding to the two channel + 6 and + 25, so I can make it 1 v output, but the sample doesn't make 1 v channel output. Link to comment Share on other sites More sharing options...
0 attila Posted May 24, 2022 Share Posted May 24, 2022 Hi @Kou You are looking at the AnalogIO_AnalogDiscovery2_Power.py example which is for Analog Discovery 2 as the file name suggests. See the following for ADP5250: AnalogIO_ADP5250_Power.py Link to comment Share on other sites More sharing options...
0 Kou Posted May 26, 2022 Author Share Posted May 26, 2022 @attilaThank you so much,This solved my existing confusion. And I have one more question,In simple terms,I want to use the VirtualBench driver to drive the ADP 5250 directly. Can I do some work on the VIRTUalBench C code base so that it can call ADP5250? Link to comment Share on other sites More sharing options...
0 Kou Posted May 26, 2022 Author Share Posted May 26, 2022 NI has a digilent toolkit that can be used in LabVIEW,I know this,But my job is to write tests in C. I understand that since labView's toolkit for Digilent uses the VirtualBench API, there must be a way to call it in C Link to comment Share on other sites More sharing options...
0 attila Posted May 26, 2022 Share Posted May 26, 2022 Hi @Kou Yes, you could use nilcicapi.dll installed by VirtualBench or the rebranded dadp5capi.dll installed by WaveForms. C:\Users\Public\Documents\National Instruments\VirtualBench Documentation\ The C API is the same. Link to comment Share on other sites More sharing options...
0 Kou Posted May 31, 2022 Author Share Posted May 31, 2022 @attilaBut in the C driver, they initialize differently. Virtualbench.h: NIVB_LIBRARY_VERSION 302039040 niVB_Status NIVB_DECL niVB_Initialize(uint32_t version, niVB_LibraryHandle* handle); dwf.h: DWFAPI int FDwfDeviceOpen(int idxDevice, HDWF *phdwf); So,they’re different. How can I call ADP using virtualbench. H? Link to comment Share on other sites More sharing options...
0 attila Posted May 31, 2022 Share Posted May 31, 2022 Hi @Kou You can use the WF SDK to control the ADP5250 as described in the WF pdf manual and it is compatible with most of the examples. This device can also controlled natively with dadp5capi like this: C:\Users\Public\Documents\National Instruments\VirtualBench Documentation\ C:\Users\Public\Documents\National Instruments\VirtualBench ANSI C Examples\ C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\lib32\msvc\ nivirtualbench.lib #include <stdio.h> #include <windows.h> #include "nivirtualbench.h" // change functions in nivirtualbench.h like: // typedef niVB_Status (__cdecl *niVB_Initialize)(uint32_t version, niVB_LibraryHandle* handle); int main(void){ HMODULE hNil = LoadLibraryA("dadp5capi.dll"); if(!hNil) return 0; niVB_LibraryHandle hLib; niVB_Initialize vb_Initialize = (niVB_Initialize)GetProcAddress(hNil, "niVB_Initialize"); niVB_Finalize vb_Finalize = (niVB_Finalize)GetProcAddress(hNil, "niVB_Finalize"); //.... if(vb_Initialize(NIVB_LIBRARY_VERSION, &hLib)) { FreeLibrary(hNil); return 0; } //.... vb_Finalize(hLib); FreeLibrary(hNil); printf("done"); return 1; } Link to comment Share on other sites More sharing options...
Question
Kou
@attilaI have AD2 and ADP, and I use AD2 to run the program "Analogio_AnalogDISCOVERy2_power. CPP", which can output voltage, but there is no voltage output when I use ADP5250, is there any explanation for this phenomenon
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now